This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Serial port communication between nRf52840 dongle and Raspberry pi 4 using Ble.

I need to pass a stream of data from raspberry pi 4 to PC through Ble. I can successfully build and run \examples\peripheral\usbd_ble_uart. It can communicate with my android phone using nRF connect app.

I like to connect the nRf52840 to raspberry pi and work through serial communication.

sudo bluetoothctl
# agent on
#default-agent
# scan on
# pair 98:D3:31:xx:xx:xx
# trust 98:D3:31:xx:xx:xx
# quit

sudo rfcomm connect hci0 98:D3:31:xx:xx:xx

It shows the error Can't connect RFCOMM socket: Host is down

But I can do the same step for HC-05 Bluetooth module and work well.

Is there any way to tackle this problem?
any comments appreciate
Thanks
Anas

Parents
  • Hello,

    I suspect that you expect that the usbd_ble_uart example should work as a standard BLE dongle. This is not the case. Host Control Interface (HCI) which is what most off the shelf bluetooth dongles use is not supported in our SDK or in our SoftDevice. If you are interrested in this, you can check out something called Zephyr, which is a community RTOS that has a HCI example for the nRF52.

    The example that you programmed is a custom BLE example that will look for another device running the ble_app_uart_c example from the SDK, and connect. Everything that you send out on the UART/USB on one device will come out in the other end. It doesn't know how to handle standard Bluetooth HCI commands.

    Best regards,

    Edvin

  • can i communicate a usbd_ble_uart programmed nRf52840 dongle with ble_app_uart_c programmed dongle?

  • Yes and no. You can communicate via BLE, but the ble_app_uart_c doesn't use the USB peripheral, it uses the UART (not the same pins). So that would require some modifications. If you decide to take on that task, please achieve an nRF52840 DK, as the dongle is not made for development. It doesn't have a debugger.

    Best regards,

    Edvin

Reply Children
Related