Skip to content

Commit

Permalink
Update Getting Started to 1.0.0 (#55)
Browse files Browse the repository at this point in the history
* update your first Zenoh App

* update deployment zenohd command output

* update deployment page: new config + small wording fixes

* add note regarding rustc version
  • Loading branch information
Charles-Schleich authored Sep 10, 2024
1 parent b1a9624 commit 435ead1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 73 deletions.
6 changes: 3 additions & 3 deletions content/docs/getting-started/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Zenoh applications in `peer` mode join multicast group `224.0.0.224` on UDP port
enabled: true,
address: "224.0.0.224:7446",
interface: "auto",
autoconnect: { peer: "router|peer" },
autoconnect: { router: [], peer: ["router", "peer"] },
listen: true,
},
},
Expand All @@ -49,7 +49,7 @@ Zenoh applications in `peer` mode join multicast group `224.0.0.224` on UDP port

**Gossip scouting**

Zenoh applications in `peer` mode forward all local applications and router they already discovered to newly scouted applications. This is useful when multicast communications are not available. But applications need to connect to a first entry point to discover the rest of the system. This entry point is typically one or several Zenoh routers but can also be one or several other peers. Those entry points are configured through the `connect` section of the configuration.
Zenoh applications in `peer` mode forward all local applications and routers that they already discovered to newly scouted applications. This is useful when multicast communications are not available. But applications need to connect first to an entry point to discover the rest of the system. This entry point is typically one or several Zenoh routers but can also be one or several other peers. Those entry points are configured through the `connect` section of the configuration.

**Configuration**
```
Expand All @@ -62,7 +62,7 @@ Zenoh applications in `peer` mode forward all local applications and router they
gossip: {
enabled: true,
multihop: false,
autoconnect: { peer: "router|peer" },
autoconnect: { router: [], peer: ["router", "peer"] },
},
},
}
Expand Down
13 changes: 7 additions & 6 deletions content/docs/getting-started/first-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Now we need a subscriber, `z_subscriber.py` that can receive the measurements:
import zenoh, time

def listener(sample):
print(f"Received {sample.kind} ('{sample.key_expr}': '{sample.payload.decode('utf-8')}')")

print(f"Received {sample.kind} ('{sample.key_expr}': '{sample.payload.deserialize(str)}')")
if __name__ == "__main__":
session = zenoh.open()
sub = session.declare_subscriber('myhome/kitchen/temp', listener)
Expand Down Expand Up @@ -108,14 +108,15 @@ import zenoh

if __name__ == "__main__":
session = zenoh.open()
replies = session.get('myhome/kitchen/temp', zenoh.ListCollector())
for reply in replies():
replies = session.get('myhome/kitchen/temp')
for reply in replies:
try:
print("Received ('{}': '{}')"
.format(reply.ok.key_expr, reply.ok.payload.decode("utf-8")))
.format(reply.ok.key_expr, reply.ok.payload.deserialize(str)))
except:
print("Received (ERROR: '{}')"
.format(reply.err.payload.decode("utf-8")))
.format(reply.err.payload.decode(str)))

session.close()
```
## Other examples
Expand Down
110 changes: 47 additions & 63 deletions content/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,68 +91,52 @@ $ zenohd --help
You should see the following output on your console:

