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

[Bug] Zenoh uses the MQTT plugin as a server, but it cannot connect to port 1883 normally. #310

Open
blank-1 opened this issue Jan 23, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@blank-1
Copy link

blank-1 commented Jan 23, 2025

Describe the bug

Zenoh uses the MQTT plugin as a server, but it cannot connect to port 1883 normally.

Image

Image

Image

To reproduce

2025-01-23T08:11:04.540764139Z 2025-01-23T08:11:04.540550Z  INFO main ThreadId(01) zenohd: zenohd v1.1.1 built with rustc 1.75.0 (82e1608df 2023-12-21)
2025-01-23T08:11:04.541059430Z 2025-01-23T08:11:04.540894Z  INFO main ThreadId(01) zenohd: Initial conf: {"access_control":{"default_permission":"deny","enabled":false,"policies":null,"rules":null,"subjects":null},"adminspace":{"enabled":true,"permissions":{"read":true,"write":false}},"aggregation":{"publishers":[],"subscribers":[]},"connect":{"endpoints":["tcp/[::]:7447","tcp/[::]:1883"],"exit_on_failure":null,"retry":null,"timeout_ms":null},"downsampling":[],"id":"b9a6660ca2e315a6af6a6aa78ecad45f","listen":{"endpoints":["tcp/[::]:7447","tcp/[::]:1883"],"exit_on_failure":null,"retry":null,"timeout_ms":null},"metadata":null,"mode":"router","open":{"return_conditions":{"connect_scouted":null,"declares":null}},"plugins":{"mqtt":{"auth":{"dictionary_file":"/etc/zenoh/mqtt-pwfile"},"port":"0.0.0.0:1883"}},"plugins_loading":{"enabled":true,"search_dirs":[{"kind":"current_exe_parent","value":null},".","~/.zenoh/lib","/opt/homebrew/lib","/usr/local/lib","/usr/lib"]},"qos":{"publication":[]},"queries_default_timeout":null,"routing":{"interests":{"timeout":null},"peer":{"mode":null},"router":{"peers_failover_brokering":null}},"scouting":{"delay":null,"gossip":{"autoconnect":null,"enabled":null,"multihop":null,"target":null},"multicast":{"address":null,"autoconnect":null,"enabled":true,"interface":null,"listen":null,"ttl":null},"timeout":null},"timestamping":{"drop_future_timestamp":null,"enabled":null},"transport":{"auth":{"pubkey":{"key_size":null,"known_keys_file":null,"private_key_file":null,"private_key_pem":null,"public_key_file":null,"public_key_pem":null},"usrpwd":{"dictionary_file":null,"password":null,"user":null}},"link":{"protocols":null,"rx":{"buffer_size":65535,"max_message_size":1073741824},"tcp":{"so_rcvbuf":null,"so_sndbuf":null},"tls":{"close_link_on_expiration":null,"connect_certificate":null,"connect_private_key":null,"enable_mtls":null,"listen_certificate":null,"listen_private_key":null,"root_ca_certificate":null,"so_rcvbuf":null,"so_sndbuf":null,"verify_name_on_connect":null},"tx":{"batch_size":65535,"keep_alive":4,"lease":10000,"queue":{"batching":{"enabled":true,"time_limit":1},"congestion_control":{"block":{"wait_before_close":5000000},"drop":{"max_wait_before_drop_fragments":50000,"wait_before_drop":1000}},"size":{"background":1,"control":1,"data":4,"data_high":2,"data_low":2,"interactive_high":1,"interactive_low":1,"real_time":1}},"sequence_number_resolution":"32bit","threads":5},"unixpipe":{"file_access_mask":null}},"multicast":{"compression":{"enabled":false},"join_interval":2500,"max_sessions":1000,"qos":{"enabled":false}},"shared_memory":{"enabled":true},"unicast":{"accept_pending":100,"accept_timeout":10000,"compression":{"enabled":false},"lowlatency":false,"max_links":1,"max_sessions":1000,"open_timeout":10000,"qos":{"enabled":true}}}}
2025-01-23T08:11:04.541128380Z 2025-01-23T08:11:04.541060Z  INFO main ThreadId(01) zenoh::net::runtime: Using ZID: b9a6660ca2e315a6af6a6aa78ecad45f
2025-01-23T08:11:04.541299126Z 2025-01-23T08:11:04.541219Z  INFO main ThreadId(01) zenoh::api::loader: Loading  plugin "mqtt"
2025-01-23T08:11:04.543176600Z 2025-01-23T08:11:04.542993Z  INFO main ThreadId(01) zenoh::api::loader: Starting  plugin "mqtt"
2025-01-23T08:11:04.543415747Z 2025-01-23T08:11:04.543298Z  INFO main ThreadId(01) zenoh::api::loader: Successfully started plugin mqtt from "/usr/lib/libzenoh_plugin_mqtt.so"
2025-01-23T08:11:04.543434182Z 2025-01-23T08:11:04.543331Z  INFO main ThreadId(01) zenoh::api::loader: Finished loading plugins
2025-01-23T08:11:04.544688244Z 2025-01-23T08:11:04.544416Z  INFO main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/172.21.0.2:1883
2025-01-23T08:11:04.544717533Z 2025-01-23T08:11:04.544448Z  INFO main ThreadId(01) zenoh::net::runtime::orchestrator: Zenoh can be reached at: tcp/172.21.0.2:7447
2025-01-23T08:11:04.544724323Z 2025-01-23T08:11:04.544508Z  INFO main ThreadId(01) zenoh::net::runtime::orchestrator: zenohd listening scout messages on 224.0.0.224:7446

