Skip to content

Commit 8ebd4f4

Browse files
Finalized Zenoh pub/sub example: added tip for single-device testing and clarified peer discovery behavior
1 parent b043548 commit 8ebd4f4

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: Zenoh Example-1 Simple Pub/Sub
2+
title: Run a simple Zenoh pub/sub example
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Example 1: Simple pub/sub
9+
## Test Zenoh pub/sub across two devices
1010

11-
This first test demonstrates the real-time publish/subscribe model using two Raspberry Pi devices.
11+
This example demonstrates Zenoh's real-time publish/subscribe model across two Raspberry Pi devices.
1212

13-
The following command is to initiate a subscriber for a key expression `demo/example/**`, a set of topics starting with the path `demo/example`.
13+
The subscriber listens for all data published under the key expression `demo/example/**`, which matches any topic beginning with `demo/example/`.
1414

15-
### Step 1: Run subscriber
15+
## Start the subscriber node
1616

1717
Run the subscriber example on one of the Raspberry Pi systems.
1818

@@ -21,7 +21,7 @@ cd ~/zenoh/target/release/examples
2121
./z_sub
2222
```
2323

24-
### Step 2: Run publisher
24+
## Start the publisher node
2525

2626
Then, log in to the other Raspberry Pi and run the publisher.
2727

@@ -30,12 +30,19 @@ cd ~/zenoh/target/release/examples
3030
./z_pub
3131
```
3232

33+
{{% notice Tip %}}
34+
You can run both `z_sub` and `z_pub` on the same device for testing, but running them on separate Raspberry Pis demonstrates Zenoh’s distributed discovery and cross-node communication.
35+
{{% /notice %}}
36+
37+
## Observe the pub/sub data flow
38+
3339
The result is shown below:
3440

35-
![img1 alt-text#center](zenoh_ex1.gif "Figure 1: Simple Pub/Sub")
41+
![img1 Zenoh subscriber receiving messages from a publisher in a two-terminal view#center](zenoh_ex1.gif "Simple Pub/Sub")
3642

3743
The left-side window shows the `z_sub` program.
3844

3945
It receives values with the key `demo/example/zenoh-rs-pub` continuously published by `z_pub` running in the right-side window.
4046

41-
This basic example shows Zenoh's zero-config discovery and low-latency pub/sub across physical nodes.
47+
This example confirms that Zenoh’s zero-configuration peer discovery and real-time pub/sub communication are working correctly across physical nodes.
48+

0 commit comments

Comments
 (0)