Skip to content

Commit 3d3cde4

Browse files
Merge pull request #2074 from odincodeshen/main
Scalable Networking for Industrial and Robotics with Zenoh on Raspberry Pi
2 parents 1fc167b + 4df71f8 commit 3d3cde4

File tree

14 files changed

+703
-0
lines changed

14 files changed

+703
-0
lines changed

assets/contributors.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,6 @@ Gian Marco Iodice,Arm,,,,
9191
Aude Vuilliomenet,Arm,,,,
9292
Andrew Kilroy,Arm,,,,
9393
Peter Harris,Arm,,,,
94+
Chenying Kuo,Adlink,evshary,evshary,,
95+
William Liang,,wyliang,,,
9496
Waheed Brown,Arm,https://github.com/armwaheed,https://www.linkedin.com/in/waheedbrown/,,
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Introduction to 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: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: Setting Up Zenoh on Arm Devices
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## 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+
### Download and build the Zenoh source
42+
43+
Now, we can clone the Zenoh.
44+
45+
```bash
46+
cd ~
47+
git clone https://github.com/eclipse-zenoh/zenoh.git
48+
```
49+
50+
After that, simply use cargo to build the source.
51+
52+
```bash
53+
cd zenoh
54+
cargo build --release --all-targets -j $(nproc)
55+
```
56+
57+
This will take several minutes depending on your device. Once the installation is complete, you should see:
58+
59+
```output
60+
cargo build --release --all-targets -j $(nproc)
61+
Updating crates.io index
62+
Downloaded humantime v2.2.0
63+
Downloaded spin v0.10.0
64+
Downloaded crossbeam-channel v0.5.14
65+
Downloaded uhlc v0.8.1
66+
Downloaded 4 crates (182.5 KB) in 2.19s
67+
warning: output filename collision.
68+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/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.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`.
69+
Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so
70+
The targets should have unique names.
71+
Consider changing their names to be unique or compiling them separately.
72+
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
73+
warning: output filename collision.
74+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/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.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`.
75+
Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.so.dwp
76+
The targets should have unique names.
77+
Consider changing their names to be unique or compiling them separately.
78+
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
79+
warning: output filename collision.
80+
The lib target `zenoh_plugin_storage_manager` in package `zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/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.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)`.
81+
Colliding filename is: /home/ubuntu/zenoh/target/release/deps/libzenoh_plugin_storage_manager.rlib
82+
The targets should have unique names.
83+
Consider changing their names to be unique or compiling them separately.
84+
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
85+
Compiling proc-macro2 v1.0.86
86+
Compiling unicode-ident v1.0.13
87+
Compiling libc v0.2.158
88+
Compiling version_check v0.9.5
89+
Compiling autocfg v1.3.0
90+
...
91+
Compiling zenoh-link-quic v1.4.0 (/home/ubuntu/zenoh/io/zenoh-links/zenoh-link-quic)
92+
Compiling zenoh_backend_traits v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-backend-traits)
93+
Compiling zenoh-plugin-storage-manager v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-storage-manager)
94+
Compiling zenoh-ext v1.4.0 (/home/ubuntu/zenoh/zenoh-ext)
95+
Compiling zenoh-ext-examples v1.4.0 (/home/ubuntu/zenoh/zenoh-ext/examples)
96+
Compiling zenoh-plugin-example v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-plugin-example)
97+
Compiling zenoh-backend-example v1.4.0 (/home/ubuntu/zenoh/plugins/zenoh-backend-example)
98+
Finished `release` profile [optimized] target(s) in 6m 28s
99+
```
100+
101+
After the build process, the binary executables will be stored under the directory of `~/zenoh/target/release/examples/`.
102+
103+
{{% notice Note %}}
104+
Installation time may vary depending on your device’s processing power.
105+
{{% /notice %}}
106+
107+
With Zenoh successfully compiled, you’re ready to explore how nodes communicate using the Zenoh runtime.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: Setting Up a 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 zenoh-node .
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 zenoh-node
57+
```
58+
59+
```output
60+
zenoh-node 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+
You have two options:
68+
69+
Option 1: Save and copy via file
70+
71+
```bash
72+
docker save zenoh-node > zenoh-node.tar
73+
scp zenoh-node.tar pi@<target_ip>:/home/pi/
74+
```
75+
76+
On the target device:
77+
```bash
78+
docker load < zenoh-node.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 the image is successfully loaded 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 Setting Option on Arm Virtual Hardware
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.
102+
103+
## Run Zenoh in Multi-Node Environment
104+
105+
You’re now ready to run and test Zenoh communication flows across distributed edge devices.
106+
107+
The source of the examples written in Rust will be provided, and both are interoperable. The
108+
Rust binaries are already available under: `$ZENOH_LOC/target/release/examples/` directory.
109+
110+
The following sections illustrate the procedures to run the Zenoh examples so as to demonstrate the primary capabilities of Zenoh
111+
1. Basic Pub/Sub – for real-time message distribution
112+
2. Query and Storage – to persist and retrieving historical data
113+
3. Queryable – to enable on-demand remote computation
114+
4. Dynamic Queryable with Computation
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Zenoh Example-1 Simple Pub/Sub
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Example 1: Simple Pub/Sub
10+
11+
This first test demonstrates Zenoh’s real-time publish/subscribe model using two Raspberry Pi devices.
12+
13+
The following command is to initiate a subscriber for a key expression `demo/example/**`, i.e. a set of topics starting with the path `demo/example`.
14+
15+
### Step 1: Run Subscriber
16+
17+
Log in to Pi using any of the methods:
18+
19+
```bash
20+
cd ~/zenoh/target/release/examples
21+
./z_sub
22+
```
23+
24+
### Step 2: Run Publisher
25+
26+
Then, log in to another machine Pi.
27+
28+
```bash
29+
cd ~/zenoh/target/release/examples
30+
./z_pub
31+
```
32+
33+
The result will look like:
34+
![img1 alt-text#center](zenoh_ex1.gif "Figure 1: Simple Pub/Sub")
35+
36+
In the left-side window, I have logged into the device Pi4 and run the z_sub program.
37+
It receives values with the key `demo/example/zenoh-rs-pub` continuously published by z_pub running on Pi in the right-side window.
38+
39+
This basic example shows Zenoh’s zero-config discovery and low-latency pub/sub across physical nodes.

0 commit comments

Comments
 (0)