zenoh.config5

/**
 * Configuration file for the Eclipse zenoh router (service "zenohd").
 *
 * This file presents only the main settings. For a complete example of configuration file,
 * see https://github.com/eclipse-zenoh/zenoh/blob/master/EXAMPLE_CONFIG.json5
 */
{
  /**
   * The identifier (as hex-string) that zenohd must use.
   * If not set, a random unsigned 128bit integer will be used.
   * WARNING: this id must be unique in your zenoh network.
   */
  // id: "123456789ABCDEF",

  /**
   * Which endpoints to listen on. E.g. tcp/localhost:7447.
   * By configuring the endpoints, it is possible to tell zenoh which are the endpoints that other routers,
   * peers, or client can use to establish a zenoh session.
   * If none are specified, "tcp/[::]:7447" will be used (i.e. any interface)
   */
  listen: {
    endpoints: [
      // "<proto>/<address>"
      "tcp/[::]:7447",
      "tcp/[::]:1883"
    ],
  },

  /**
   * Which endpoints to connect to. E.g. tcp/localhost:7447.
   * By configuring the endpoints, it is possible to tell zenoh which router/peer to connect to at startup.
   */
  connect: {
    endpoints: [
      // "<proto>/<address>"
      "tcp/[::]:7447",
      "tcp/[::]:1883"
    ],
  },

  /**
   * Configuration of the scouting protocol (for discovery of other routers, peers or clients)
   * Uncoment to change the default values.
   */
  // scouting: {
  //   /* How multicast should behave */
  //   multicast: {
  //     /* Whether multicast scouting is enabled or not */
  //     enabled: true,
  //     /* The socket which should be used for multicast scouting */
  //     address: "224.0.0.224:7446",
  //     /* The network interface which should be used for multicast scouting */
  //     interface: "auto", // auto selection of interface
  //     /**
  //      * An autoconnection mask (accepted values are bit-or-like combinations of peer, router and client).
  //      * If the configured instance's mode intersects with this field, zenoh will automatically establish a connection with other nodes discovered through this method of scouting.
  //      */
  //     autoconnect: "peer|client",
  //   },
  // },

  /**
   * Directories where plugins configured by name should be looked for.
   * Plugins configured by __path__ are not subject to lookup
   */
//  plugins_search_dirs: ["/usr/lib"],

  plugins: {
    /**
     * REST plugin configuration. Uncomment to activate it.
     */
    // rest: {
    //   /* Setting this option to true allows zenohd to panic should it detect issues with this plugin.
    //    * Setting it to false politely asks the plugin not to panic. */
    //   __required__: true,
    //   http_port: 8000,
    // },
    /**
     * Storages plugin configuration . Uncomment to activate it and configure backends/storages
     */
    // storages: {
    //   /* Storages are grouped by backend, which may implement the storage function in various ways. */
    //   backends: {
    //     /* The memory backend is always available, and stores values in RAM. */
    //     memory: {
    //       /* Each backend may manage several storages */
    //       storages: {
    //         /* Each storage must be named */
    //         demo: {
    //           key_expr: "demo/example/**",
    //         },
    //       },
    //     },
    //   },
    // },
    mqtt: {
      ////
      //// port: The address to bind the MQTT server. Default: "0.0.0.0:1883". Accepted values:'
      ////       - a port number ("0.0.0.0" will be used as IP to bind, meaning any interface of the host)
      ////       - a string with format `<local_ip>:<port_number>` (to bind the MQTT server to a specific interface).
      ////
      port: "0.0.0.0:1883",
      ////
      //// MQTT client authentication related configuration.
      ////
      auth: {
        ////
        //// dictionary_file: Path to a file containing the MQTT client username/password dictionary.
        ////
        dictionary_file: "/etc/zenoh/mqtt-pwfile"
      }
    }
  },
}

System info

platform:ubuntu 22.04 64bit
zenoh version:1.1.1-amd64

@blank-1 blank-1 added the bug Something isn't working label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant