Is there a way to pair a device in linux without requiring a pin(for testing purposes so I need it to be done w/out human interaction, assuming you have root access)?
bluez-simple-agent seems to require a pin except with some simple devices such as mice.
Go into the Bluetooth menu on your cell phone to find the passcode for your cell phone. The Bluetooth menu for your phone is typically located under the "Settings" menu. In the Settings menu, there should be an option to "Get code" or something comparable, which would allow you to find the code for your phone.
With newer devices, pairing usually happens automatically without any input from you. Older or lower-end devices may prompt you to enter a PIN as part of the pairing process.
Entering a PIN is actually an outdated method of pairing, now called Legacy Pairing. Secure Simple Pairing Mode is available in Bluetooth v2.1 and later, which comprises most modern Bluetooth devices. SSPMode authentication is handled by the Bluetooth protocol stack and thus works without user interaction.
Here is how one might go about connecting to a device:
# hciconfig hci0 sspmode 1 # hciconfig hci0 sspmode hci0: Type: BR/EDR Bus: USB BD Address: AA:BB:CC:DD:EE:FF ACL MTU: 1021:8 SCO MTU: 64:1 Simple Pairing mode: Enabled # hciconfig hci0 piscan # sdptool add SP # hcitool scan 00:11:22:33:44:55 My_Device # rfcomm connect /dev/rfcomm0 00:11:22:33:44:55 1 & Connected /dev/rfcomm0 to 00:11:22:33:44:55 on channel 1 Press CTRL-C for hangup
This would establish a serial connection to the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With