This repository contains a public version of IOWA LwM2M stack, illustrating how to use the LwM2M library.
Documentation could be found here: https://ioterop.github.io/IOWA/
This code is provided as-is, under the associated licence (./LICENSE.txt). (This code should not be used in a commercial product and is for personal evaluation ONLY)
With this code, you can jump into LwM2M and validate the build and the execution of the IOWA stack on your device, but with some limitations:
IOWA Eval SDK | IOWA Full SDK | |
---|---|---|
Free for Non Commercial Usage | Contact us | |
Source Code & C-Make | ✔️ | ✔️ |
LwM2M 1.0 | ✔️ | ✔️ |
LwM2M 1.1 | ❌ | ✔️ |
Mandatory LwM2M Objects | ✔️ | ✔️ |
Full IPSO Objects | ❌ | ✔️ |
UDP Transport | ✔️ | ✔️ |
TCP Transport | ❌ | ✔️ |
COAP Block | ✔️ | ✔️ |
LwM2M 1.1 data formats | ❌ | ✔️ |
Bootstrap | ❌ | ✔️ |
Firmware Update | ❌ | ✔️ |
Multithread | ❌ | ✔️ |
Two kinds of samples are available on this repository. The first set of samples can be used as a reference for evaluating this code. The second set (refered as Full_SDK_Samples) is for information only, as it is NOT BUILDABLE without the Full SDK
The *Full SDK" and additional information is available from https://ioterop.com/iowa/.
Additional technical contents and how-to's may be found at https://ioterop.com/iot-dev-24-7/.
Please note: Neither the SDK nor the samples are open source software but commercial software.
Whatever SDK (Eval or Full) you are using, start with the sample 01-baseline_client.
Category | Sample name | Purpose |
---|---|---|
Basic samples | 01-baseline_client | For creating a working LwM2M Client with IOWA |
Basic samples | 02-IPSO_client | How to add an IPSO temperature sensor Object |
Custom Object | 03-custom_object_baseline_client | How to add a simple custom LwM2M Object |
Custom Object | 04-custom_object_dynamic | How to make the values exposed by the custom Object dynamic |
Full SDK only | 01-multithread_IPSO_client | This sample demonstrates the multi-thread support (full SDK only) |
Category | Sample name | Purpose |
---|---|---|
Full SDK only | secure_client | How to use secure communications. |
Full SDK only | fwupdate_push_client | How to receive Firmware Updates in push mode. |
Full SDK only | fwupdate_pull_client | How to receive Firmware Updates in pull mode. This sample demonstrates the CoAP APIs. |
Full SDK only | timestamp_IPSO | How to timestamp values in IPSO sensors. |
Full SDK only | timestamp_custom_objects | How to timestamp values in custom LwM2M Objects. |
Full SDK only | streamable_resources | How to work with large values like images or file contents. |
Full SDK only | asynchronous_resources | How to work with time consuming value retrieval. |
Full SDK only | low_MTU_client | How to use adapt to limited network MTU. |
Full SDK only | adaptive_client | How to adapt to degraded network conditions by modifying the CoAP timers. |
All the samples can be built/run on Windows and Linux. Other platforms and OS (FreeRTOS, Zephyr, Android, ...) are available on request.
You can find some interesting tutorials on Hackster.io:
Initial setup: Don't forget to clone this repository:
git clone --recurse-submodules https://github.com/IOTEROP/IOWA.git
Prerequisites: An x86-64 computer with a Linux distribution installed, the cmake
utility, the make
utility and a C compiler.
-
Inside the IOWA repositiory, create a build folder
mkdir build
-
Go to this folder
cd build
-
Launch cmake in debug mode
cmake -DCMAKE_BUILD_TYPE=Debug ..
The last parameter point to the folder containing the CMakeLists.txt file of your target. In this case the one at the root of the repo including all the samples.
If you want, you can define the IOWA Client name with -DIOWA_DEV_NAME:"..."
(e.g.:
cmake -DCMAKE_BUILD_TYPE=Debug -DIOWA_DEV_NAME="MyDevice" ..
) -
Build the client and the server.
make -j 4
( the
-j 4
parameter enables four parallel compilations, could be replaced withmake -j$(nproc)
)
(After making some modifications to the code, only the step 4 is required)
- Jump into the associated directory. E.g:
cd samples/01-baseline_client
- Run the sample. E.g:
./baseline_client
- Install the Microsoft C++ compiler as explained here: https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019
- Select the "Build Tools for Visual Studio 2019".
- In the Installer, make sure the following optional features are checked:
- MSVC v142 - VS 2019 C++ x64/x86 build tools (Note that the version may differ)
- Windows 10 SDK
- C++ CMake tools for Windows
- Install Visual Studio Code from https://code.visualstudio.com/
- Launch Visual Studio Code.
- Go to the "Extensions" panel (Ctrl+Shift+X) on the left side.
- Install the "C/C++", "CMake", and "CMake Tools" extensions
- Open the folder containing the IOWA Samples ("File" menu -> "Open Folder..." or "Ctrl+K Ctrl+O")
- Open the CMake panel on the left side.
- On the top bar of the CMake panel, click on the icon "Configure All Projects".
- When prompted to select a kit, choose one of the Visual Studio Build Tools.
- On the top bar of the CMake panel, click on the icon "Build All Projects".
- Click on the sample of your choice.
- Right-click on the application and select "Run in terminal"
Visual Studio version must be at least 2017 for the CMake support.
- In the Visual Studio menu bar, go to "File", "Open", "Folder". Select the IOWA Samples folder.
- In the "Solution Explorer" windows, right-click on "CMakeList.txt" and choose "Set as Startup Item".
- In the Visual Studio menu bar, go to "Build", "Build All"
By default, sample codes are built with the "verbose" option, so don't be afraid if your terminal is filled with many traces ! The important line to find is the reference name of your client (based on hardware values). You can customize it in the code. E.g:
...
[info:lwm2m:lwm2m_configure:137] endpointName: "IOWA_sample_client_8323329", msisdn: "NULL"
...
You can interact with your device using the Ioterop Connecticut server (https://iowa-server.ioterop.com). This server can get/send commands/datas with your device and validate the way your code runs. (* Connecticut* is the LwM2M Ioterop test server where your device will be connected. This is one solution among others (e.g.: Alaska platform, ...).