Git Product home page Git Product logo

zenoh-pico's Introduction

Build Crossbuild integration Documentation Status Discussion Discord License License

Eclipse zenoh native C library for constrained devices

Eclipse zenoh is an extremely efficient and fault-tolerant Named Data Networking (NDN) protocol that is able to scale down to extremely constrainded devices and networks.

zenoh-pico is the Eclipse zenoh implementation that targets constrained devices and offers a native C API. It is fully compatible with its main Rust Zenoh implementation, providing a lightweight implementation of most functionalities.

Currently, zenoh-pico provides support for the following (RT)OSs and protocols:

(RT)OS Transport Layer Network Layer Data Link Layer
Unix UDP (unicast and multicast), TCP IPv4, IPv6, 6LoWPAN WiFi, Ethernet, Thread
Zephyr UDP (unicast and multicast), TCP IPv4, IPv6, 6LoWPAN WiFi, Ethernet, Thread
Arduino UDP (unicast and multicast), TCP IPv4, IPv6 WiFi, Ethernet, Bluetooth (Serial profile)
ESP-IDF UDP (unicast and multicast), TCP IPv4, IPv6 WiFi, Ethernet
MbedOS UDP (unicast and multicast), TCP IPv4, IPv6 WiFi, Ethernet, Serial
OpenCR UDP (unicast and multicast), TCP IPv4 WiFi

Check the website zenoh.io and the roadmap for more detailed information.


1. How to install it

The Eclipse zenoh-pico library is available as Debian, RPM, and tgz packages in the Eclipse zenoh-pico download area. Those packages are built using manylinux2010 x86-32 and x86-64 to be compatible with most of the Linux platforms. There are 2 kind of packages:

  • libzenohpico: only contains the library file (.so)
  • libzenohpico-dev: contains the zenoh-pico header files for development. Depends on libzenohpico package

For other platforms - like RTOS for embedded systems / microcontrollers -, you will need to clone and build the sources. Check below for more details.

WARNING: Note that zenoh-pico has not been ported on Windows yet!


2. How to build it

2.1 Unix Environments

To build the zenoh-pico library, you need to ensure that cmake is available on your platform -- if not please install it.

Once the cmake dependency is satisfied, just do the following for CMake version 3 and higher:

-- CMake version 3 and higher --

$ cd /path/to/zenoh-pico
$ make
$ make install # on Linux use **sudo**

If you want to build with debug symbols, set the BUILD_TYPE=Debugenvironment variable before to run make:

$ cd /path/to/zenoh-pico
$ BUILD_TYPE=Debug make
$ make install # on Linux use **sudo**

For those that still have CMake version 2.8, do the following commands:

$ cd /path/to/zenoh-pico
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ../cmake-2.8
$ make
$ make install # on Linux use **sudo**

2.2. Real Time Operating System (RTOS) for Embedded Systems and Microcontrollers

In order to manage and ease the process of building and deploying into a a variety of platforms and frameworks for embedded systems and microcontrollers, PlatformIO can be used as a supporting platform.

Once the PlatformIO dependency is satisfied, follow the steps below for the tested micro controllers.

2.2.1. Zephyr

Note: tested with reel_board, nucleo-f767zi, nucleo-f420zi, and nRF52840 boards.

A typical PlatformIO project for Zephyr framework must have the following structure:

project_dir
├── include
├── lib
├── src
│    └── main.c
├── zephyr
│    ├── prj.conf
│    └── CMakeLists.txt
└── platformio.ini

To initialize this project structure, execute the following commands:

$ mkdir -p /path/to/project_dir
$ cd /path/to/project_dir
$ platformio init -b reel_board
$ platformio run

Include the CMakelist.txt and prj.conf in the project_dir/zephyr folder as shown in the structure above,

$ cp /path/to/zenoh-pico/docs/zephyr/reel_board/CMakelists.txt /path/to/project_dir/zephyr/
$ cp /path/to/zenoh-pico/docs/zephyr/reel_board/prj.conf /path/to/project_dir/zephyr/

and add zenoh-pico as a library by doing:

$ ln -s /path/to/zenoh-pico /path/to/project_dir/lib/zenoh-pico

or just include the following line in platformio.ini:

lib_deps = https://github.com/eclipse-zenoh/zenoh-pico

Finally, your code should go into project_dir/src/main.c. Check the examples provided in examples directory.

To build and upload the code into the board, run the following command:

platformio run
platformio run -t upload

2.2.2. Arduino

Note: tested with az-delivery-devkit-v4 ESP32 board

A typical PlatformIO project for Arduino framework must have the following structure:

