Skip to content

Latest commit

 

History

History
183 lines (115 loc) · 15.8 KB

README.md

File metadata and controls

183 lines (115 loc) · 15.8 KB

Zephyr logo

Zephyr - Coaps Demo Client with Eclipse/TinyDtls

Reliable - Efficient - Encrypted

Version 0.10.0 - August 2024

This zephyr client demonstrates to use coaps (CoAP over DTLS 1.2) with the Eclipse/TinyDtls Library. In combination with Eclipse/Californium as Cloud-Server, it enables a device to use DTLS 1.2 Connection ID, which obsolete the commonly used frequently DTLS handshakes and eliminates that expensive overhead. Reducing the messages exchange mostly down to two ip-messages (one request, one response), it enables your device for

  • reliable,
  • efficient, and
  • end-to-end encrypted

communication for messages up to a few hundred bytes. In combination with cellular LTE-M/NB-IoT technolopy, CoAP / DTLS 1.2 CID enables to build mobile applications with

  • zero-install and
  • high cost-efficiency.

The demo client itself is in development stage. In "good and normal weather", the Thingy:91 runs from battery for 7-15 months, exchanging every hour a message. In "storm" it may require to be switched off and on again in very rare exceptions.

The first device reached 256 days update and uncovered a bug displaying an uptime larger than 256 days! Demonstrates both, reliability and efficiency.

Thingy:91 Chart

1-09:24:01 [d-hh:mm:ss], Thingy:91 v0.9.0+0, 0*6146, 1*29, 2*2, 3*0, failures 4
!3789 mV 48% (241 days left) battery
!CE: down: 8, up: 1, RSRP: -95 dBm, CINR: 10 dB, SNR: 11 dB
  • 257 days, about 6150 messages, some retransmissions, 1%% failures.
  • 48% battery left
  • quite good signal conditions.

The demo client is intended as groundwork for your own ideas. "Out-of-the-box" this application is useful to easily check, if cellular IoT works at the locations and environment you want to use it. The demo reports also some details about the cellular network functions. To build products and applications on this protocol stack requires to implement a production client and to adapt the coap-server for your function. The demo targets therefore people, which are already common with zephyr, or, even better, common with the development for the Thingy:91 itself. Without that knowledge it will be time consuming to make benefit out of this demo.

Note: The demo client is considered to use CoAP/DTLS 1.2 CID. Without server-side support for DTLS 1.2 CID, it will not work proper. Please ensure, that your server supports that.

Supported Devices

For now, only nRF9160 and nRF9161 based devices are supported.

Device Image
Nordic Semiconductor, Thingy:91
Works "out-of-the-box" in the "wild". Comes with selection of sensors (environment, motion) and a 2KB EEPROM. Not easy to extend with custom sensors.
Circuit Dojo, nRF9160 feather v5
Requires additional batteries, antennas, and closures to work in the "wild". Comes with motion sensor and 4MB flash. The design of the feather allows to easily add custom sensors.
Nordic Semiconductor, nRF9160 DK
Works "out-of-the-box" on the desk. Comes with a 8MB flash. The design allows to easily add custom sensors.
Nordic Semiconductor, nRF9161 DK
Works "out-of-the-box" on the desk. Comes with a 32MB flash. The design allows to easily add custom sensors.
Nordic Semiconductor, nRF9151 DK
Works "out-of-the-box" on the desk. Comes with a 32MB flash. The design allows to easily add custom sensors.

The demo works with ncs-2.6.2.

To benefit from the newer modem features, please consider to use the modem firmware 1.3.6 for nRF9160 based device. See "Getting started with Thingy:91" below how to apply it.

For nRF9161 and nRF9151 devices use the modem firmware 2.0.0 for that. In my experience, the 2.0.1 wasn't able to connect some Rel. 14 networks, but you may also tryout that one.

NCS 2.7.0 is not supported for now.

Supported New/Upcoming Devices

The demo supports two new upcoming devices based on the nRF9161.

Device Image
Circuit Dojo, nRF9161 feather
Requires additional batteries, antennas, and closures to work in the "wild". Comes with 2-channel USB, onboard OCD, motion sensor, a 16MB flash and a Qwiic connector.
Conexio Stratus Pro nRF9161
Requires additional batteries, antennas, and closures to work in the "wild". Comes with built-in solar energy harvesting, motion sensor, 2KB EEPROM, and 2x5 plug for JTAG. Includes a SIM card with 500MB in 10 years.

Note: for both supported new boards you need to copy the board definitions in folder extra into the destination folders. The manufacturer of the boards already announced to offer support for NCS 2.7.0 and newer, so the full support will only come with NCS 2.7.0.

See extras/README for more information.

More Devices

Maybe other modems and devices gets supported over the time as well. For some of the nRF9160 based devices porting should not be too hard.

