|MQTT - NO Socket issue [message #1834163]
||Wed, 04 November 2020 07:11
| Pradeep Patel
Registered: October 2020
I am new to MQTT and trying to use MQTT communication over Ethernet (TCP) interface.|
I have downloaded MQTT Paho code from the link provided in 4Diac documentation website. I build it using CMake tool (MinGW compiler) for windows. I got some compilation errors for files in test folder - test1.c, test2.c, test3.c....etc. The error was "sys/socket.h" not found. As i was building for windows i added "#define _WINDOWS 1" at the top of these files to avoid this error. Then i could successfully build MQTT library file libpaho-mqtt3a.dll and libpaho-mqtt3c.dll. Thereafter i rebuild forte including path of these .dll files.
Now I am using blink program as attached to test. Execution of blinking and counting part are both on localhost connected to each other using Publish and Subscribe FBs as shown in the attachment. But when i put ID of Publish as "raw.mqtt[tcp://192.168.225.180:1883, forte, output]" and ID of Subscribe as "raw.mqtt[tcp://192.168.225.180:1883, forte, input]", the STATUS output of Publish FB shows "NO SOCKET" and STATUS output of Subscribe FB shows "TERMINATED".
I am using Mosquitto as MQTT broker running at background on windows OS.
I also tried to replace IP address in IDs with "localhost" but problem remains.
I doubt if my .dll files are good. Is there any location where i can get already built .dll files. Please guide in debugging the issue.
[Updated on: Wed, 04 November 2020 07:12]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02598 seconds