Skip to content

Commit

Permalink
Release 0.7.0+0.
Browse files Browse the repository at this point in the history
Signed-off-by: Achim Kraus <[email protected]>
  • Loading branch information
boaks committed Sep 21, 2023
1 parent 12a0f9e commit 68f0a2e
Show file tree
Hide file tree
Showing 11 changed files with 91,114 additions and 73,872 deletions.
18 changes: 7 additions & 11 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ config DTLS_PSK_SECRET
Don't use this on production or other security
relevant use-cases.

config COAP_SERVER_TRUST_CERTIFICATE
string "CoAP server's trusted certificate."
default "../cert/Californium.pem"

config DTLS_ALWAYS_HANDSHAKE
bool "Use a DTLS handshake for request."
default n
Expand All @@ -77,6 +73,13 @@ config DTLS_ALWAYS_HANDSHAKE
Using DTLS 1.2 Connection ID obsoletes such
frequent handshakes.

config COAP_WAIT_ON_POWERMANAGER
bool "Enable CoAP to wait for power-manager before sending"
default n
help
On startup, the power manager takes up to 30s to get the first
battery values. Delay exchanging application message until that.

config COAP_SEND_INTERVAL
int "CoAP send interval in seconds. 0 disable"
default 0
Expand Down Expand Up @@ -148,13 +151,6 @@ config COAP_QUERY_WRITE_SUBRESOURCE
string "Use CoAP query - write sub-resource"
depends on COAP_QUERY_WRITE_SUBRESOURCE_ENABLE

config COAP_WAIT_ON_POWERMANAGER
bool "Enable CoAP to wait for power-manager before sending"
default n
help
On startup, the power manager takes up to 30s to get the first
battery values. Delay exchanging application message until that.

endmenu

menu "Modem Settings"
Expand Down
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Reliable - Efficient - Encrypted

Version 0.6.0 - May 2023
Version 0.7.0 - September 2023

