尝试与MQTT + Tasmota连接时拒绝连接

时间:2020-01-23 13:10:47

标签: mqtt mosquitto

我已经对此进行了谷歌搜索,并且在将问题发布到这里之前,我确实尽力解决了该问题。

系统:Raspberry Pi B +(最新Raspbian),Wifi

问题: 当我尝试运行此命令时: mosquitto_pub -h 192.168.1.121 -t cmnd / DVES_1A6953_fb / cmnd / Power1 -m off 我收到“错误:连接被拒绝”

我所知道的: Mosquitto已安装在192.168.1.100(RPi)上 Sonoff基本战俘位于192.168.1.121 我已经尝试过使用mosquitto -d。 sudo systemctl启用mosquitto.service。

mosquitto -v给我: 1579784576:mosquitto版本1.5.7开始 1579784576:使用默认配置。 1579784576:在端口1883上打开ipv4侦听套接字。 1579784576:错误:地址已在使用中

Snoff Basic Pow with Tasmota configuration

Sonof Basic Pow console shows this:

我真的不知道现在该怎么办:)

希望你能帮助我!

/奥斯卡

1 个答案:

答案 0 :(得分:3)

您正尝试直接发布到设备(192.168.1.121),而不发布到代理(192.168.1.100)

您需要将消息发送到代理,代理将把它们转发到设备(假设它已订阅正确的主题)

mosquitto_pub -h 192.168.1.100 -t cmnd/DVES_1A6953_fb/cmnd/Power1 -m off