Thingy91 LTE BLE Gateway Sample not working

Hello everyone!

I am rather new to firmware development with Nordic products and am experiencing some trouble with the Thingy91 LTE BLE Gateway sample.

What is the problem?

I am trying to flash the sample onto the Thingy91 (via a Debugger and the SWD connector), but there are 2 issues:

  • no LTE connection can be established wiuth the NRF Cloud
  • the LPUART sample on the nrf52840 is not detected properly by the nrf9160

As a result, it is stuck in the connection establishment process to the cloud, as described below.

LTE Issue

It is precisely stuck in this state:

  • LED 4 blinking: The device is connecting to nRF Cloud.

Apparently it tries to connect to a seemingly random port and not 8883 for MQTT.
The antenna itself is fine though and the asset_tracker_v2 firmware works as well.

BLE Issue

The nrf9160 does not detect the lpuart firmware on the nrf52840 and logs an error similar to:

"could not detect bluetooth core"

I have no idea how to resolve this problem.

Equipment / Config

As required by the sample I do have a JLink Debugger to flash the chips directly and am using the VS Code extension to do so.
The board config is respectively set to thingy91/nrf9160/ns and thingy91/nrf52840.

I am grateful for all ideas / help and happy to supply more details!

Kind regards,
TK

Parents
  • Hi,

    Which applications have you flashed on nrf9160 and what on nrf52840?

    Which NCS version do you use?

    Can you show complete error logs?

    Best regards,
    Dejan

  • Hi Dejan,

    thanks for your reply.

    Applications:
    lte_ble_gateway on the nrf9160
    hci_lpuart on the nrf52840

    I am using the nRF Connect SDK v2.9.0

    Here is the log from the nrf9160:

    00> *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    00> *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    00> [00:00:00.255,737] <inf> lte_ble_gw: LTE Sensor Gateway sample started
    00> [00:00:00.255,920] <inf> lte_ble_gw: Initializing Bluetooth..
    00> [00:00:00.255,920] <err> bt_hci_core: No HCI driver registered
    00> [00:00:00.255,950] <err> lte_ble_gw: Bluetooth init failed (err -19)
    00> [00:00:00.495,605] <inf> lte_ble_gw: Establishing LTE link (this may take some time) ...
    00> [00:00:01.942,260] <wrn> lpuart: req pin low when expected high
    00> [00:00:01.942,352] <err> lpuart: Empty receiver state:4
    00> [00:00:03.677,307] <wrn> lpuart: req pin low when expected high
    00> [00:00:03.677,429] <err> lpuart: Empty receiver state:4
    00> [00:00:05.393,615] <wrn> lpuart: req pin low when expected high
    00> [00:00:05.393,737] <err> lpuart: Empty receiver state:4
    00> [00:00:06.355,316] <inf> nrf_cloud_info: Device ID: nrf-<MY-ID>
    00> [00:00:06.355,743] <inf> nrf_cloud_info: IMEI:      <MY-ID>
    00> [00:00:06.356,201] <inf> nrf_cloud_info: Modem FW:  mfw_nrf9160_1.3.5
    00> [00:00:06.356,231] <inf> nrf_cloud_info: Protocol:          MQTT
    00> [00:00:06.356,262] <inf> nrf_cloud_info: Download protocol: HTTPS
    00> [00:00:06.356,292] <inf> nrf_cloud_info: Sec tag:           <NUMERIC-SEC-TAG>
    00> [00:00:06.356,323] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    00> [00:00:06.622,955] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 45858. err: -111
    00> [00:00:07.103,759] <wrn> lpuart: req pin low when expected high
    00> [00:00:07.103,851] <err> lpuart: Empty receiver state:4
    00> [00:00:08.825,286] <wrn> lpuart: req pin low when expected high
    00> [00:00:08.825,408] <err> lpuart: Empty receiver state:4
    00> [00:00:10.558,349] <wrn> lpuart: req pin low when expected high
    00> [00:00:10.558,441] <err> lpuart: Empty receiver state:4
    00> [00:00:12.238,342] <wrn> lpuart: req pin low when expected high
    00> [00:00:12.238,464] <err> lpuart: Empty receiver state:4
    00> [00:00:13.951,049] <wrn> lpuart: req pin low when expected high
    00> [00:00:13.951,171] <err> lpuart: Empty receiver state:4

    Logs from the nrf52840:

    00> [00:00:00.000,366] <wrn> swdp: cpu_clock 64000000, delay 10
    00> *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    00> *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    00> [00:00:00.000,457] <inf> usb_msc: Sect Count 128
    00> [00:00:00.000,488] <inf> usb_msc: Memory Size 65536
    00> [00:00:00.001,007] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
    00> 2d 79 a1 c8 6a 40 b7 3c f6 74 f9 0b 22 d3 c4 80 |-y..j@.< .t.."...
    00> 74 72 82 ba |tr..
    00> [00:00:00.006,988] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    00> [00:00:00.007,019] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    00> [00:00:00.007,049] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 45.41337 Build 3074452168
    00> [00:00:00.008,331] <inf> bt_hci_core: Identity: E1:3F:5F:D9:40:ED (random)


    Thank you for your time.

    Best,
    TK

  • Hi TK,

    I suggest that you switch to previous NCS v2.8.0 and make following changes to the samples:
    changes to lte_ble_gateway sample

    --- a/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns.overlay
    +++ b/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns.overlay
    @@ -3,6 +3,7 @@
    / {
            chosen {
                    zephyr,bt-uart=&lpuart;
    +               zephyr,bt-hci = &bt_hci_uart;
            };
    };
    
    @@ -23,6 +24,11 @@
                    status = "okay";
                    req-pin = <21>; /* <&interface_to_nrf52840 3 0>; */
                    rdy-pin = <19>; /* <&interface_to_nrf52840 2 0>; */
    +
    +               bt_hci_uart: bt_hci_uart {
    +                       compatible = "zephyr,bt-hci-uart";
    +                       status = "okay";
    +               };
            };
    };
    
    diff --git a/samples/cellular/lte_ble_gateway/prj.conf b/samples/cellular/lte_ble_gateway/prj.conf
    index ad2bfa98cf..59e09b386a 100644
    --- a/samples/cellular/lte_ble_gateway/prj.conf
    +++ b/samples/cellular/lte_ble_gateway/prj.conf
    @@ -53,6 +53,8 @@ CONFIG_CONSOLE_GETCHAR=y
    # Enable Bluetooth stack and libraries
    CONFIG_BT=y
    CONFIG_BT_H4=y
    +CONFIG_BT_HCI=y
    +CONFIG_BT_CTLR=n
    CONFIG_BT_WAIT_NOP=y
     

    changes to hci_lpuart sample
    - no changes are needed for sample from NCS v2.7.0
    - remove disable-rx from the sample's devicetree overlay for UART0 for sample in NCS v2.8.0
    - alternatively, for NCS v2.8.0, apply changes from this pull request

    Best regards,
    Dejan

  • Hi Dejan,

    thanks for your input!

    I switched to the NCS v2.8.0 for both samples:

    BLE is now detected properly by the nrf9160, the empty receiver state only occurs once before logging "Bluetooth ready" and "Scanning...", so it overcomes that problem !

    To build both samples, I have applied your changes to the overlay files of the thingy91/... instead of nrf9160dk/..., and disabled sysbuild for both scenarios as I couldn't build the nrf52840 sample with it being active.

    Nonetheless, I still experience the nRF Cloud connectivity error as described below:

    00> [00:00:06.355,316] <inf> nrf_cloud_info: Device ID: nrf-<MY-ID>
    00> [00:00:06.355,743] <inf> nrf_cloud_info: IMEI:      <MY-ID>
    00> [00:00:06.356,201] <inf> nrf_cloud_info: Modem FW:  mfw_nrf9160_1.3.5
    00> [00:00:06.356,231] <inf> nrf_cloud_info: Protocol:          MQTT
    00> [00:00:06.356,262] <inf> nrf_cloud_info: Download protocol: HTTPS
    00> [00:00:06.356,292] <inf> nrf_cloud_info: Sec tag:           <NUMERIC-SEC-TAG>
    00> [00:00:06.356,323] <inf> nrf_cloud_info: Host name:         mqtt.nrfcloud.com
    00> [00:00:06.622,955] <err> nrf_cloud_transport: Could not connect to nRF Cloud MQTT Broker mqtt.nrfcloud.com, port: 45858. err: -111

    Do you have any ideas what is going on here? As I would like to switch to a custom MQTT endpoint later on, maybe that is worth trying already? I do not know how to accomplish connecting to my own MQTT broker, though.

    Anyway, thanks for your effort once again! :)

    Best,
    TK

  • Hi,

    This could be a certificate related problem. You can look at this troubleshooting guide and this quick start guide.

    Best regards,
    Dejan

Reply Children
No Data
Related