MQTT_connect

For general Flowcode discussion that does not belong in the other sections.
Post Reply
d820513
Posts: 56
http://meble-kuchenne.info.pl
Joined: Thu Aug 19, 2021 1:14 pm
Has thanked: 2 times
Been thanked: 1 time

MQTT_connect

Post by d820513 »

Hi guys !
I can't connect to MQTT broker. What am I doing wrong ?
Attachments
MQTT_client.fcfx
(16.16 KiB) Downloaded 152 times

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: MQTT_connect

Post 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.

d820513
Posts: 56
Joined: Thu Aug 19, 2021 1:14 pm
Has thanked: 2 times
Been thanked: 1 time

Re: MQTT_connect

Post 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?

d820513
Posts: 56
Joined: Thu Aug 19, 2021 1:14 pm
Has thanked: 2 times
Been thanked: 1 time

Re: MQTT_connect

Post by d820513 »

host: broker.hivemq.com

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: MQTT_connect

Post 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 175 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.

george_b
Posts: 18
Joined: Fri Jul 01, 2022 5:00 pm
Has thanked: 9 times
Been thanked: 2 times

Re: MQTT_connect

Post 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!

Post Reply