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

nRF9160: LTE Sensor Gateway on Thingy:91

I am trying to fun the LTE Sensor Gateway on the Thingy:91.

The boards are missing from zephyr so I copied nrf52840_pca20035 and nrf9160_pca20035 from ncs\nrf\boards\arm.

When running samples/bluetooth/hci_uart.

The BLE and UART don't seem to be configured correctly. I get "warning: BT_CTLR_DTM_HCI" and "warning: BT_CTLR_ASSERT_HANDLER".

I created ncs\zephyr\samples\bluetooth\hci_uart\nrf52840_pca20035.overlay based on https://devzone.nordicsemi.com/f/nordic-q-a/51693/hci_uart-on-thingy-91

This still doesn't work.

Adding the lines below to nfr52840_pca20035\Kconfig.defconfig seem to fix the BLE issues? UART is not working so, I don't know if it is working.

config BT_CTLR
default BT

When running samples/nrf9160/lte_ble_gateway I get errors "warning: UART_2_NRF_UARTE" and "warning: UART_2_NRF_FLOW_CONTROL"

I see that nrf9160_pca20035ns.overlay is missing from the folder but I am not sure how to modify it. There is no status light configured. 

Help?

Parents
  • Hi,

    The Thingy:91 is not configured for this use-case at this time. A colleague of mine tested this a couple of days ago, and here it the changes/files used:

    thingy_91_lte_changes.zip

    nrf_changes.diff applies to ncs/nrf

    zephyr_changes.diff applies to ncs/zephyr

    nrf52840_pca20035.conf and .overlay should be placed in ncs/zephyr/samples/bluetooth/hci_uart/

    nrf9160_pca20035.overlay should be placed in ncs/nrf/samples/lte_ble_gateway/

    Use Segger RTT viewer to view the log output. Note that you need to manually keep the nRF52 in reset for several seconds before releasing it. Holding it in reset is done by grounding TP8 (apply patch to enable reset pin). On the nRF91-DK we are using a GPIO line between the nRF52 and nRF91 in order to reset the nRF52. I believe it should be possible to add this functionality to the thingy:91 as well, by using one of the lines originally used by the UART, e.g. pin 20. But there are some bugs on the master branch at the moment, so this reset functionality is currently not working reliably.

  • I don't see the device show up on nRF Cloud. I also am not able to see anything on the RTT viewer. 

  • Hi Sigurd,

    We have tried the above fix and able to receive the BLE values from nRF52840_PCA20035.

    But we encountered an issue.

    1. Connected the Thingy91(PCA20035)  using USB and SWD cable via nRF9160 DK(PCA10090)

    flashed the hci_uart_with_usb_uart_bridge (NOTE: Disabled the power_thread) on nRF52840_PCA20035 and flashed the application Image on nRF9160_PCA20035. 

    Observed the BLE values and sending to the nRF cloud. --> NO ISSUE

    Issue Scenario:

    2. Now, we have removed thingy91 from USB and SWD cable (Kept thingy91 as standalone), still, BLE values observed and sent to the nRF cloud.

    BUT,

    3. We have tried resetting (Power cycle) the device using nrf9160 SW3 Button, in this particular case we have observed: "Scanning failed to start, err -12".  and NO BLE values observed from nRF52840.

    Recovery: Connect the thingy91 back to the system with USB  and give the power cycle. Observe the BLE values. 

    Expectation: The nRF52840 should send BLE values, though we removed the USB and power cycle the Thingy91 using SW3/SW4.  

    If Thingy91 is NOT connected to USB, nRF52840 should get 1.8V power supply from PMIC (ADP536x), but it looks like this is not happening. Results we need to connected Thingy1 to USB in order to get the BLE values. 

    Please help us in directing to the right way to fix the above issue. 

    NOTE: We have tried to test on 2 Thingy91 devices, observed the same behavior. 

  • This works fine with your hex file, however when i apply the patch and use segger embedded studio to make the hex file and upload the program runs with this error

    Bluetooth init failed (err -19)

    please assist 

  • Hi Sigurd, 

    Thank you for the changes above, the program seem to be working.

    However I notice that when I change the connection parameters the program seem to fail. You have any idea where this problem might be coming from? here is the code I used to change the connection parameters. The code works fine on nRF9160 DK but does not work on Nordic Thingy 91. Please assist


            static const struct bt_le_conn_param cp = {
    		.interval_min = 2400,
    		.interval_max = 2400,
    		.latency = 4,
    		.timeout = 3200,
    	};
    
    
    	struct bt_scan_init_param scan_init = {
    		.connect_if_match = true,
    		.scan_param = &scan_param,
    		//.conn_param = BT_LE_CONN_PARAM_DEFAULT,
            .conn_param = &cp,
    	};

  • Hey Sigurd,

    I tried manually porting your patch to NCS v1.2.0 and even though it looks like everything is compiling successfully, I am unable to enable bluetooth. After calling bt_enable, the application crashes. Have you had any luck porting the patch over to v1.2.0?

    UPDATE: For anyone running into the same issue, it appears the problem is related to the bluetooth hci tx stack size (CONFIG_BT_HCI_TX_STACK_SIZE). I am not sure if it is something on my end, maybe missing/mis-configured project configuration, but the stack size was being set to 512. Increasing the stack size to 1024 fixes this issue.

    Thank you,
    Cody

  • Sigurd,

    Hey, sounds like you put in some good work on this. I'm trying to get the same code working but I think I am missing something. I have downloaded the hex files but I don't see the source code to make the changes that have been discussed. I'm sure its in the thread somewhere I just cant find it. Could you please post a link to the source code with segger project file for the hci_uart_with_usb_bridge and the lte_ble_gateway_nrf9160.

Reply
  • Sigurd,

    Hey, sounds like you put in some good work on this. I'm trying to get the same code working but I think I am missing something. I have downloaded the hex files but I don't see the source code to make the changes that have been discussed. I'm sure its in the thread somewhere I just cant find it. Could you please post a link to the source code with segger project file for the hci_uart_with_usb_bridge and the lte_ble_gateway_nrf9160.

Children
No Data
Related