APAPE 0 Posted July 24 Hi I do not know, what's going wrong and why. Using the TIcsMqttClient component, it is not possible for me to send any payload. When I debug the code, i found out, that in procedure TCustomWSocket.TryToSend in line 7365 -> Count := RealSend(Data, Len); the return value (count) is always: -1 I am using V9 beta 3, but tried it also with 9.2 Thx for helping Share this post Link to post
Angus Robertson 572 Posted July 24 Have you tried building and testing the OverbyteIcsMQTTst sample? It contains both client and server components, to send to each other. There is a publish button, does it work? Sorry, I know little about MQTT, not used it for any of my own projects, this is a contributed component that I improved for SSL and the latest ICS,. The sample seems to work OK, but please let us know if it does not work as expected, it has not been tested against non-ICS clients or servers. Angus Share this post Link to post
APAPE 0 Posted July 25 No, I did not build / used the OverbyteIcsMQTTst sample. But now I did 🙂. With it I found out, that using the "https://test.mosquitto.org/" it can be connected, but the client (sample application) does not get "online". Regardless, which port I use (?). Then I tried "public.mqtthq.com". Here it connected and went online. But sending or receiving messages did not work for me. Then I tried "broker.emqx.io". Connection worked fine, but sending or receiving messages also did not work. Same with "mqtt.eclipseprojects.io". That was curios! After playing a little bit with the topic names for sending and receiving message, I found out, that these public MQTT Server accept all topics, but only send the messages when the topic is not longer than 14 characters. I did not find any hint for that behavior on there web sites. After rethinking about it, it's clear why. The reason why using Mosquitto does not let the sample application go online with the TIcsMQTTClient component / ICS Library, I have no idea. But yesterday I used only this MQTT broker and wondered why I could not send or receive any message. Thank's to the sample application, now it's clear why: not online. Hope, this helps others. Topic can be closed. Share this post Link to post
Angus Robertson 572 Posted July 25 As I said, I've never really looked at the MQTT protocol. Is it now working? Are there changes we should be making to the MQTT component or sample to make it work with other servers and clients? Angus Share this post Link to post
APAPE 0 Posted July 29 Yes, MQTT is working, as long as https://test.mosquitto.org/ is not used. It would be great if the ICS MQTT client would work with Mosquitto MQTT server also. Thx. Share this post Link to post
Angus Robertson 572 Posted July 29 Thanks, I'll test against Mosquitto MQTT server for the next release, and adapt the component if possible, but we don't always try to work with buggy or old servers. Angus Share this post Link to post
omnibrain 15 Posted August 1 As far as I know Mosquitto is the reference implementation for MQTT. Share this post Link to post