0

I wrote a C program on an RPi 3B+ to connect to an electronic scale and read out the weight via BLE. It worked fine, I got a stream of correct weights. However, when I put the SD card in a different RPi 3B+ the program did scan and retrieve the MAC address correctly, but could not connect. It gave an error.

The error is produced after calling gattlib_connect in gattlib.c, which calls org_bluez_device1_call_connect_sync.

Are there any BLE setting in an RPi that are not on the SD card? Or what else can be the cause of the different behaviour of the two RPis?

2
  • The only difference I'm aware of is that the two RPis have different Bluetooth Device Addresses. Maybe you could post the btmon log that shows the failure?
    – Emil
    May 14, 2019 at 18:38
  • Thanks, you made my day. I will answer my question myself.
    – Jos
    May 15, 2019 at 8:35

1 Answer 1

0

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-bluetooth-device-address-on-raspberry-pi/

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

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.