Issue with Publishing and Subscribing in MQTT
-
[link text](link url)Hello everyone,
I'm facing issues with both subscription and publishing in MQTT. When publishing, it does not allow me to send alphanumeric values. If I use a numeric string and then convert it to an integer, it works correctly, as shown in the following example:
MQTT publish topic "coreS3/state", "5", Qos 1
However, when I try to publish any variable, whether numeric or text, the system simply ignores the command without displaying errors. For example:
MQTT publish topic "coreS3/state", numeric or text variable, Qos 1
If instead of a variable I use a fixed string, the command executes without issues.
I have spent a lot of time trying to solve this, but I haven't found a clear answer. Has anyone faced a similar issue or has any suggestions on how to fix it?
I appreciate any help you can provide.

[C:\Users\faria\Downloads\MQTT_Relay_S3_BAD.m5f2]
-
Hello @Robertof
hmm, using variables in MQTT publish works for me.
How are you testing your code? Make sure your test software uses a different MQTT client id than your UIFlow2 code, else the first registered client gets kicked out.
BTW: my example is in the Project Zone, named M5CoreS3_MQTT_4Relay_UIFlow2.2.5
Thanks
Felix -
@felmue Hello , Your code worked perfectly. I really appreciate the time and effort you put into helping me—it means a lot! Thank you!
Roberto
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login