[SOLVED] msg.getBool() issue related to string length


  • Contest Winner

    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: 1
    

    Generated 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


  • Mod

    @BartE Update to 1.5.4. This is why 1.5.4 was released today 😉


  • Admin

    Could you test the same on 1.5.4?
    https://github.com/mysensors/Arduino/releases/tag/1.5.4

    We had a regression that recently was fixed by @Anticimex .

    Edit: Damn, I didn't scroll down all the way to @Yveaux answer.. 😉


  • Contest Winner

    @Yveaux and @hek bingo! That line in v 1.5.4 does solve the issue.
    Thx a lot for the support.

    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: 0
      getString: 0
      getInt: 0
      getByte: 0
    OFF: Switch colors off
    

Log in to reply
 

Suggested Topics

  • 33
  • 5
  • 17
  • 9
  • 6
  • 2

18
Online

11.2k
Users

11.1k
Topics

112.5k
Posts