Page 1 of 1

MQTT_connect

Posted: Mon May 23, 2022 2:35 pm
by d820513
Hi guys !
I can't connect to MQTT broker. What am I doing wrong ?

Re: MQTT_connect

Posted: Mon May 23, 2022 2:53 pm
by BenR
Hello,

The Host URL is longer than 50 characters, maybe try upping the MQTT Client - Host Max Length property to 100?

Also is the username and password of "test" correct?

Finally port 8883 is for encrypted communications which Flowcode doesn't currently support, might be better to try port 1883 which is the unencrypted version.

Re: MQTT_connect

Posted: Mon May 23, 2022 4:16 pm
by d820513
password and username fictitious.
Hostbroker.hivemq.com. I tried port 1883, it still won't connect. Am I wrong in the macro component?

Re: MQTT_connect

Posted: Mon May 23, 2022 4:17 pm
by d820513
host: broker.hivemq.com

Re: MQTT_connect

Posted: Mon May 23, 2022 5:11 pm
by BenR
Hello,

The MQTT component should be connected to a Network comms component, which then connects to the WLAN ESP component. This could be what's causing your problems. The icons should match up.

MQTT_client.fcfx
(16.94 KiB) Downloaded 183 times
If you don't have a username and password maybe try setting Authentication to none.


Some examples here if you're still having problems with publishing and subscribing.
https://www.flowcode.co.uk/wiki/index.p ... IoT/Cloud)
https://www.youtube.com/watch?v=5NFsJTPZKH8

Might also be worth trying to connect via a MQTT app on your phone and see if that can connect ok. Might help you to troubleshoot the various settings.

Re: MQTT_connect

Posted: Wed Dec 06, 2023 9:57 pm
by george_b
BenR wrote:
Mon May 23, 2022 2:53 pm
Hello,

The Host URL is longer than 50 characters, maybe try upping the MQTT Client - Host Max Length property to 100?

Hi Ben,

Could you please expain how to change the max length of the IOT component for more characters?

mine looks like this "pub-c-6a38f739-6472-425a-a522-e5ec55e3e06a/sub-c-2a445fc0-405d-11ac-b2c1-a25c7fcd9558/Client1"

Thanks in advance
George!