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. Confirming node connected to gateway.

Confirming node connected to gateway.

Scheduled Pinned Locked Moved General Discussion
5 Posts 3 Posters 608 Views 3 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.
  • skywatchS Offline
    skywatchS Offline
    skywatch
    wrote on last edited by
    #1

    I was thinking of adding something to nodes so that when I reboot them I can see at the node if it has connected to the GW or not. Maybe a message on a small oled to confirm successful registration.

    What would be the most reliable way to do this?
    Can I get some value back from presentation stage?
    Is there anything better to do (like get confirmation from the controller)?

    Maybe I missed the obvious here, but it's late and I have a cold.

    FotoFieberF 1 Reply Last reply
    0
    • skywatchS skywatch

      I was thinking of adding something to nodes so that when I reboot them I can see at the node if it has connected to the GW or not. Maybe a message on a small oled to confirm successful registration.

      What would be the most reliable way to do this?
      Can I get some value back from presentation stage?
      Is there anything better to do (like get confirmation from the controller)?

      Maybe I missed the obvious here, but it's late and I have a cold.

      FotoFieberF Offline
      FotoFieberF Offline
      FotoFieber
      Hardware Contributor
      wrote on last edited by
      #2

      @skywatch
      I look for messages (e.g. presentation) at the gateway to diagnose connections at bootup. And I have a flow in node-red, which shows me, when a node didn't send for some time.

      You could use a led and blink codes on the node, if you really need a local indicator. A OLED would be a no go with battery powered sensors.

      1 Reply Last reply
      0
      • skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #3

        Thanks for the reply.

        I really just need 'something' at the node so that when I power it on I know that it has successfully established communication with the gateway.

        On mains powered units it could be a message on a display, on battery units it could be number of flashes of an led.

        I do not know 'how' I can do this. Is there some response at the node that I can monitor/interrogate to find out if successful connection has been made with a remote gateway?

        1 Reply Last reply
        0
        • alowhumA Offline
          alowhumA Offline
          alowhum
          Plugin Developer
          wrote on last edited by alowhum
          #4

          Here's an example from some of my code, specifically the SETUP function.

          void setup() {
            Serial.begin(115200); // for serial debugging over USB.
          
            if(isTransportReady()){
              Serial.println(F("Connected to gateway!"));
            }else{
              Serial.println(F("! NOT CONNECTED TO GATEWAY"));  
            }
          
          #ifdef HAS_DISPLAY
            mySerial.begin(115200);
            wait(1500);
            mySerial.print(F("CLR(0);"));
            mySerial.print(F("SBC(0);"));
            
            if(isTransportReady()){
              mySerial.print(F("DCV16(115,1,w,0);"));
            }
          
            // Labels
            mySerial.print(F("DCV16(10,155,Barometer,5);"));  // Barometer label
          
            // Wait icon
            mySerial.print(F("CIRF(120,239,35,3);"));       // Circle as a background
            //mySerial.print(F("SBC(3);"));
            //mySerial.print(F("DCV16(105,230,wait,15);"));     // Show while the forecast is not available yet.
            //mySerial.println(F("SBC(0);"));
          
            wait(400);
          #endif
          
            if(!bme280.init()){
              Serial.println(F("! Sensor error"));
          #ifdef HAS_DISPLAY
              mySerial.println(F("DCV16(10,250,Sensor error,1);"));
          #endif
            }
          
            wdt_enable(WDTO_2S);                              // Starts the watchdog timer. If it is not reset once every 2 seconds, then the entire device will automatically restart.                                
          }
          

          Personally I then display a "w" icon in the top-right of the screen if a connection has been made.

          In the loop code it requests an ACK whenever it updates the sensor values to the gateway (once a minute). There is also a simple incrementing counter byte that increases by 1 every time there is no reply. As soon as this reaches 5 (meaning no response from the server for 5 minutes in a row) it prints an " " to the corner of the screen, to indicate the loss of connection.

          If data once again arrives in the receive function, then a "w" is once again printed to the top right corner, and the incrementing byte is set back to 0.

          skywatchS 1 Reply Last reply
          2
          • alowhumA alowhum

            Here's an example from some of my code, specifically the SETUP function.

            void setup() {
              Serial.begin(115200); // for serial debugging over USB.
            
              if(isTransportReady()){
                Serial.println(F("Connected to gateway!"));
              }else{
                Serial.println(F("! NOT CONNECTED TO GATEWAY"));  
              }
            
            #ifdef HAS_DISPLAY
              mySerial.begin(115200);
              wait(1500);
              mySerial.print(F("CLR(0);"));
              mySerial.print(F("SBC(0);"));
              
              if(isTransportReady()){
                mySerial.print(F("DCV16(115,1,w,0);"));
              }
            
              // Labels
              mySerial.print(F("DCV16(10,155,Barometer,5);"));  // Barometer label
            
              // Wait icon
              mySerial.print(F("CIRF(120,239,35,3);"));       // Circle as a background
              //mySerial.print(F("SBC(3);"));
              //mySerial.print(F("DCV16(105,230,wait,15);"));     // Show while the forecast is not available yet.
              //mySerial.println(F("SBC(0);"));
            
              wait(400);
            #endif
            
              if(!bme280.init()){
                Serial.println(F("! Sensor error"));
            #ifdef HAS_DISPLAY
                mySerial.println(F("DCV16(10,250,Sensor error,1);"));
            #endif
              }
            
              wdt_enable(WDTO_2S);                              // Starts the watchdog timer. If it is not reset once every 2 seconds, then the entire device will automatically restart.                                
            }
            

            Personally I then display a "w" icon in the top-right of the screen if a connection has been made.

            In the loop code it requests an ACK whenever it updates the sensor values to the gateway (once a minute). There is also a simple incrementing counter byte that increases by 1 every time there is no reply. As soon as this reaches 5 (meaning no response from the server for 5 minutes in a row) it prints an " " to the corner of the screen, to indicate the loss of connection.

            If data once again arrives in the receive function, then a "w" is once again printed to the top right corner, and the incrementing byte is set back to 0.

            skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by
            #5

            @alowhum Thank you for sharing this! - This looks like exactly the kind of thing I was trying to achieve.

            Hopefully I get some time at the weekend to test it out.

            Cheers! :)

            1 Reply Last reply
            1
            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