Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Truncated message when arduino sending version info:

Truncated message when arduino sending version info:

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 2 Posters 232 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Damian ChojnaD Offline
    Damian ChojnaD Offline
    Damian Chojna
    wrote on last edited by
    #1

    I check that in mMySensors arduino lib 2.3.2 on ArduinoMega

    Problem with the cut message when arduino send version info:

    0;255;0;0;17;2 /*!< Major release vers
    

    In Arduino/libraries/MySensors/core/Version.h, in MYSENSORS_LIBRARY_VERSION_MINOR is this cut off message. This makes mysensors in the home assistant not work.

    Line 58:

    #define MYSENSORS_LIBRARY_VERSION STR(MYSENSORS_LIBRARY_VERSION_MAJOR) "." STR(MYSENSORS_LIBRARY_VERSION_MINOR) "." STR(MYSENSORS_LIBRARY_VERSION_PATCH) //!< final release versioning
    

    When I replace it with, this work for me.

    MYSENSORS_LIBRARY_VERSION "2.3.2"
    

    Is this correct behavior ?

    Arduino Code:

    #define MY_GATEWAY_SERIAL
    #define MY_REPEATER_FEATURE
    #define MY_NODE_ID 0
    #include <SPI.h>
    #include <MySensors.h>
    #include <Bounce2.h>
    
    #define RELAY_PIN  5
    #define BUTTON_PIN  A0
    #define CHILD_ID 1
    #define RELAY_ON 1
    #define RELAY_OFF 0
    
    Bounce debouncer = Bounce();
    bool state = false;
    bool initialValueSent = false;
    
    MyMessage msg(CHILD_ID, V_STATUS);
    
    void setup()
    {
      pinMode(BUTTON_PIN, INPUT_PULLUP);
      debouncer.attach(BUTTON_PIN);
      debouncer.interval(10);
    
      // Make sure relays are off when starting up
      digitalWrite(RELAY_PIN, RELAY_OFF);
      pinMode(RELAY_PIN, OUTPUT);
    }
    
    void presentation()  {
      sendSketchInfo("Relay+button", "1.0");
      present(CHILD_ID, S_BINARY);
    }
    
    void loop()
    {
      if (!initialValueSent) {
        Serial.println("Sending initial value");
        send(msg.set(state?RELAY_ON:RELAY_OFF));
        Serial.println("Requesting initial value from controller");
        request(CHILD_ID, V_STATUS);
        wait(2000, C_SET, V_STATUS);
      }
      if (debouncer.update()) {
        if (debouncer.read()==LOW) {
          state = !state;
          // Send new state and request ack back
          send(msg.set(state?RELAY_ON:RELAY_OFF), true);
        }
      }
    }
    
    void receive(const MyMessage &message) {
      if (message.isAck()) {
         Serial.println("This is an ack from gateway");
      }
    
      if (message.type == V_STATUS) {
        if (!initialValueSent) {
          Serial.println("Receiving initial value from controller");
          initialValueSent = true;
        }
        // Change relay state
        state = (bool)message.getInt();
        digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
        send(msg.set(state?RELAY_ON:RELAY_OFF));
      }
    }
    

    Serial Output:

    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;17;2 /*!< Major release vers
    0;255;3;0;11;Relay+button
    0;255;3;0;12;1.0
    0;1;0;0;3;
    
    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      Cross-reference: https://github.com/mysensors/MySensors/issues/1389

      1 Reply Last reply
      0

      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
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      9

      Online

      12.1k

      Users

      11.2k

      Topics

      113.4k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular