Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client mode node cannot connect windows-based router #1589

Closed
WanderWang opened this issue Nov 8, 2024 · 1 comment
Closed

client mode node cannot connect windows-based router #1589

WanderWang opened this issue Nov 8, 2024 · 1 comment
Labels
invalid This doesn't seem right

Comments

@WanderWang
Copy link

WanderWang commented Nov 8, 2024

Describe the bug

here is my code pub.py:

import zenoh, random, time

random.seed()


def read_temp():
    return random.randint(15, 30)


if __name__ == "__main__":
    zenoh.init_log_from_env_or("debug")
    cfg = zenoh.Config.from_file("./config.json5")
    session = zenoh.open(cfg)
    while True:
        temp = read_temp()
        print("Publishing temperature: {}".format(temp))
        session.put("myhome/kitchen/temp", str(temp))
        time.sleep(5)
    session.close()

here is my config config.json5

{
  mode: "client",
  connect: {
    endpoints: [
      "tcp/192.168.0.114:7447", // this ip is my localhost ip
    ],
  },
}

When I ran a zenohd.exe ( windows,1.0.1) and execute pub.py ,it raise an excpetion:

4-11-08T13:09:33.951253Z DEBUG ThreadId(01) zenoh::net::runtime::orchestrator: Try to connect: tcp/192.168.0.114:7447: global timeout: 0ns, retry: ConnectionRetryConf { exit_on_failure: true, period_init_ms: 1000, period_max_ms: 4000, period_increase_factor: 2.0 }
2024-11-08T13:09:34.967689Z  WARN ThreadId(01) zenoh::net::runtime::orchestrator: Unable to connect to tcp/192.168.0.114:7447! deadline has elapsed
2024-11-08T13:09:34.968547Z  WARN ThreadId(01) zenoh::net::runtime::orchestrator: Unable to connect to any of [tcp/192.168.0.114:7447]!  at C:\Users\runneradmin\.cargo\git\checkouts\zenoh-cc237f2570fab813\23e9f62\zenoh\src\net\runtime\orchestrator.rs:365.
2024-11-08T13:09:34.969314Z  INFO ThreadId(01) zenoh::api::session: close session zid=2efe62de723c76df7e0c880ca1f38468
Traceback (most recent call last):
  File "C:\Users\18571\projects\zenoh-demo\z_pub.py", line 13, in <module>
    session = zenoh.open(cfg)
              ^^^^^^^^^^^^^^^
zenoh.ZError: Unable to connect to any of [tcp/192.168.0.114:7447]!  at C:\Users\runneradmin\.cargo\git\checkouts\zenoh-cc237f2570fab813\23e9f62\zenoh\src\net\runtime\orchestrator.rs:365.

But when I change 192.168.0.114 to localhost ,it works well ,and when i use linux router ,it works well too

To reproduce

  1. create pub.py
  2. create config.json5
  3. run zenohd.exe ( without config )
  4. run pub.py

System info

  • Platform: Windows 11
  • Router Version: 1.0.1
  • Python Client Version: 1.0.1
@WanderWang WanderWang added the bug Something isn't working label Nov 8, 2024
@WanderWang
Copy link
Author

seems that I must configure my config as:

listen: {
//default value tcp/[::]:7447 didn't work in windows    
endpoints: [
       "tcp/0.0.0.0:7447"
    ],
  },

@Mallets Mallets added invalid This doesn't seem right and removed bug Something isn't working labels Nov 15, 2024
@Mallets Mallets closed this as completed Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants