Skip to content

Commit afd3627

Browse files
committed
Scalable Industrial Networking for Raspberry Pi Robotics with Zenoh
1 parent e32e5d5 commit afd3627

7 files changed

Lines changed: 501 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Introduction Zenoh
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## The Need for Scalable Communication in Robotics and Edge Computing
10+
11+
Modern robotics and industrial IoT (IIoT) systems are evolving rapidly—from indoor collaborative arms on assembly lines to fleets of outdoor autonomous delivery robots.
12+
These applications must operate in real-time, often across multiple compute nodes, over networks that may span factory LANs, 5G cellular links, or even cloud data centers.
13+
14+
Such systems require fast, reliable, and scalable data communication between nodes.
15+
This includes not just broadcasting sensor updates or actuator commands (i.e., pub/sub), but also performing state queries, storing values for later use, and even distributed computation across nodes. A modern protocol must be:
16+
* Low-latency: Immediate delivery of time-critical messages.
17+
* High-throughput: Efficient data flow across many devices.
18+
* Decentralized: No reliance on central brokers or fixed infrastructure.
19+
* Flexible: Able to run on lightweight edge devices, across WANs, or inside cloud-native environments.
20+
21+
Traditional communication stacks such as DDS ([Data Distribution Service](https://en.wikipedia.org/wiki/Data_Distribution_Service)) serve as the backbone for middleware like ROS 2. However, DDS struggles in multi-network or wireless environments where multicast is unavailable, or NAT traversal is needed.
22+
These constraints can severely impact deployment and performance at the edge.
23+
24+
25+
## Zenoh: An Open-Source Pub/Sub Protocol for the Industrial Edge
26+
27+
[Eclipse Zenoh](https://zenoh.io/) is a modern, [open-source](https://github.com/eclipse-zenoh/zenoh) data-centric communication protocol that goes beyond traditional pub/sub. Designed specifically for edge computing, IIoT, robotics, and autonomous systems, Zenoh unifies:
28+
29+
* Data in motion through a powerful and efficient pub/sub model.
30+
* Data at rest via geo-distributed storage plugins.
31+
* Data in use with direct query support.
32+
* On-demand computation via queryable nodes that can generate data dynamically.
33+
34+
Unlike most traditional stacks, Zenoh is fully decentralized and designed to operate across cloud-to-edge-to-thing topologies, making it ideal for industrial robotics, autonomous systems, and smart environments.
35+
It supports heterogeneous platforms, is implemented in Rust for performance and safety, and also offers bindings for Python, enabling rapid prototyping.
36+
37+
Zenoh is particularly effective in wireless, 5G, or cross-network deployments where multicast and DDS fall short.
38+
Its routing engine avoids excessive discovery traffic, conserves bandwidth, and supports seamless bridging between legacy ROS 2/DDS apps and modern, optimized Zenoh networks using zenoh-bridge-dds.
39+
40+
In this learning path, you’ll use Zenoh to build and validate a multi-node distributed communication system across multiple Arm-based platforms, gaining hands-on experience with data exchange and coordination between edge devices.
41+
42+
To make the upcoming demo more intuitive and easy to follow, we’ll demonstrate the setup using two physical Cortex-A Linux devices.
43+
44+
I’ll be using Raspberry Pi boards in this learning path, but you’re free to substitute them with any Cortex-A devices that support network connectivity with Linux-based OS installed, depending on your development setup.
45+
46+
In real-world ROS 2 deployment scenarios, developers typically conduct validation and performance testing across systems with more than two nodes.
47+
To simulate such environments, using [Arm virtual hardware](https://www.arm.com/products/development-tools/simulation/virtual-hardware) is also a common and efficient approach.
48+
49+
This will help you quickly validate your architecture choices and communication patterns when designing distributed applications.
50+
51+
* Raspberry Pi,
52+
* Linux-based Cortex-A, or
53+
* Arm Virtual Hardware (AVH).
54+
55+
After this learning path, you will:
56+
* Understand the core architecture and data flow principles behind Eclipse Zenoh, including its support for pub/sub, querying, and queryable edge functions.
57+
* Build and run distributed Zenoh examples across multiple Arm-based nodes—using Raspberry Pi or AVH to simulate scalable deployment environments.
58+
* Rebuild and extend the Zenoh queryable example to simulate edge-side logic.
59+
60+
By the end of this learning path, you’ll have deployed a fully functional, scalable, and latency-aware Zenoh system.
61+
62+
You can also check [here](https://zenoh.io/docs/getting-started/first-app) to find some simple examples.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: Setting Up Zenoh on Arm Devices
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
### Installation: Setting Up Zenoh on Arm Devices
10+
11+
The following instructions are verified on both Raspberry Pi 4/5 and Arm Virtual Hardware, but you can implement them on any Cortex-A Linux device.
12+
13+
Before building Zenoh, make sure your system has the necessary development tools and runtime libraries.
14+
15+
#### Install the Rust build environment
16+
17+
First, we need to install the [Rust](https://www.rust-lang.org/) build environment, since the core of Zenoh is totally developed using Rust to keep it safe and efficient.
18+
19+
Follow this [installation guide](https://learn.arm.com/install-guides/rust/) to install Rust and Cargo on Arm Linux, a build system for Rust. Or, simply use the following commands.
20+
21+
```bash
22+
curl https://sh.rustup.rs -sSf | sh
23+
```
24+
25+
Follow the prompts to complete the installation. If successful, you’ll see:
26+
27+
```output
28+
Rust is installed now. Great!
29+
```
30+
31+
For more details, refer to [Rust’s official install guide.](https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo)
32+
33+
#### Install ROS 2
34+
35+
[Robot Operating System](https://www.ros.org/) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it's all open source.
36+
37+
Since ROS was started in 2007, a lot has changed in the robotics and ROS community. The goal of the [ROS 2](https://docs.ros.org/en/rolling/index.html) project is to adapt to these changes, leveraging what is great about ROS 1 and improving what isn’t.
38+
39+
Here is the quick [installation guide](https://learn.arm.com/install-guides/ros2/) about how to install ROS 2 in Arm platform.
40+
41+
42+
## Download and build the Zenoh source
43+
44+
Now, we can clone the Zenoh.
45+
46+
```bash
47+
cd ~
48+
git clone https://github.com/eclipse-zenoh/zenoh.git
49+
```
50+
51+
After that, simply use cargo to build the source.
52+
53+
```bash
54+
cd zenoh
55+
cargo build --release --all-targets -j $(nproc)
56+
```
57+
58+
This will take several minutes depending on your device. Once the installation is complete, you should see:
59+
60+
```output
61+
cargo build --release --all-targets -j $(nproc)
62+
warning: output filename collision.
63+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)`.
64+
Colliding filename is: /home/ubuntu/zenoh/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so
65+
The targets should have unique names.
66+
Consider changing their names to be unique or compiling them separately.
67+
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
68+
warning: output filename collision.
69+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)`.
70+
Colliding filename is: /home/ubuntu/zenoh/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so.dwp
71+
The targets should have unique names.
72+
Consider changing their names to be unique or compiling them separately.
73+
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
74+
warning: output filename collision.
75+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)` has the same output filename as the lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)`.
76+
Colliding filename is: /home/ubuntu/zenoh/zenoh/target/release/deps/libzenoh_plugin_storage_manager.rlib
77+
The targets should have unique names.
78+
Consider changing their names to be unique or compiling them separately.
79+
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
80+
Compiling zenoh-plugin-storage-manager v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-storage-manager)
81+
Compiling zenoh-ext-examples v1.3.0 (/home/ubuntu/zenoh/zenoh/zenoh-ext/examples)
82+
Compiling zenoh-plugin-rest v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-rest)
83+
Compiling zenohd v1.3.0 (/home/ubuntu/zenoh/zenoh/zenohd)
84+
Compiling zenoh-backend-example v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-backend-example)
85+
Compiling zenoh-examples v1.3.0 (/home/ubuntu/zenoh/zenoh/examples)
86+
Compiling zenoh-ext v1.3.0 (/home/ubuntu/zenoh/zenoh/zenoh-ext)
87+
Compiling zenoh_backend_traits v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-backend-traits)
88+
Compiling zenoh-plugin-example v1.3.0 (/home/ubuntu/zenoh/zenoh/plugins/zenoh-plugin-example)
89+
Compiling zenoh v1.3.0 (/home/ubuntu/zenoh/zenoh/zenoh)
90+
Finished `release` profile [optimized] target(s) in 8m 12/home/ubuntu/zenoh/zenoh/plugins/zenoh-backend-examples
91+
```
92+
93+
After the build process, the binary executables will be stored under the directory of `~/zenoh/target/release/examples/`.
94+
95+
{{% notice Note %}}
96+
Installation time may vary depending on your device’s processing power.
97+
{{% /notice %}}
98+
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Setup Multi-Node Environment
3+
weight: 4
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
### Deploying Zenoh on Multiple Raspberry Pi Devices Using Docker
10+
11+
After building Zenoh and its core examples, your next step is to deploy them across multiple Arm-based devices.
12+
13+
In this session, you’ll use Raspberry Pi boards to simulate a scalable, distributed environment—but the same workflow applies to any Arm Linux system, including Arm cloud instances and Arm Virtual Hardware.
14+
15+
You’ll learn how to use Docker to deploy the environment on physical devices, and how to duplicate virtual instances using snapshot cloning on Arm Virtual Hardware.
16+
17+
This setup lets you simulate `real-world`, `cross-node communication`, making it ideal for validating Zenoh’s performance in robotics and industrial IoT use cases.
18+
19+
#### Install Docker on Raspberry Pi
20+
21+
To simplify this process and ensure consistency, you’ll use Docker to containerize your Zenoh and ROS 2 environment.
22+
This lets you quickly replicate the same runtime on any device without needing to rebuild from source.
23+
24+
This enables multi-node testing and real-world distributed communication scenarios.
25+
26+
First, install the docker environment on each of Raspberry Pi if you don't have that.
27+
28+
```bash
29+
curl -sSL https://get.docker.com | sh
30+
sudo usermod -aG docker pi
31+
```
32+
33+
Log out and back in, or run newgrp docker to activate Docker group permissions.
34+
35+
#### Create a ROS 2 + DDS Docker Image
36+
37+
In a working directory, create a `Dockerfile` with the following content to create the ROS 2 / DDS docker image.
38+
39+
```bash
40+
FROM ros:galactic
41+
RUN apt-get update
42+
RUN apt-get install -y ros-galactic-demo-nodes-cpp ros-galactic-rmw-cyclonedds-cpp ros-galactic-turtlesim
43+
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
44+
CMD bash
45+
```
46+
47+
Under the directory where the above Dockerfile exists, run the following command to generate the docker image.
48+
49+
```bash
50+
$ docker build -t ros2-docker .
51+
```
52+
53+
After this has been done, the created ROS 2 docker image can be seen by the following command.
54+
55+
```bash
56+
$ docker images | grep ros2-docker
57+
```
58+
59+
```output
60+
ros2-docker latest b7a9c27cf8a8 About a minute ago 962MB
61+
```
62+
63+
#### Transfer the Docker Image on Another RPi
64+
65+
You now need to transfer the Docker image to your second device. Choose one of the following methods:
66+
67+
There are two of option you can do:
68+
69+
Option 1: Save and copy via file
70+
71+
```bash
72+
docker save ros2-docker > ros2-docker.tar
73+
scp ros2-docker.tar pi@<target_ip>:/home/pi/
74+
```
75+
76+
On the target device:
77+
```bash
78+
docker load < ros2-docker.tar
79+
```
80+
81+
Option 2: Push to a container registry (e.g., DockerHub or GHCR).
82+
83+
You can also push the image to Docker Hub or GitHub Container Registry and pull it on the second device.
84+
85+
#### Run the Docker Image
86+
87+
Once you success load the image into second device, you can run the container by
88+
89+
```bash
90+
docker run -it --network=host zenoh-node
91+
```
92+
93+
Now, all the Zenoh example binaries are now available within this container, allowing you to test pub/sub and query flows across devices.
94+
95+
### Another Duplicate Settup Option on Arm Virtual Hardware RPi devices (Optional)
96+
97+
If you have [Corellium](https://www.corellium.com/) account, you can
98+
99+
1. Set up and install Zenoh on a single AVH instance.
100+
2. Use the [Clone](https://support.corellium.com/features/snapshots) function to duplicate the environment.
101+
3. Optionally, you may optionally rename the device to avh* for easy device recognition by changing the setting in the `/etc/hostname` file.

0 commit comments

Comments
 (0)