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

Making Thingy91 a peripheral bluetooth device

I want to make The Thingy91 a bluetooth peripheral device . I want it to send the generated temperature data to cloud or another device. How do I do this? I had problems with the Bluetooth LTE Sensor Gateway example. I couldn't see the usb ports after programming hci_uart on nRF52840:pca20035 and lte_ble_gateway on nRF9160_pca20035. I couldn't read the logs. 

https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/thingy-91-faq says that this kind of demo is coming. Do you know when?

  • I followed these instructions https://devzone.nordicsemi.com/f/nordic-q-a/52689/nrf9160-lte-sensor-gateway-on-thingy-91/225659. I updated the nrf and zephrys repos but couldnt flash lte_ble_gateway for the nrf9160 and hci_uart_with_usb_uart_bridge for the nrf52840_pca20035. I got "Some of the HEX files have overlapping data" error.   

  • I will try to narrow down the problem. In the zip file provided by Sigurd (lte_gateway_thingy91_v1.1.0_R2.zip), there are two hex files. Could you try to follow the steps provided by Sigurd:

    • "Turn Thingy91 on, and plug in the 10-pin programming cable."

    • "Set the SWD select (see image below) switch to nRF52, and program the nRF52:"

    nrfjrpog -e
    nrfjprog -f nRF52 --program hci_uart_with_usb_uart_bridge_nrf52840_pca20035.hex --verify --reset
    • "Set the SWD switch to nRF91, and program the nRF9160:"

    nrfjrpog -e
    nrfjprog -f nRF91 --program lte_ble_gateway_nrf9160_pca20035ns.hex --verify --reset

    • "Turn Thingy91 off. Remove 10-pin programming cable."
    • "Plug the USB cable into the Thingy91."
    • "Turn Thingy91 on."
    Does this work?
    Best regards,
    Simon
  • I got it to work. Thanks! Actually I just ignored the "hex files have overlapping data" while flashing with the nRF Connect programmer. Now I can send data from Thingy52 to Thingy91 to cloud. Now I'm interested in making the Thingy91 a bluetooth peripheral device. I want it to be a discoverable and connectable device which provides temperature data. How should I start?

  • You can achieve that by using the examples in ncs\zephyr\samples\bluetooth as a reference. E.g. the example ncs\zephyr\samples\bluetooth\peripheral_hr show how to implement an advertising peripheral that can get connected to and send heart-rate values.

    Be aware that the Zephyr examples are not tested by us and we don't officially give support for this at the moment. 

    To use Zephyr samples on the nRF52 series, please follow this guide. More information can be found this tutorial, and as stated in the bottom of the page: "Also if you want to get involved with Zephyr, or simply need help as a user, you can join the Zephyr mailing list or join the #zephyrproject IRC channel."

    Nordic Semiconductor is part of the Zephyr Project and contributes with misc. components/software, but we do not give support for Zephyr running on nRF52.  

    Thanks for your understanding.

    Best regards,

    Simon

  • I managed to make my Thingy91 a discoverable and connectable peripheral device but I have a new problem.

    How can I add the needed bas.c and hrs.c to the project? The c-files for zephyr/subsys/bluetooth/common and zephyr/subsys/bluetooth/host are compiled with the project but I don't know how to add the needed c-files from zephyr/subsys/bluetooth/services to the project. I'm building on the LTE BLE Gateway example.

Related