project_dir
├── include
├── lib
├── src
│    └── main.ino
└── platformio.ini

To initialize this project structure, execute the following commands:

$ mkdir -p /path/to/project_dir
$ cd /path/to/project_dir
$ platformio init -b az-delivery-devkit-v4
$ platformio run

Add zenoh-pico as a library by doing:

$ ln -s /path/to/zenoh-pico /path/to/project_dir/lib/zenoh-pico

or just include the following line in platformio.ini:

lib_deps = https://github.com/eclipse-zenoh/zenoh-pico

Finally, your code should go into project_dir/src/main.ino. Check the examples provided in examples directory.

To build and upload the code into the board, run the following command:

platformio run
platformio run -t upload

2.2.3. ESP-IDF

Note: tested with az-delivery-devkit-v4 ESP32 board

A typical PlatformIO project for ESP-IDF framework must have the following structure:

project_dir
├── include
├── lib
├── src
|    ├── CMakeLists.txt
│    └── main.ino
├── CMakeLists.txt
└── platformio.ini

To initialize this project structure, execute the following commands:

$ mkdir -p /path/to/project_dir
$ cd /path/to/project_dir
$ platformio init -b az-delivery-devkit-v4
$ platformio run

Add zenoh-pico as a library by doing:

$ ln -s /path/to/zenoh-pico /path/to/project_dir/lib/zenoh-pico

or just include the following line in platformio.ini:

lib_deps = https://github.com/eclipse-zenoh/zenoh-pico

Finally, your code should go into project_dir/src/main.ino. Check the examples provided in examples directory.

To build and upload the code into the board, run the following command:

platformio run
platformio run -t upload

2.2.4. MbedOS

Note: tested with nucleo-f747zi and nucleo-f429zi boards

A typical PlatformIO project for MbedOS framework must have the following structure:

project_dir
├── include
├── src
│    └── main.ino
└── platformio.ini

To initialize this project structure, execute the following commands:

$ mkdir -p /path/to/project_dir
$ cd /path/to/project_dir
$ platformio init -b az-delivery-devkit-v4
$ platformio run

Add zenoh-pico as a library by doing:

$ ln -s /path/to/zenoh-pico /path/to/project_dir/lib/zenoh-pico

or just include the following line in platformio.ini:

lib_deps = https://github.com/eclipse-zenoh/zenoh-pico

Finally, your code should go into project_dir/src/main.ino. Check the examples provided in examples directory.

To build and upload the code into the board, run the following command:

platformio run
platformio run -t upload

2.2.5. OpenCR

Note: tested with ROBOTIS OpenCR 1.0 board

A typical PlatformIO project for OpenCR framework must have the following structure:

project_dir
├── include
├── lib
├── src
│    └── main.ino
└── platformio.ini

Note: to add support for OpenCR in PlatformIO, follow the steps presented in our blog.

To initialize this project structure, execute the following commands:

$ mkdir -p /path/to/project_dir
$ cd /path/to/project_dir
$ platformio init -b opencr
$ platformio run

Add zenoh-pico as a library by doing:

$ ln -s /path/to/zenoh-pico /path/to/project_dir/lib/zenoh-pico

or just include the following line in platformio.ini:

lib_deps = https://github.com/eclipse-zenoh/zenoh-pico

Finally, your code should go into project_dir/src/main.ino. Check the examples provided in examples directory.

To build and upload the code into the board, run the following command:

platformio run
platformio run -t upload

3. Running the Examples

The simplest way to run some of the example is to get a Docker image of the zenoh network router (see http://zenoh.io/docs/getting-started/quick-test/) and then to run the examples on your machine.

3.1. Starting the zenoh Network Service

Assuming you've pulled the Docker image of the zenoh network router on a Linux host (to leverage UDP multicast scouting has explained here, then simply do:

$ docker run --init -net host eclipse/zenoh:master

To see the zenoh manual page, simply do:

$ docker run --init -net host eclipse/zenoh:master --help

3.2. Basic Pub/Sub Example

Assuming that (1) you are running the zenoh network router, and (2) you are under the build directory, do:

$ ./z_sub

And on another shell, do:

$ ./z_pub

3.3. Basic Queryable/Get Example

Assuming you are running the zenoh network router, do:

$ ./z_queryable

And on another shell, do:

$ ./z_get

zenoh-pico's People

Contributors

cguimaraes avatar mallets avatar esteve avatar jenoch avatar p-avital avatar spiderkeys avatar andreaz98 avatar frankplus avatar mkiael avatar robinlinden avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.