This [zephyr](https://www.zephyrproject.org/) client demonstrates to use coaps ([CoAP](https://tools.ietf.org/html/rfc7252) over [DTLS 1.2](https://tools.ietf.org/html/rfc6347)) with the [Eclipse/TinyDtls Library](https://github.com/eclipse/tinydtls). In combination with [Eclipse/Californium](https://github.com/eclipse/californium) as Cloud-Server, it enables a device to use [DTLS 1.2 Connection ID](https://tools.ietf.org/html/rfc9146), 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
Expand All @@ -14,19 +14,19 @@ Reducing the messages exchange mostly down to two ip-messages (one request, one
- end-to-end encrypted

communication for messages up to a few hundred bytes.
In combination with LTE-M/NB-IoT, CoAP / DTLS CID enables to build mobile applications with
In combination with LTE-M/NB-IoT, 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` flies from battery for 7 months. In "storm" it may require to be switched off and on again. That should be very rare exceptions.
The demo client itself is in development stage. In "good and normal weather", the `Thingy:91` flies from battery for 7 months. In "storm" it may require to be switched off and on again in very rare exceptions.

The demo client is intended as groundwork for your own ideas. "Out-of-the-box" this application is useful to easily check, if mobile IoT works at the locations and environment you want to use it. The demo reports also some details about the mobile network.
The demo client is intended as groundwork for your own ideas. "Out-of-the-box" this application is useful to easily check, if mobile IoT works at the locations and environment you want to use it. The demo reports also some details about the mobile networks 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](https://www.zephyrproject.org/), or, even better, common with the development for the [Thingy:91](https://www.nordicsemi.com/Products/Development-hardware/Nordic-Thingy-91) itself.
Without that knowledge it will be time consuming to make benefit out of this demo.
Without that knowledge it will be more time consuming to make benefit out of this demo.

**Note:**
The demo client is considered to use CoAP/DTLS CID. Without server-side support for DTLS CID, it will not work proper. Please ensure, that your server supports that.
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

Expand All @@ -38,11 +38,9 @@ For now, only [nRF9160](https://www.nordicsemi.com/products/nrf9160) based devic
| [Circuit Dojo, nRF9160 feather v5](https://www.jaredwolff.com/store/nrf9160-feather/)<br>Requires additional batteries, antennas, and closures to work in the "wild". The design of the feather allows to easily add custom sensors. | ![nRF9160-feather-v5](https://docs.jaredwolff.com/img/nrf9160-feather-v4-nobg.jpg) |
| [Nordic Semiconductor, nRF9160 DK](https://www.nordicsemi.com/Products/Development-hardware/nRF9160-DK)<br>Works "out-of-the-box" on the desk. The design allows to easily add custom sensors. | ![nRF9160-DK](https://www.nordicsemi.com/-/media/Images/Products/DevKits/nRF91-Series/nRF9160-DK.png) |

The demo works with [ncs-2.3.0](https://github.com/nrfconnect/sdk-nrf/tree/v2.3.0).
The demo works with [ncs-2.4.2](https://github.com/nrfconnect/sdk-nrf/tree/v2.4.2).

To benefit from the newer modem features, please consider to use the modem firmware [1.3.4](https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF9160-DK/nRF9160-modem-FW/mfw_nrf9160_1.3.4.zip). See ["Getting started with Thingy:91"](#install-tools-and-tool-chains) below how to apply it.

(The current development (`main` branch) uses [ncs-2.4.1](https://github.com/nrfconnect/sdk-nrf/tree/v2.4.1) and the modem firmware [1.3.5](https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF9160-DK/nRF9160-modem-FW/mfw_nrf9160_1.3.5.zip).)
To benefit from the newer modem features, please consider to use the modem firmware [1.3.5](https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF9160-DK/nRF9160-modem-FW/mfw_nrf9160_1.3.5.zip). See ["Getting started with Thingy:91"](#install-tools-and-tool-chains) below how to apply it.

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.

Expand Down Expand Up @@ -145,7 +143,7 @@ west init --mr main -m https://github.com/boaks/zephyr-coaps-client.git zephyr-c
```

from a toolchain-manager-installation, fails with an error message, that a workspace already exists.
In order to add just this coaps-demo-app and the tinydtls module library to a workspace, open the workspace (for ncs the "ncs" installation folder and change to "v2.3.0" folder there). Here you find a ".west" folder, that contains the west-configuration for the workspace. Rename that ".west" folder into ".west.org" in order to replace that west-configuration by the one from this example. Now execute
In order to add just this coaps-demo-app and the tinydtls module library to a workspace, open the workspace (for ncs the "ncs" installation folder and change to "v2.4.2" folder there). Here you find a ".west" folder, that contains the west-configuration for the workspace. Rename that ".west" folder into ".west.org" in order to replace that west-configuration by the one from this example. Now execute

```sh
west init --mr main -m https://github.com/boaks/zephyr-coaps-client.git
Expand Down Expand Up @@ -244,9 +242,9 @@ As mentioned at the introduction, the demo is intended as groundwork for your ow

See also [Roadmap](./docu/ROADMAP.md) for the plan of the next months.

If you want to consider the power consumption in your idea, please see [Power Consumption](./docu/POWERCONSUMPTION.md)
If you want to consider the power consumption in your idea, please see [Power Consumption](./docu/POWERCONSUMPTION.md) and if you want to make own [measurements](./docu/MEASUREMENTS.md) may be helpful.

Sometimes it is interesting, which networks are available at some locations. [Thingy:91 - Cellular Explorer](./docu/CELLULAREXPLORER.md) may help here.
Sometimes it is interesting, which mobile networks are available at some locations. [Thingy:91 - Cellular Explorer](./docu/CELLULAREXPLORER.md) 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.

### Updating to a Newer Versions

Expand Down
25 changes: 9 additions & 16 deletions docu/CELLULAREXPLORER.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
| | |
| :- | - |
| The [Nordic Semiconductor, Thingy:91](https://www.nordicsemi.com/Products/Development-hardware/Nordic-Thingy-91) comes with an Bluetooth Low Energy interface, that allows to connect the `Thingy:91` to a smartphone and send locally commands to the `Thingy:91`. That helps to analyze network situations even without valid cellular connectivity of your SIM card. | ![Thingy:91](./thingy91.jpg) |

In order to enable this function, the [at-cmd-prj.conf](../at-cmd-prj.conf) must be used to build the app.

Other devices without Bluetooth Low Energy interface may also be used via a USB serial. The

| | |
| :- | - |
| The [Circuit Dojo, nRF9160 feather v5](https://www.jaredwolff.com/store/nrf9160-feather/) comes with a USB-C plug and if the smartphone is also equipped with USB-C, a simple USB-C to USB-C wire will do it. | ![nRF9160-feather-v5](https://docs.jaredwolff.com/img/nrf9160-feather-v4-nobg.jpg) |

For a mobile usage in the wild, not that comfortable as Bluetooth Low Energy, but it works.

In the wild, the Bluetooth Low Energy interface is really very comfortable. If your device has only USB, that works also well, but is less comfortable.
For some more sophisticated tests, e.g. adapting some lists on the SIM card, it may be easier to use a PC via a USB serial as well.

## Enable Bluetooth Low Energy
In order to enable this function, the [at-cmd-prj.conf](../at-cmd-prj.conf) must be used to build the app.

## Enable Bluetooth Low Energy on a Thingy:91

If you connect the `Thingy:91` via USB to your PC, a "local USB drive" pops up.

Expand Down Expand Up @@ -66,7 +60,6 @@ If you want to use a PC to communicate with the device via the USB serial interf

The most [nRF9160 AT-commands](https://infocenter.nordicsemi.com/pdf/nrf9160_at_commands_v2.3.pdf) are supported. Additionally some shortcuts and extra functions are available as custom commands. For simple usage, these custom commands uses simple characters and digits, instead of control characters as '+', '%' or '='. Type `help` and press the "send button" ![arrow](./serial_bluetooth_terminal_send_small.jpg):

{#help}
![help](./serial_bluetooth_terminal_help.jpg)

(The screenshot shows only the list of commands in August 2023, the current list may contain more commands.)
Expand All @@ -81,7 +74,7 @@ Hopefully in the most areas the device should be able to connect to the network

If that doesn't work or if you want to see, which cellular networks are available at your location, then type `scan` and press the "send button" ![arrow](./serial_bluetooth_terminal_send_small.jpg)

The displayed list of networks will vary. As default, `scan` measure the currently already known channels. If you want to search for new channels, provide additional parameters. For such cases, a command comes also with a specific help. Type `help scan` and press the "send button" ![arrow](./serial_bluetooth_terminal_send_small.jpg) (see [screenshot above](#help)).
The displayed list of networks will vary. As default, `scan` measure the currently already known channels. If you want to search for new channels, provide additional parameters. For such cases, a command comes also with a specific help. Type `help scan` and press the "send button" ![arrow](./serial_bluetooth_terminal_send_small.jpg) (see [screenshot above](#usage)).

To perform a scan with searching for new channels, use `scan 5 <n>` where `n` is the maximum expected number of networks. It will take a while. The provided parameters will become the new default. if you decide to use `scan 5 6`, the next execution of `scan` will also use these parameters.

Expand Down Expand Up @@ -136,7 +129,7 @@ Each line may starts with a level ('E'rror, 'W'arning, 'I'nfo, or 'D'ebug), whic

That is followed by text, which explains itself a lot. E.g. CAT-M1, roaming, PLMN and so on.

For energy saving thre function are available for cellular devices:
For energy saving three function are available for cellular devices:

| Mode | Description | |
| - | :- | :- |
Expand Down Expand Up @@ -234,7 +227,7 @@ To simplify that process, that `Cellular Explorer` comes with an `update` comman

In order to use it, you need:

- the application binary (the `app_update.bin` in the `zephyr` folder. The file is next to the `app_signed.hex`, which is used for the `Nordic nRF Connect for Desktop / Programmer`).
- the application binary (the `app_update.bin` in the `<build>/zephyr` folder. The file is next to the `app_signed.hex`, which is used for the `Nordic nRF Connect for Desktop / Programmer`).
- a serial terminal with XMODEM or XMODEM 1k support.
- If a `Thingy:91` is used, please update the nRF52840 to version `thingy91_nrf52_connectivity_bridge_2023-03-02_8f26142b.hex` or newer. Some older version show some instability which may break the file transfer. Caused by that, the transfers stucks and breaks the transmission from the `Thingy:91` to your smartphone. You will even not see further messages from the `Thingy:91` and a power on restart gets required. The `thingy91_nrf52_connectivity_bridge` is part of the `Precompiled application and modem firmware` package and can be downloaded from [Nordic-Thingy-91/Download](https://www.nordicsemi.com/Products/Development-hardware/Nordic-Thingy-91/Download#infotabs).

Expand All @@ -256,8 +249,8 @@ Select `Xmodem 1k` as protocol and the `app_update.bin` as file. Press `OK` and

![update ready](./serial_bluetooth_terminal_update_ready.jpg)

Sometimes the 10 seconds are too short to select the file. Then just open the file dialog via the menu and "Upload File" submenu. Select the file at rest and chose the `Xmodem 1k` as protocol. Press `OK` and then `CANCEL` in the "Upload File" field, which appears at the top below the tools-line. That will set this values as default and the next time the file dialog is shown you may just press `OK`.
Sometimes the 10 seconds are too short to select the file. Then just open the file dialog via the menu and "Upload File" submenu. Select the file at rest and choose the `Xmodem 1k` as protocol. Press `OK` and then `CANCEL` in the "Upload File" field, which appears at the top below the tools-line. That will set this values as default and the next time the file dialog is shown you may just press `OK`.

During the upload the [Serial Terminal 1.43](#android) shows some `^F` indicating the progress. Finally, when all succeeds, you will see the message "Reboot device to apply update". Enter "reboot" will reboot the device and on start it will take a couple of seconds more to copy and activate the new application firmware.
During the upload the [Serial Terminal 1.43](#android) shows some `^F` indicating the progress. Finally, when all succeeds, the device reboots to apply the update. The reboot will take a while copying the firmware from the download slot to the active slot and the old firmware to that download slot. After that the device continues to start the new application firmware. To prevent the device from being bricked, the device verifies the application firmware with the first successful data exchange. If the device reboots again before that, the old firmware is actived again. For that, don't apply a firmware update with low network coverage.

** !!! Under Construction !!! **
Loading

0 comments on commit 68f0a2e

Please sign in to comment.