Hi all,
I'm playing with LCD screen. I want to display in my LCD a string from my mqtt broker.
Ex:
OpenHAB --> MQTT Broker --> MQTT Gateway --> LCD (directly connected on gateway)
I can send a message Ex: "TEST_LCD_1_MIKA_COOL":
Result:
0;0;3;0;9;Message arrived on topic: mygateway1-in/0/3/1/V_TEXT/47
Incoming msg DATA: TEST_LCD_1_MIKA_COOL
but when I send a shorter message Ex: "TEST_LCD_2_SUPER"
0;0;3;0;9;Message arrived on topic: mygateway1-in/0/3/1/V_TEXT/47
Incoming msg DATA: TEST_LCD_2_SUPERCOOL
We can see that message.getString is false. It adds the end of the last string on this new string.
buffer not empty ?
My conf:
void receive(const MyMessage &message) {
// We only expect one type of message from controller. But we better check anyway.
if (message.type==V_TEXT && message.sensor == LCD_CHILD) {
lcd.clear();
Serial.print("Incoming msg DATA: ");
lcd.print("Incoming msg DATA: ");
lcd.setCursor ( 0, 1 );
Serial.println(message.getString());
lcd.print(message.getString());
}
}
can you help me please ?
Thanks in advance