0
\$\begingroup\$

My company is developing a Bluetooth-enabled robotics kit. We have found the following to be true:

  1. Pair device to computer A (a Mac)
  2. Pair device to computer B (a Windows PC)
  3. Computer A is now unable to connect to the device until...
    1. You ask computer A to remove the device from its list of paired devices and re-pair it. But...
    2. Doing so means computer B can no longer connect until it is re-paired.

The same process as outlined above works as expected if computers A and B are the same OS, e.g. both Windows or both OS X. That is, you can pair the Bluetooth device to multiple computers and connect any one of them at any time (provided you aren't currently connected to anything). No need to re-pair. But going between different operating systems causes a problem.

The Bluetooth chip is an off-the-shelf BM77 from Microchip.

We tried dumping the EPROM from the BM77 and diff'd the memory between each successive pairing. We found that after each re-pair (even on the same machine) the same 16 bytes would change starting at memory address 0x84. The documentation we have does not cover this memory range.

This does not seem like the expected behavior. Any insights?

\$\endgroup\$
  • \$\begingroup\$ Could happen if A and B shared the same BT radio address, e.g. trying to use the same USB BT dongle. \$\endgroup\$ – Turbo J May 18 '16 at 18:36
  • \$\begingroup\$ @TurboJ I am using the same brand of USB BT dongle, but each machine has its own dongle. \$\endgroup\$ – mekin May 18 '16 at 20:56
  • 3
    \$\begingroup\$ Possible duplicate of Bluetooth pairing on Mac and Windows causes one to dismiss the other \$\endgroup\$ – Mark Booth May 23 '16 at 9:53
  • 1
    \$\begingroup\$ This was cross-posted from Robotics, I have migrated the original here. \$\endgroup\$ – Mark Booth May 23 '16 at 9:54
  • \$\begingroup\$ The 16 bytes is undoubtedly the negotiated key after pairing. I suspect the problem is something to do with Apple's strange BT implementation and "dual mode", but this is a bit of a mystery to me. \$\endgroup\$ – pjc50 May 23 '16 at 10:17
1
\$\begingroup\$

The behavior you describe is indeed unusual, in fact, previous pairing should be lost regardless of the OS used. During pairing, Bluetooth host generates a link key which depends on the claiming device's MAC address and a random number. This key is the essence of pairing: two devices trust each other because they both know the link key. So, when you pair your device to the second computer, the link key gets overwritten and pairing to the first one is lost.

Since multi-pairing is not mentioned in BM77 datasheet, I assume it is simply not supported. You should take a look at different Bluetooth modules if you need it. For example, RN41/RN42 store up to 8 link keys in first in - first out fashion.

\$\endgroup\$
  • 1
    \$\begingroup\$ Microchip claims the BM77 supports 4 link keys, but we see the same one get overwritten each time rather than cycling through the 4 slots. Thanks for the help! Investigation continues... \$\endgroup\$ – mekin May 24 '16 at 20:15
  • \$\begingroup\$ That's good news, perhaps all you need is to find a config parameters which enables multi-pairing mode. \$\endgroup\$ – Dmitry Grigoryev May 25 '16 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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