4
\$\begingroup\$

I'm working with an RN42 bluetooth module and trying to change the settings so that it doesn't accept any new device pairings. According to the command sheet, the command SX,1 should enable bonding which the user guide describe as telling the device to only accept connections from already paired devices.

I've tried the following command sequence in order to try to get this to work.

  • Factory reset (SF,1)
  • Reboot (R,1)
  • Clear all remote addresses (SR,Z)
  • Set bonding to enabled (SX,1)
  • Reboot (R,1)
  • Verify settings (D)

At this point, I am still able to pair devices with the module even though there shouldn't be any remote addresses stored and bonding is enabled. I've read through all of the commands and notes and can't seem to figure this out. My assumption is that I'm misunderstanding the bonding functionality. My end goal is to be able to pair a few devices with the module and then prevent connections from devices that weren't previously paired. Answers, ideas, or suggestions? Thanks in advance.

\$\endgroup\$
3
  • \$\begingroup\$ At which point are you setting the device address to which the RN42 can bond to? Perhaps no value in the remote address register is a wildcard. \$\endgroup\$
    – Samuel
    Commented Nov 15, 2013 at 3:07
  • \$\begingroup\$ @Samuel the specifications don't seem to mention anything about requiring a decide to be paired in order for the bonding to work, but it makes sense. I was just testing with a single device. I will try pairing a device and then testing the bonding functionality again. Thanks for the suggestion. \$\endgroup\$
    – Brian H
    Commented Nov 15, 2013 at 14:50
  • \$\begingroup\$ @Samuel, I tried pairing a device and then enabling bonded mode, but it doesn't want to work. The user markt made a great suggestion regarding the various quiet modes and that seems to work well. Thanks for your help. \$\endgroup\$
    – Brian H
    Commented Nov 21, 2013 at 0:37

1 Answer 1

2
\$\begingroup\$

As long as the firmware version is high enough, you can set it into Quiet Mode 2 (command: q,2) so that it becomes connectable but not discoverable. This won't make it impossible for others to pair with, but they need to know the MAC address in order to do so.

Another possibility is to have an attached MCU examine the incoming MAC address and, if it is an undesirable, reject it and drop the connection.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, this seems to work well. I really appreciate your help. I don't know why the bonding doesn't work (I'm probably misunderstanding how it's supposed to function), but with firmware 6.15 setting the module to quiet mode 2 allows previously paired devices to see and connect and other devices do not see the module. I feel silly for not seeing that the quiet command had different modes myself. \$\endgroup\$
    – Brian H
    Commented Nov 21, 2013 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.