So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By GeoffState
#65411 I am using AsyncMqttClient and have a String payloadStr which ends up containing a two-word sentence e.g. "Open Open". I have spent several days trying to cast this into payload but have not asked the correct question of Google. I know
mqttClient.publish(MQTT_FEEDBACK_TOPIC, 0, true, "Open Open")

works and is processed by Node-Red correctly but
mqttClient.publish(MQTT_FEEDBACK_TOPIC, 0, true, payloadStr)

(plus many variations I have tried) returns an exit status
no matching function for call to 'AsyncMqttClient::publish(const char [19], int, bool, String&)
which I can't interpret. I understand payload.length computes itself when a string is passed so I have omitted this.