```text
The Zenoh router v0.6.0-beta.X
USAGE:
zenohd [OPTIONS]
OPTIONS:
-c, --config [<FILE>...]
The configuration file. Currently, this file must be a valid JSON5 or YAML file.
--cfg <KEY:VALUE>
Allows arbitrary configuration changes as column-separated KEY:VALUE pairs, where:
- KEY must be a valid config path.
- VALUE must be a valid JSON5 string that can be deserialized to the expected type for
the KEY field.
Examples:
--cfg='startup/subscribe:["demo/**"]'
--cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'
-e, --connect [<ENDPOINT>...]
A peer locator this router will try to connect to.
Repeat this option to connect to several peers.
-h, --help
Print help information
-i, --id [<HEX_STRING>]
The identifier (as an hexadecimal string, with odd number of chars - e.g.: 0A0B23...)
that zenohd must use. If not set, a random UUIDv4 will be used.
WARNING: this identifier must be unique in the system and must be 16 bytes maximum (32
chars)!
-l, --listen [<ENDPOINT>...]
A locator on which this router will listen for incoming sessions.
Repeat this option to open several listeners.
--no-multicast-scouting
By default zenohd replies to multicast scouting messages for being discovered by peers
and clients. This option disables this feature.
--no-timestamp
By default zenohd adds a HLC-generated Timestamp to each routed Data if there isn't
already one. This option disables this feature.
-P, --plugin [<PLUGIN>...]
A plugin that MUST be loaded. You can give just the name of the plugin, zenohd will
search for a library named 'libzplugin_<name>.so' (exact name depending the OS). Or you
can give such a string: "<plugin_name>:<library_path>".
Repeat this option to load several plugins. If loading failed, zenohd will exit.
--plugin-search-dir [<DIRECTORY>...]
A directory where to search for plugins libraries to load.
Repeat this option to specify several search directories.
--rest-http-port [<SOCKET>]
Configures HTTP interface for the REST API (enabled by default). Accepted values:
- a port number
- a string with format `<local_ip>:<port_number>` (to bind the HTTP server to a
specific interface)
- `none` to disable the REST API
[default: 8000]
-V, --version
Print version information
2024-08-12T13:27:29.724708Z INFO main ThreadId(01) zenohd: zenohd v0.11.0-dev-965-g764be602d built with rustc 1.75.0 (82e1608df 2023-12-21)
The zenoh router
Usage: zenohd [OPTIONS]
Options:
-c, --config <PATH>
The configuration file. Currently, this file must be a valid JSON5 or YAML file
-l, --listen <ENDPOINT>
Locators on which this router will listen for incoming sessions. Repeat this option to open several listeners
-e, --connect <ENDPOINT>
A peer locator this router will try to connect to. Repeat this option to connect to several peers
-i, --id <ID>
The identifier (as an hexadecimal string, with odd number of chars - e.g.: A0B23...) that zenohd must use. If not set, a random unsigned 128bit integer will be used. WARNING: this identifier must be unique in the system and must be 16 bytes maximum (32 chars)!
-P, --plugin <PLUGIN>
A plugin that MUST be loaded. You can give just the name of the plugin, zenohd will search for a library named 'libzenoh_plugin_\<name\>.so' (exact name depending the OS). Or you can give such a string: "\<plugin_name\>:\<library_path\>" Repeat this option to load several plugins. If loading failed, zenohd will exit
--plugin-search-dir <PATH>
Directory where to search for plugins libraries to load. Repeat this option to specify several search directories
--no-timestamp
By default zenohd adds a HLC-generated Timestamp to each routed Data if there isn't already one. This option disables this feature
--no-multicast-scouting
By default zenohd replies to multicast scouting messages for being discovered by peers and clients. This option disables this feature
--rest-http-port <SOCKET>
Configures HTTP interface for the REST API (enabled by default on port 8000). Accepted values: - a port number - a string with format `<local_ip>:<port_number>` (to bind the HTTP server to a specific interface) - `none` to disable the REST API
--cfg <CFG>
Allows arbitrary configuration changes as column-separated KEY:VALUE pairs, where: - KEY must be a valid config path. - VALUE must be a valid JSON5 string that can be deserialized to the expected type for the KEY field.
Examples: - `--cfg='startup/subscribe:["demo/**"]'` - `--cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
--adminspace-permissions <[r|w|rw|none]>
Configure the read and/or write permissions on the admin space. Default is read only
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
```

3 changes: 2 additions & 1 deletion content/docs/getting-started/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ To check this look for such logs:
[2022-03-28T15:23:36Z INFO zenohd] Successfully started plugin storage_manager from "/Users/test/.zenoh/lib/libzplugin_storage_manager.dylib"
[2022-03-28T15:23:36Z INFO zenohd] Successfully started plugin webserver from "/Users/test/.zenoh/lib/libzplugin_webserver.dylib"
```
Here you can see all the plugins libraries that have been loaded by `zenohd` at startup. You must check if each of those are using the same Zenoh version as dependency than `zenohd`.
Here you can see all the plugins libraries that have been loaded by `zenohd` at startup.
You must check if each of the plugins are using the same Zenoh version as dependency than `zenohd` and Rust compiler version as the `zenohd` instance.
To assess which one is causing troubles, you can also move or rename all the libraries but one and test if `zenohd` is correctly loading this one. Then repeat the process for each library.


Expand Down

0 comments on commit 435ead1

Please sign in to comment.