[SOLVED] msg.getBool() issue related to string length
-
Playing around with my RGB controller, the module sometimes gets in a state in which i can not power off the lights.
After sending a number of V_RGB message i'm sending a V_STATUS message with payload "0" which is not correct decoded by getBool()
This is the logging:
read: 0-0-9 s=1,c=1,t=2,pt=0,l=1,sg=0:0 send: 9-9-0-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0 Message: 2 Payload: getBool: 1 getString: 01EBC6D600r getInt: 1 getByte: 1Generated by this peace of code
Serial.print("Message: "); Serial.println(message.type); Serial.println("Payload: "); Serial.print(" getBool: "); Serial.println(message.getBool()); Serial.print(" getString: "); Serial.println(message.getString()); Serial.print(" getInt: "); Serial.println(message.getInt()); Serial.print(" getByte: "); Serial.println(message.getByte());It look that the payload length is not correctly used when decoding the message but correctly is displayed in the debug string
I'm using MySensors version 1.5.3 -
Playing around with my RGB controller, the module sometimes gets in a state in which i can not power off the lights.
After sending a number of V_RGB message i'm sending a V_STATUS message with payload "0" which is not correct decoded by getBool()
This is the logging:
read: 0-0-9 s=1,c=1,t=2,pt=0,l=1,sg=0:0 send: 9-9-0-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0 Message: 2 Payload: getBool: 1 getString: 01EBC6D600r getInt: 1 getByte: 1Generated by this peace of code
Serial.print("Message: "); Serial.println(message.type); Serial.println("Payload: "); Serial.print(" getBool: "); Serial.println(message.getBool()); Serial.print(" getString: "); Serial.println(message.getString()); Serial.print(" getInt: "); Serial.println(message.getInt()); Serial.print(" getByte: "); Serial.println(message.getByte());It look that the payload length is not correctly used when decoding the message but correctly is displayed in the debug string
I'm using MySensors version 1.5.3 -
Could you test the same on 1.5.4?
https://github.com/mysensors/Arduino/releases/tag/1.5.4We had a regression that recently was fixed by @Anticimex .
Edit: Damn, I didn't scroll down all the way to @Yveaux answer.. ;)
-
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