Page 1 of 1

BLE C program works on a RPi3B+, not on another one

Posted: Tue May 14, 2019 11:29 am
by Jos1
I wrote a C program to read weights via BLE from an
electronic scale. It worked fine. Than I put the SD
card in another RPi3B+ and it did not function
correctly. It connected to the scale, but gives
an error message when calling gattlib_connect.

Note: the SD card was the same in both RPis.

Any idea of the cause? Are there BLE settings inside
a RPi, which are not on the SD card?

Thanks!
Jos

Re: BLE C program works on a RPi3B+, not on another one

Posted: Tue May 14, 2019 6:05 pm
by Douglas6
Were they both Rpi3Bs? Firmware and capabilities may differ between the onboard chip and an USB adapter. Also, of course, the Bluetooth device address will be different between Pis, and that will affect pairings and such.

Perhaps the complete error message would help someone here?

Re: BLE C program works on a RPi3B+, not on another one

Posted: Wed May 15, 2019 11:51 am
by Jos1
Thanks for your answer. In the mean time I solved the problem.

The problem was solved by changing the MAC address of the different RPi 3B+ into the
one of the RPi 3B+ on which the program worked. I used this post for this:

https://scribles.net/changing-a-bluetoo ... pberry-pi/

Apparently an SD card is tied to a certain Bluetooth device MAC address, i.e., to a
certain RPi.