簡體   English   中英

MQTT Eclipse Paho C++ 僅在 OpenWRT 上出現超時錯誤

[英]MQTT Eclipse Paho C++ getting timeout error only on OpenWRT

我正在嘗試將一個簡單的 C++ 程序移植到 OpenWRT,該程序使用 Eclipse Paho ZF6F87C9FDCF8B3C3F07F93F1EE871 從 Modbus 讀取數據並通過 MQTT 發布。 我已經在我的電腦上測試了這個程序,它(一如既往)工作正常。

在 OpenWRT 上,我為 Paho C 和 C++ 創建了 Makefile,並使用我的二進制文件成功生成了圖像。 問題是當我啟動它時出現超時錯誤:

Mon Jan 24 09:38:39 2022 daemon.info modbus-gateway[2274]: Using tcp://192.168.100.99:1884 as broker and /dev/ttyS1 as serial port.
Mon Jan 24 09:38:39 2022 daemon.info modbus-gateway[2274]: Waiting for the connection...
Mon Jan 24 09:38:40 2022 daemon.err modbus-gateway[2274]: An error occurred while publishing the connection message!
Mon Jan 24 09:38:40 2022 daemon.err modbus-gateway[2274]: Code: 145
Mon Jan 24 09:38:40 2022 daemon.err modbus-gateway[2274]: Description: An error occurred while sending the connection message! Operation timed out

我嘗試為 Paho C 啟用更多跟蹤,但它並沒有太大幫助(至少我看不出錯誤出在哪里)。 我也可以從 OpenWRT ping 機器,telnet 似乎表明端口 1884 是打開的。

對不起,但事實證明只是我愚蠢並被錯誤消息中的錯誤復制粘貼趕走了。 該錯誤發生在從串行端口讀取期間,因此問題不是 Paho。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM