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. General Discussion
  3. KeepAlive to Gateway

KeepAlive to Gateway

Scheduled Pinned Locked Moved General Discussion
5 Posts 2 Posters 2.3k Views 1 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.
  • clippermiamiC Offline
    clippermiamiC Offline
    clippermiami
    Hero Member
    wrote on last edited by clippermiami
    #1

    I'm looking for a way to do a "KeepAlive" as a way to get a time update on the Vera display so i know the sensors are working. Is it permissible to send gw.sendsketchInfo( ... etc ...) every 30 minutes or so if there is no change in any of the sensor data?

    ....
    Example:

    // Initialize
    int RADIO_CYCLE = 0; // Start the cycle counter
    int KEEP_ALIVE = 30; // number of empty radio cycles
    
    [ ... Processes ... ]
    
    if (RADIO_CYCLE >= KEEP_ALIVE)  
       {
       gw.sendSketchInfo("Combo THL", "1.01B (20140711)");    // just resend sketch info as a keep alive
       Serial.println("KA");
       RADIO_CYCLE = 0;  // reset the counter
       }
    
    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      I don't think the sent sketch info updates LAST_UPDATE field. Use VAR_1 if you don't have a real sensor value to send in.

      1 Reply Last reply
      0
      • clippermiamiC Offline
        clippermiamiC Offline
        clippermiami
        Hero Member
        wrote on last edited by
        #3

        Thanks

        John

        1 Reply Last reply
        0
        • clippermiamiC Offline
          clippermiamiC Offline
          clippermiami
          Hero Member
          wrote on last edited by
          #4

          So I can do this then to get an empty VAR1 sent to the Gateway?

             #define CHILD_ID_EMPTY 9
          
             [ .... Processes ...]
          
             Serial.print("C: ");
             Serial.println(RADIO_CYCLE); 
             if (RADIO_CYCLE >= KEEP_ALIVE)  // force update of last values if the counter is maxed
                  {
                  gw.sendVariable(CHILD_ID_EMPTY, V_VAR1, 1); // just send VAR1 to update the last update time 20140713
                  Serial.println("KA");
                  RADIO_CYCLE = 0;  // reset the counter
                  }
          

          I have run into a problem though. I compiled this and uploaded it to another Pro Mini and when I tried to include it in Vera I got three devices (Light, Temp, Humidity) but NO NODE device. I tried this several times to be sure, each time I ran the ClearEEPROM sketch to erase the Mini. I don't see how any of this would cause that to happen though.

          Just in case this was causing a problem I commented the CHILD_ID_EMPTY and associated bits but it made no difference.

          The "setup()" hasn't changed:

              void setup() 
                  {
                  // Send the Sketch Version Information to the Gateway
                  gw.begin();
                  dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
          
                  gw.sendSketchInfo("Combo THL", "1.01C (20140713)");
          
                 // Register all sensors to gw (they will be created as child devices)
                 gw.sendSensorPresentation(CHILD_ID_HUM, S_HUM);
                 gw.sendSensorPresentation(CHILD_ID_TEMP, S_TEMP);
                 gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
          
                 metric = gw.isMetricSystem();
          
                 }
          

          Is it possible I have to reinitialize the Gateway for some reason?

          Thanks

          John

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            @clippermiami said:

            Is it possible I have to reinitialize the Gateway for some reason?

            No, you shouldn't need to reinitialize gateway in any way.

            Can you see the presentation message for the node device in Vera logs?
            Did you try restarting Vera to reveal any hidden devices (has happened before)?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            12

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            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