nRF52840: Need some help getting Bluetooth notification messages to communicate with Python App using Bluegiga Bluetooth Low Energy dongle

I have simple Bluetooth commination working. I can connect to nRF52840 with your nRF Toolbox on my Android. I can send a string from the nRF52840 to the Android app and have it display and also send a string from the Android App to the nRF52840 and see it display in J-Link RTT Viewer. So sending data back and forth with the nRF Toolbox on Android works.

Our device creates log info about it's operation and I want to send this data to a Python app I'm developing. On a PC, I have a Bluegiga Bluetooth Low Energy dongle that shows as an entry in the COM Ports. With our device advertising, I can connect to it and get it's Services and Characteristics.

In Python, I'm using the bgapi package to connect to the nRF52840. With the below command, I can send data from the Python App to the nRF52840.

    ble_dongle.connection.write_by_handle(21, b'test')

Problem is I can't seem to figure out how to get data from the nRF52840 to the Python App. I'm sending a simple string from the nRF52840 when connected but bt_nus_send returns an error. One thing I also noticed is that the Bluegiga Bluetooth Low Energy dongle won't connect in the nRF Connect Bluetooth Low Energy app. Any thoughts?

Parents Reply Children
  • Not using your Python library, using bgapi Python package. Could you point me to your Python library and the Bluetooth dongle you suggest I should use?

  • So I've installed pc_ble_driver_py and setup my nRF52840 dev board as a Bluetooth dongle. I can scan and connect with it using the your Bluetooth Low Energy app in nRF Connect for Desktop.

    I'm looking at the example Python code in the test folder included with your library. At this point I just want to scan and connect to our device that is using the nRF52840 chip. The code in the test folder way to verbose. Hard to make sense of it since it does way too much. Simple examples of small digestible chunks is the best way for people to come up to speed with your Python library. It also doesn't help that I've never used the unittest library and not sure what to do with it.

    Any direction would be appreciated.

  • Hello Howard!

    Ah okey, I think I misunderstood what your issue was for a second. Sorry about that.

    One thing I also noticed is that the Bluegiga Bluetooth Low Energy dongle won't connect in the nRF Connect Bluetooth Low Energy app.

    Yes that is unfortunately not possible. Our nRF Connect applications unfortunately only work on our products, as they interface using our own protocol.

    Problem is I can't seem to figure out how to get data from the nRF52840 to the Python App. I'm sending a simple string from the nRF52840 when connected but bt_nus_send returns an error.

    That should be possible. What error message are you getting?

    GameCodingNinja said:
    Hard to make sense of it since it does way too much.

    Yeah, the pc_ble_driver_py might be a bit hard to get up to speed with, and unfortunately there aren't any tutorials for it yet as far as I know. You do have the examples though. If you'd prefer to use the Bluegiga one then that should work as well.

    Best regards,

    Elfving

Related