eclipse-zenoh / zenoh

zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
https://zenoh.io
Other
1.41k stars 146 forks source link

Zenoh subscriber not working[Bug] #578

Open DrBwts opened 10 months ago

DrBwts commented 10 months ago

Describe the bug

Subscriber listener not picking up any payloads

To reproduce

I'm using the code from Your first Zeno app.

I have 2 Anaconda prompt windows open, both with the Zenoh environment active.

I first run the subscriber in window 1 & then the publisher in window 2.

The publisher code is ticking away quite happily printing away in its window but there is nothing showing up in the subscriber window.

System info

Win 10 x64, Python 3.10, conda env, latest version of Zenoh on pip

YuanYuYuan commented 10 months ago

Hi @DrBwts , can you enable the logging by prepending the following lines before zenoh.open and

# initiate logging
zenoh.init_logger()

adding an environmental variable RUST_LOG="info"? So that we can better understand the failure.

Can you also try the examples by explicitly specifying the peers to connect with? Thanks!

python examples/z_sub.py -m peer -l tcp/127.0.0.1:17447
python examples/z_pub.py -m peer -e tcp/127.0.0.1:17447
DrBwts commented 10 months ago

Hi @YuanYuYuan

Added the loggers but not sure where the data is logged to?

When using explicitly defined peers the pub & sub scripts work as expected.

OlivierHecart commented 10 months ago

Hello @DrBwts !

  1. To activate logs you need to set the RUST_LOG environment variable: set RUST_LOG=debug
  2. If the z_pub/z_sub examples do work with -l/-e options but not without them, it means that multicast scouting is not working. This might be due to your network configuration. Informations on your network cards configuration like ipconfig could help.
sumitpaulde commented 1 month ago

When I tried to run the previous mentioned command with the real IP address of 2 machines I got this error, where 192.168.1.72 is the IP address of machine B.

ERROR zenoh::net::runtime::orchestrator] Unable to open listener tcp/192.168.1.72:7447: Can not create a new TCP listener bound to tcp/192.168.1.72:7447: [192.168.1.72:7447: Cannot assign requested address (os error 99) at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/d118a2d/io/zenoh-links/zenoh-link-tcp/src/unicast.rs:245.] at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/d118a2d/io/zenoh-links/zenoh-link-tcp/src/unicast.rs:332.

What is the correct way to establish pub/sub between two different physical nodes?