help getting a BLE end to end application working

I am trying to get an end to end BLE application working. I have an nRF52832 board that is running peripheral_uart. It is advertising and sending a text stream to the connected device. If I run "nRF Toolbox" on my iPhone I can connect to the nRF52832 and see the BLE strings come across every N seconds as setup in my program. I have a nRF9160DK board that I want to be able to see the BLE text strings in the nRF52840 on the nRF9160DK board and send those strings to the nRF910 on the nrf9160DK board.

I am using samples/hci_uart in the nRF52840 and samples/central_uart in the nRF9160.. I have not looked at BLE in a very long time so I may have the wrong programs. Are these the correct projects to create an end to end BLE application?

first I want to connect to my advertising device and see the notifications with the text strings in the nRF52840. is hci_uart the correct program? I have made no changes in this program except to print a message on startup. I can build and flash into the RF52840 (SW10 set to nRF51) but I do not see anything printing on any of the 3 created COM ports and I do not see a connection on my advertising device. It is still advertising and not connected to anything.

second I want to get the strings from the nRF82840. I am running the central_uart in the nRF9160 (SW10 set to nRF91). I do see startup messages as show below but it keeps rebooting with a timeout as shown below

*** Booting nRF Connect SDK v2.5.0 ***
Starting central_uart
Passed register authorization callbacks.
Passed register authorization info callbacks.
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
command opcode 0x0c03 timeout with err -11

*** Booting nRF Connect SDK v2.5.0 ***
Starting central_uart
Passed register authorization callbacks.
Passed register authorization info callbacks.
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:338
command opcode 0x0c03 timeout with err -11

This is for an end to end production system so any help you can give to get BLE strings from my nRF52832 to the nRF9160 would be greatly appreciated.

  • Hi Burt, 
    Thanks for the info. So my understanding is that now all is good and you can proceed with the lte_ble_gateway  correct

  • Hung Bui

    No all is not good! I cannot connect to the custom board running peripheral_uart. all that Burt is saying is that the first red message is not there as you mentioned.

    the problem is exactly the same

    1. what does the 1 message in Red mean?

    2. how do I make the UART services connection to my device? What am I missing? my device is a custom board with a nRF52832 running peripheral_uart. this is advertising and connecting via the UART services in nRF Toolbox. I can see the strings being sent every 10 seconds in nRF Toolbox. I need to see them in the nRF9160.

    3. how do I connect to my advertising nRF52832 board running hci_lpuart?

    4. how do I receive the strings being sent when there is a connection?

    5.how do I see the strings on nRF Cloud? what LTE device do I create? do I create the nRF9160DK device or do I create a device with my custom nRF52832?

    6. If I create the LTE device on nRF Cloud using my custom nRF52832 where do I get the device ID and the PIN I need to create the LTE device?

    could you please answer these questions.

    thank you for your help this is for a production system that needs to send strings from nRF52832 over BLE to the cloud.

  • Hung Bui

    this is the message on the COM port.

    *** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
    *** Using Zephyr OS v4.0.99-f791c49f492c ***
    LTE Sensor Gateway sample started Version: 0.1 Date: 10/30/25
    [00:00:00.384,857] <inf> lte_ble_gw: Initializing Bluetooth..
    [00:00:00.633,514] <inf> lte_ble_gw: Establishing LTE link (this may take some time) ...
    [00:00:01.151,824] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:01.151,855] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:01.151,885] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 137.20634 Build 2617349514
    [00:00:01.169,769] <inf> bt_hci_core: Identity: EE:F0:7B:84:FC:21 (random)
    [00:00:01.169,799] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x10f3, manufacturer 0x0059
    [00:00:01.169,830] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x10f3
    [00:00:01.169,860] <inf> lte_ble_gw: Bluetooth ready
    [00:00:01.182,861] <inf> lte_ble_gw: Scanning...
    +CEREG: 2,"9E03","026B8102",7
    +CSCON: 1
    +CEREG: 5,"9E03","026B8102",7,,,"11100000","11100000"
    [00:00:12.039,337] <inf> nrf_cloud_info: Device ID: nrf-351901936291081
    [00:00:12.039,733] <inf> nrf_cloud_info: IMEI: 351901936291081
    [00:00:12.040,283] <inf> nrf_cloud_info: Modem FW: mfw_nrf9160_1.3.4
    [00:00:12.040,313] <inf> nrf_cloud_info: Protocol: MQTT
    [00:00:12.040,344] <inf> nrf_cloud_info: Download protocol: HTTPS
    [00:00:12.040,344] <inf> nrf_cloud_info: Sec tag: 16842753
    [00:00:12.040,405] <inf> nrf_cloud_info: Host name: mqtt.nrfcloud.com
    [00:00:19.320,587] <err> nrf_cloud_transport: Failed to save session state: -2
    [00:00:19.321,380] <inf> lte_ble_gw: Initializing GNSS
    [00:00:19.327,087] <inf> lte_ble_gw: GNSS initialized
    [00:00:19.329,772] <inf> lte_ble_gw: GNSS started with interval 30 seconds, and timeout 15 seconds
    [00:00:19.329,833] <inf> nrf_cloud_info: Team ID: 45c9165d-a392-4543-96c3-d17ba0aaf166
    [00:00:19.330,017] <inf> lte_ble_gw: Requesting A-GNSS Data
    +CSCON: 0

  • Hi Timothy, 
    The nRF52 has nothing to do with nRF Cloud. 

    What I meant when I say " mak sure nRF9160 works first" is that you need to test with other sample of nRF9160 and make sure it can communicate and send data to the cloud. 

    The lte_ble_gateway has nothing to do with the NUS/UART service. So you shouldn't expect it to send any string on nRF Cloud. You are expected to write code to achieve what you need as I don't see we have any example doing exactly what you need. lte_ble_gateway is the closest one ( please read the documentation to see what it does). 

    Have you followed my link to add: 

    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y

    To the configuration?

    RE: nrf_cloud not connecting in thingy91X



    If you are not so familiar with the nRF9160 please take my recommendation to go through the Nordic Academy course: https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/

    You need to be able to do a simple MQTT sample before moving to BLE + nRF9160 application . https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/cellular/nrf_cloud_mqtt_device_message/README.html

Related