Candidate Image
Sparkfun Thing Plus nRF9160
Qwiic and 2x5 plug for JTAG.
Icarus IoT Board v2
Includes a eSIM.
Conexio Stratus
With built-in solar energy harvesting. Includes a SIM card with 500MB in 10 years.
Fanstel LN60E
Reduced to the minimum. Unfortunately the current version uses a LDO with 50µA quiescent current.
MIKROE LTE IoT 4 Click
Even less, but with power LED. If you want to use it, remove the LED or cut the connects to the ground-plane next the LED. The device has no analogue gpio available at the header.

Required HW-Tools for Thingy:91

In order to use this demo with a Thingy:91, you need:

  • a Thingy:91 (maybe better two ;-)).
  • the Thingy:91 is usually shipped with a SIM card. Check, if that covers your area/country. If not, you need a SIM card for your area/country. (Sometimes the Thingy:91 is shipped with an expired SIM card. Then you will need also an other one.)
  • a debug probe to flash the device.

Note: the Thingy:91 uses 1.8V VDD and requires the Jlink to support 1.8V as well. Not all Jlinks supporting that, ensure you get a right one! If the nRF9160-DK is used, ensure you select 1.8V for VDD-IO (SW9 on the DK).

Required HW-Tools for nRF9160 feather v5

In order to use this demo with a nRF9160 feather v5, you need:

  • a nRF9160 feather v5 (maybe better two ;-)).
  • the nRF9160 feather v5 is shipped with a SIM card. Check, if that covers your area/country. If not, you need a SIM card for your area/country.
  • a debug probe to flash the device.

Note: the nRF9160 feather v5 uses 3.3V VDD and requires the Jlink to support 3.3V as well. Therefore a nRF5340-DK can be used. If the nRF9160-DK is used, ensure you select 3.0V for VDD-IO (SW9 on the DK).

Required HW-Tools for nRF9160-DK

In order to use this demo with a nRF9160-DK, you need:

  • a nRF9160-DK (maybe better two ;-)).
  • the nRF9160-DK is usually shipped with a SIM card. Check, if that covers your area/country. If not, you need a SIM card for your area/country. (Sometimes the nRF9160-DK is shipped with an expired SIM card. Then you will need also an other one.)
  • the nRF9160-DK comes with a internal debug probe to flash the device. No additional equipment is required.

Note: the nRF9160-DK is a great tool to develop apps for the nRF9160 on your desk. For the "wild", a Thingy:91 or nRF9160 feather v5 does a better job.

Required HW-Tools for nRF9161-DK

In order to use this demo with a nRF9161-DK, you need:

  • a nRF9161-DK (maybe better two ;-)).
  • the nRF9161-DK is usually shipped with a Onomondo SIM card and provides a 30 days test free of charge. Check, if that covers your area/country. If not, or you need connectivity for longer, you need a SIM card for your area/country or a subscription from Onomondo.
  • the nRF9161-DK comes with a internal debug probe to flash the device. No additional equipment is required.

Note: the nRF9161-DK is a great tool to develop apps for the nRF9161 on your desk. For the "wild", a Thingy:91 or nRF9160 feather v5 does a better job.

Required HW-Tools for nRF9151-DK

In order to use this demo with a nRF9151-DK, you need:

  • a nRF9151-DK (maybe better two ;-)).
  • the nRF9151-DK is usually shipped with a Onomondo SIM card and provides a 30 days test free of charge. Check, if that covers your area/country. If not, or you need connectivity for longer, you need a SIM card for your area/country or a subscription from Onomondo.
  • the nRF9151-DK comes with a internal debug probe to flash the device. No additional equipment is required.

Note: the nRF9151-DK is a great tool to develop apps for the nRF9151 on your desk. For the "wild", a Thingy:91 or nRF9160 feather v5 does a better job.

Run It - Fast Track

If you only want to use for testing cellular coverage, you may start with using a pre-build firmware binary. Usually that will take about 1h to send a first message with your Thingy:91.

Fast Track

Build It - Build Track

In order to be able to build the demo-client, you need to install the development environment. That will take up to an afternoon to send your a message with your Thingy:91.

Build Track

Next Steps

As mentioned at the introduction, the demo is intended as groundwork for your own ideas.

Next Steps

See also Roadmap for the plan of the next months.

If you want to consider the power consumption in your idea, please see Power Consumption and if you want to make own measurements may be helpful.

Sometimes it is interesting, which mobile networks are available at some locations. Thingy:91 - Cellular Explorer helps here. It comes also with support for a firmware update using XMODEM and some additional function in order to test the features of the mobile network.

The demo comes also with some functions for Remote Control to configure the device remote from the server.

For a more elaborated example see mobile-beehive-scale.

Licenses

This demo itself is licensed under EPL-2.0.

Some files are used especially for the Thingy:91 and are licensed under Nordic-5. This files are only licensed to be used with Nordic Semiconductor devices. See boards and child_image.

The demo uses several third-party content, please refer to NOTICE for details.