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

Asset_tracker example, transmission protocol

Hi 

I am using nRF9160DK board and need transmit gps data to web site, I am trying with udp but have problems with that, I would like to know what protocol use asset_tracker example to transmit to nrfcloud? I try discover reading the example code but it's hard to me identify how its works, any documentation about the protocol and how its works will be very usefull to me.

thanks in advance 

Julio

  • Websites use HTTP which is TCP, not UDP. You can run other protocols with UDP like CoAP, MQTT, and LwM2M to name a few.

  • Hi Julio,

    The Asset Tracker sample uses MQTT to communicate with nRF Cloud, which runs over TCP. We do have an UDP sample if you want to take a look at that.

    Best regards,

    Marte

  • > I would like to know what protocol use asset_tracker example to transmit to nrfcloud?

    Just mention:

    if you use CAT-M1 connectivity (availability/costs), MQTT/TLS is a choice.

    If you use CAT-NB, just the TLS handshake may take longer, than you want/expect.

    > I am trying with udp but have problems with that

    If you use "plain" UDP, then encryption and the data modelling is up to you. If you use CoAP/DTLS, then you may use some libraries, which do a lot for you. Since a short time, there are third-party cloud-service offerings for that (you may find at least one in this forum :-) ). Depending on the time you want to spend for implementation, there are also some open source offerings (e.g. coap/dtls in zephyr, or libcoap, and for the cloud may be Eclipse/Californium). Using these libraries requires, that you build your "service" on the top of them. LwM2M is additionally an option, you may find also commercial and open source offerings.

    The choice of the protocol may also be a question of the energy to spend.

    I'm not sure, how many providers offer you eDRX (or similar energy saving modes) and how good they really work for TCP.

    I use CAT-NB, with CoAP/DTLS-1.2 CID and PSM, and for me the results are very promising. (But for sure, I do this now for a couple of years, I'm involved in the development of that stack, and so it may be not too surprising, that I also recommend that :-) ):  

  • Thanks for your answers 

    we will try whit MQTT because the target will be in motion and the period of transmittion is't short. I want to change the address of transmition of aseet tracker sample and have seen the sample but I can't find where I can where change the address of transmittion. Also I have seen the of mqtt_simple sample where the configuration (first image) is very clarely, I can see and modify the broker hostname, client id, topic, etc. but in asset tracker sample I cant find this configuration Where is this config in asset tracker?

    I find a tiket with following recomndation to change the ip "you should only have to change the following configs in the nRF_Cloud library Kconfig file in subsys/net/lib/nrf_cloud/" in that path I have this configs (second image) but I'm not sure about change that ip.

      

  • Hi,

    The reason this is not as easily found in the Asset Tracker application as in MQTT Simple is because the Asset Tracker is an application, which is targeted for a specific use case, while the samples are showcasing the use of a single feature or library, and is meant to show how you can use this feature or library in your application. In the regard of Asset Tracker it's meant to demonstrate how to use nRF Cloud, in addition to GPS and sensor data. Therefore, it uses the nRF Cloud library to connect to and communicate with nRF Cloud, and that library is what handles MQTT as well. Because of this, you can't easily change MQTT configurations, such as broker and topics, in the Asset Tracker application. You would have to switch out the nRF Cloud library with something that takes care of all of this but uses the broker etc. that you want. So I would instead recommend that you start out with MQTT Simple if you want to use another MQTT broker, or possibly the cloud client sample if you want to use AWS IoT or Azure IoT Hub, and then add the functionality you want from Asset Tracker to that, using the different samples available to see how the different features and libraries can be used.

    Best regards,

    Marte

Related