The Nabto Edge Embedded SDK

The vendor integrates the Nabto Edge Embedded SDK in the target device application (typically an IoT device) to be remote controlled.

The SDK is available as open source ANSI C code in github under a commercial license. That is, you can use and modify the source as needed as long as it is for use in a project as agreed with Nabto.

In this way integration on specific embedded devices becomes simpler as you can tweak and optimize exactly as necessary using any specific tools available for the target platforms without depending on precompiled libraries delivered by Nabto.

The vendor’s embedded application is shown as the topmost black box in the following figure. It uses the Nabto Edge Embedded SDK. The SDK in turn needs integration to the specific underlying operating system and/or hardware.

Nabto provides a set of ready-to-use integrations. As of writing Linux is the only embedded-flavor operating system supported (with additional support for macOS and Windows for development). Ready-to-use integrations for true embedded systems is underway.

Integrating to a new system, e.g. a currently unsupported (RT)OS and/or IP stack, is supported through an integration layer, described in the integration guide and step-by-step instructions with test harness and interface stubs to implement.

Obtaining The Nabto Edge Embedded SDK

The Nabto Edge Embedded SDK is obtained from github, preferably using a git client to retrieve dependencies automatically (the --recursive option):

git clone --recursive https://github.com/nabto/nabto-embedded-sdk

The external dependencies as well as 3rd party software included in the SDK repo are all under MIT, Apache 2.0 or similar license (no GPL).

Building for test and development on desktop systems

To build the SDK libraries and example applications for Linux, macOS and Windows, CMake must be installed as well as standard development tools (gcc, Xcode or Visual Studio respectively).

Unit tests depends on Boost C++ test framework. In case the target does not have a C++ compiler installed, unit tests are disabled by default. Unit tests can also be enabled manually by setting the DEVICE_BUILD_TESTS option to On in cmake (cmake -DDEVICE_BUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=../_install ..).

Perform the following steps in a terminal / command console:

cd nabto-embedded-sdk
mkdir _build
cd _build
cmake -DCMAKE_INSTALL_PREFIX=../_install ..
cmake --build . --config Release --target install

The result looks as follows:

../_install
├── bin
│   ├── embedded_unit_test
│   ├── futures_example_device
│   ├── thermostat_device
│   ├── platform_integration_stub
│   ├── simple_coap_device
│   └── tcp_tunnel_device
├── include
│   └── nabto
│       ├── nabto_device.h
│       └── nabto_device_experimental.h
└── lib
    └── libnabto_device.dylib

4 directories, 6 files

Run the unit tests to see everything works:

$ ./bin/embedded_unit_test -p
Running 68 test cases...

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

*** No errors detected

The libnabto_device library can be linked to by your own application. See the example applications.

The tcp_tunnel_device is a ready-to-use Nabto Edge Tunnelling TCP reverse proxy - read more about this in the Tunnel Guide with a specific example of use in the tunnel quickstart.

Troubleshooting

If you see an error as follows:

CMake Error at 3rdparty/libevent/CMakeLists.txt:10 (add_subdirectory):
  The source directory

    /tmp/nabto-embedded-sdk/3rdparty/libevent/libevent

  does not contain a CMakeLists.txt file.

then you most likely did not clone recursively, e.g. you forgot to specify the --recursive commandline option to git. If so, either start over or retrieve the dependencies using the following:

git submodule update --recursive --init

Building for embedded systems

Please see the integration guide for detailed instructions on how to adapt to and cross build in general for a custom embedded system.

For a standard Raspberry Pi system, it is just as simple to build as for a desktop system - see the Raspberry Pi specific Nabto Edge Embedded SDK build instructions.

Application development

See the embedded application intro and the API reference to get started with application development. Full examples of CoAP and tunnelling are also available.