Description
When sending MQTT binary messages with function mqttPublishBinaryMsg, which is taking the binary message buffer to be sent and it's size. There is a problem however with this function. When function internally calls sendCommand with the binary message, it does not pass the length of the buffer and the sendCommand function assumes it to be a null terminated string. This seems to be because it will call hwPrint, which in turn also uses print()
function of the serial, which for the binary data should be write() instead with the buffer and it's size given to it.
With this problem I'm not able to send raw binary data over MQTT that has 0x00 values in it. When fixing the code and using the Serial.write(buf, length)
instead. I'm able to send raw MQTT binary message.