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

BLE peripheral app / Nordic Dongle / Linux Host ??

I am trying to come up with a BLE solution for a Linux based audio project. The Linux target would function as a hardware appliance and as such would appear as a BLE peripheral. An iOS device would control the target and as such would be the BLE central. The BLE HW on the Linux target is a USB device, so it could be a Nordic dongle.

I've looked into the BLE environment on Linux and it looks quite messy, between Bluez, the DBUS API, the various adapters for DBUS, etc. 

Since I've already written a BLE peripheral app for NRF51822 which talks over UART to a STM32 host, and have iOS code to talk to that app, it might be more attractive to simply adapt that application to talk to the Linux host using a custom (but simple) protocol. The transport layer between Nordic App and Linux Host could be either "UART over USB" or USB HID.

So, two questions:

1. Is support for this sort of idea part of the ecosystem for the Nordic dongle? Any information about development flow and such would also be appreciated. Oh, BTW, I currently have an NRF51422 dev board and working development chain for it up and running and tested.

2. Are there any example programs that might vaguely resemble what I'm trying to do here.

Any help would be vastly appreciated.

Parents
  • Hello,

    The bluez tool typically uses usb dongles as a hci device. The nRF Dongle can't be used as this, because it doesn't have that firmware.

    However, you may use the dongle for communication over BLE by skipping the bluetooth part, and use the dongle as a USB device instead. I suggest you look into the example found in SDK15.2.0\examples\peripheral\usbd_ble_uart.

    Although the example folder only has a pca10056, it works on the dongle without any changes (I tested this once).

    This example works like the ble_app_uart, except that it uses the USB peripheral instead of UART to communicate with the computer.

    Is this what you are looking for?

    You can read the testing description for the example here.

    Best regards,

    Edvin

  • This sounds absolutely perfect!

    I have only older Nordic HW, so I looked up the 52840 dongle. It looks like it has no debug support, which is probably fine in this case since I would use the example out of the box. 

    I'm currently running SDK 12.3 because of my older HW, so I would need to get the new SDK, make sure my dev tools work with it (I use GCC/Eclipse), create the hex file, then program the dongle. Correct? (Even better would be if a hex file were available).

    Also, is the source available for the iOS app? I've already written custom BLE code on iOS, so having the source would let me plug right into that flow for my application. No big deal if it is not, as long as all the characteristics are published. But it would save time.

    I feel like I've gotten an early Christmas present. This solution will save me SO MUCH TIME over dealing with bluez and all that nonsense. Thank you!

    - Andy

  • Hello Andy,

    I suggest that you look into the latest SDK, if you intend to use the dongle.

    I'll attach a .hex file, but if you have make installed, it should simply be to go to the folder:

    SDK15.2.0\examples\peripheral\usbd_ble_uart\pca10056\s140\armgcc, open a cmd terminal here, and type "make".

    That results in the application .hex file that is attached here.

    nrf52840_xxaa.hex

    Remember that when you want to flash this application, you must also flash the s140_nrf52_6.1.0_softdevice found in 

    SDK15.2.0\components\softdevice\s140\hex\s140_nrf52_6.1.0_softdevice.hex

    You can flash them using the nRF Programmer, which is part of the new nRF Connect for Desktop FW.

    You can find SDK15.2.0 here.

    Regarding the mobile app:

    The source code for nRF Connect for mobile is not public, but the source code for nRF Toolbox is available online for iOS and Android. This app contains a BLE UART module, so you can use this as a reference. The source code is linked on this page (right below the GitHub image).

    Best regards,

    Edvin

Reply
  • Hello Andy,

    I suggest that you look into the latest SDK, if you intend to use the dongle.

    I'll attach a .hex file, but if you have make installed, it should simply be to go to the folder:

    SDK15.2.0\examples\peripheral\usbd_ble_uart\pca10056\s140\armgcc, open a cmd terminal here, and type "make".

    That results in the application .hex file that is attached here.

    nrf52840_xxaa.hex

    Remember that when you want to flash this application, you must also flash the s140_nrf52_6.1.0_softdevice found in 

    SDK15.2.0\components\softdevice\s140\hex\s140_nrf52_6.1.0_softdevice.hex

    You can flash them using the nRF Programmer, which is part of the new nRF Connect for Desktop FW.

    You can find SDK15.2.0 here.

    Regarding the mobile app:

    The source code for nRF Connect for mobile is not public, but the source code for nRF Toolbox is available online for iOS and Android. This app contains a BLE UART module, so you can use this as a reference. The source code is linked on this page (right below the GitHub image).

    Best regards,

    Edvin

Children
No Data
Related