Mqtt node arranging the desired message with the payload

Hi, I'm trying to send a setpoint via mqtt over a esp8266 to an inverter. The message should be inverter/ctrl/limit/0 with a payload giving the setpoint. The payload could be from 2 to 100% (one could also leave out the adjancent %) or from 0-1500W. That leaves me unsure about the type of the message or the variable I connect to the mqtt node. Should it be a string or a number? Or does it make no difference? The Topic can be edited in the mqtt node as well as in the inject node. I suppose the one in the mqtt node is the one thats relevant. OK, if tryed this out, the message is fired and I can see it in my mosquitto_sub console. Nevertheless the Inverter does not understand this message saying that that a frame is missing:

16:34:16 I: (#0) enqueCommand: 0x0b
16:34:16 I: (#0) prepareDevInformCmd 0x0b
16:34:16 15 pid: 80
*16:34:16 I: TX 27B Ch40 | 15 83 12 88 54 86 28 43 35 80 0b 00 64 60 f1 68 00 00 00 07 00 00 00 00 80 00 11 *
16:34:16 W: (#0) Frame 1 missing: Request Retransmit
16:34:16 15 pid: 81
*16:34:16 I: TX 11B Ch61 | 15 83 12 88 54 86 28 43 35 81 01 *
16:34:16 W: (#0) Frame 1 missing: Request Retransmit

Message is tried several times as configured. See answer script.
Before I updated the esp8266 board (Ahoy DTU) to versin 0.6.9 I sent the message using the Topic

inverter/ctrl/limit_persistent_absolute/0" -m "40

as the persistent_absolut is nomore used the message shortened to


Next question: What is " -m"40 good for. As I didn't know I left this out. I found no explanation for those "parameter".
But this old message worked somehow! Jet I can't get the new message together.

How exactly were you sending that? I am sure that is not a valid topic. However, if you were using mosquitto_pub to test it then the command
mosquitto_pub "inverter/ctrl/limit_persistent_absolute/0" -m "40"

would sent the string value "40" to the topic inverter/ctrl/limit_persistent_absolute/0
The -m option for mosquitto_sub is followed by the value to send.

If that is what you meant then the value in msg.payload should be a string containing 40.

Hi, thank you for your answer. It is working now, after flashing the ESP8266 newly. I must have been something else, concerning the binary. Know I can publish


with the desired payload and the inverter understands. Again I was only confused.

Could you explain, what "retain" means and what purpose that has. Thank you very much!

As I understand it, if you publish to a topic with retain ticked and the subscriber is offline, the MQTT broker will retain the message and deliver it when the subscriber reconnects.

Retained messages can hang around on the broker with increasingly stale data and cause puzzling behaviour later on. Best not to use this feature unless you really need it.

This great tutorial on MQTT will tell you all you need to know. MQTT Essentials - All Core Concepts explained

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.