Need help / sample connecting to nrf528333 over BLE using Python from Raspberry Pi 4

Hi,

I have a Raspberry Pi 4 running the Raspberry (Debian) 32 bit OS version 11, and am in need of sample code to connect & read/write to a Nordic nrf528333, using Python 3. I am able to see the Nordic device using command line utilities, using a locally compiled BlueZ stack. But I am lacking any example code of how to actually read & write data from/to the Nordic device using Python.

Sample code or projects that involve two way comm would be greatly appreciated!

Parents
  • Is it so that the nRF is a Bluetooth device talking to the RPi over Bluetooth, or is it so that you physically connect the nRF to the RPi and want to use that to communicate with other Bluetooth devices?

    If it is the latter, then take a look at the Bluetooth: HCI USB sample (there are also samples for other transports, like UART).

    If it is the former, and you are starting off with an RPi that is going to communicate with an nRF over Bluetooth and you have not decided on more than that yet, then I would consider using something like the Bluetooth: Peripheral UART sample, which use the custom NUS service to mimic UART over Bluetooth LE. Then interface with that vie BlueZ. We do not provide any python implementations for that, but there is an old project here that may be relevant.

    Or perhaps you are after something else altogether? If so, please elaborate.

Reply
  • Is it so that the nRF is a Bluetooth device talking to the RPi over Bluetooth, or is it so that you physically connect the nRF to the RPi and want to use that to communicate with other Bluetooth devices?

    If it is the latter, then take a look at the Bluetooth: HCI USB sample (there are also samples for other transports, like UART).

    If it is the former, and you are starting off with an RPi that is going to communicate with an nRF over Bluetooth and you have not decided on more than that yet, then I would consider using something like the Bluetooth: Peripheral UART sample, which use the custom NUS service to mimic UART over Bluetooth LE. Then interface with that vie BlueZ. We do not provide any python implementations for that, but there is an old project here that may be relevant.

    Or perhaps you are after something else altogether? If so, please elaborate.

Children
Related