【问题标题】:Mosquitto client not connecting with LAN ipMosquitto 客户端未连接 LAN ip
【发布时间】:2021-10-15 03:06:43
【问题描述】:

我被这个难住了。

我有一个 OpenSprinkler3.0 控制器,它将向 MQTT 代理报告。我有一台安装了 homeassistant 和 Mosquitto 代理的 RPi4。我有一个单独的 RPiZero,安装了 Raspbian 和 Mosquitto 1.5.7。我有一个域 (mqtt.example.com) 指向我的路由器,端口 1883 转发到 RPiZero 上的 1883。

这是 RPiZero 配置

pid_file /var/run/mosquitto.pid

listener 1883

protocol mqtt
persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d

allow_anonymous true
password_file /etc/mosquitto/passwordfile

connection homeassistant
address mqtt.example.com:8883
bridge_cafile /etc/ssl/certs/ISRG_Root_X1.pem
#topic # out 0
#topic # in 0
topic # both 0
remote_username xxxxxx
remote_password xxxxxx

如果我为 RPiZero 使用 WAN 地址 (mqtt.example.com:1883),Open Sprinkler 会连接并向代理发送消息,没问题。

但是使用 LAN IP 地址 (192.168.1.51:1883),它不起作用。这是奇怪的事情。如果我为运行 homeassistant (192.168.1.50:1883) 的 RPi4 代理输入 LAN IP,它会连接到该代理并且工作正常。

我已经尝试过 Android 和 Windows MQTT 客户端,它们都可以使用 WAN 和 LAN 地址很好地连接到这两个代理。因此,无论出于何种原因,OpenSprinkler 都可以使用 MQTT 代理连接到一个 RPi,但不能连接到另一个。其他客户没有同样的问题。有什么想法吗?

谢谢, 赛斯

【问题讨论】:

  • Edit 包含 mosquitto 版本信息和 Pi Zero 上代理的配置详细信息的问题

标签: raspberry-pi mqtt mosquitto


【解决方案1】:

原来重启路由器解决了这个问题。其他一些设备表现得很奇怪,导致我重新启动。 Google WIFI 不是我最近最喜欢的产品...

谢谢!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    • 1970-01-01
    • 2014-06-11
    相关资源
    最近更新 更多