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. Development
  3. WITH_LEDS_BLINKING - for gateways only?

WITH_LEDS_BLINKING - for gateways only?

Scheduled Pinned Locked Moved Development
5 Posts 4 Posters 1.8k 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.
  • stevebusS Offline
    stevebusS Offline
    stevebus
    wrote on last edited by
    #1

    Hi all,

    For some of my sensors that are fully powered (as opposed to battery powered ones), I'd like to get quick and dirty visual confirmation that they are sending and receiving data. I'm trying to use the WITH_LEDS_BLINKING functionality. But the behavior I'm seeing that transmit never comes on, and receive seems to come on at unrelated and random times. It occurs to me that functionality may be intended for gateways only and tied to some gateway specific functionality. Is that the case? I figured I'd ask before I go digging around in the code to see why they aren't working for me...

    thanks,
    --Steve

    Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

    Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

    1 Reply Last reply
    0
    • hekH Online
      hekH Online
      hek
      Admin
      wrote on last edited by
      #2

      Hmm..strange, it should work. A Gateway or Sensor should work the same way when it comes to radio transmits/reads.. Feel free to dig.

      1 Reply Last reply
      0
      • stevebusS Offline
        stevebusS Offline
        stevebus
        wrote on last edited by
        #3

        Ok, will do... my experience is that TX never blinked at all, and RX seemed to come on for about 20-30 seconds out of every minute. but I'll try to troubleshoot some more when I have time.

        Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

        Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

        1 Reply Last reply
        0
        • ServerovS Offline
          ServerovS Offline
          Serverov
          wrote on last edited by
          #4

          Hi all!

          In my case the LEDs do not blink on sensor nodes when I use a gw.sleep(xxx) function in the sketch. Still don't know why its happening.
          (MySensors v1.5)

          1 Reply Last reply
          0
          • H Offline
            H Offline
            HarryDutch
            wrote on last edited by
            #5

            MySensors 1.5.1
            Controller: Domoticz

            I'm using a simpel test sensor with the "blinking led's" to find "dead zones" in my house. The "blinking led's" are a big help for this and works flawlessly all the time.

            /**
             * The MySensors Arduino library handles the wireless radio link and protocol
             * between your home built sensors/actuators and HA controller of choice.
             * The sensors forms a self healing radio network with optional repeaters. Each
             * repeater and gateway builds a routing tables in EEPROM which keeps track of the
             * network topology allowing messages to be routed to nodes.
             *
             * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
             * Copyright (C) 2013-2015 Sensnology AB
             * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
             *
             * Documentation: http://www.mysensors.org
             * Support Forum: http://forum.mysensors.org
             *
             * This program is free software; you can redistribute it and/or
             * modify it under the terms of the GNU General Public License
             * version 2 as published by the Free Software Foundation.
             *
             *******************************
             */
            #include <SPI.h>
            #include <MySensor.h>
            
            #define CHILD_ID_BUTTON 0        //pushbutton attached to interrupt 0 (= pin 2).
            #define CHILD_ID_LED 1           //LED that is switch on/off by the controller (Domoticz).
            
            MySensor gw;
            
            MyMessage msg(CHILD_ID_LED, V_LIGHT);
            MyMessage msg2(CHILD_ID_BUTTON, V_STATUS);
            
            byte firstTime = 1;     //make sure that the mcu is going to sleep for the first time (no loop)
            
            void setup() {
              
            gw.begin(incomingMessage);
            gw.sendSketchInfo("Test sensor","1.0");
            gw.present(CHILD_ID_LED, S_LIGHT); 
            gw.present(CHILD_ID_BUTTON, S_BINARY);  
            
            pinMode(2, INPUT_PULLUP);        //interrupt = 0;
            
            pinMode(7, OUTPUT);              //LED is attached to pin 7
            digitalWrite(7, LOW);            //make sure that the LED is off
            
            }
            
            void loop() { 
              if(firstTime == 0) {
                gw.process();
                
                gw.send(msg2.set(1)); // send to controller a message that the button has been pushed. The controller then swithes the LED on (incomingMessage)
                gw.wait(2000);
                if(digitalRead(7) == HIGH) digitalWrite(7, LOW); // switch the LED off after 2 seconds 
                gw.send(msg.set(0)); // let the controller know that the mcu has switched off the LED
                gw.wait(2000);   
              } 
              
              firstTime = 0;
              gw.sleep(0,FALLING); // go to sleep and wait for the next button push 
            }
            
            void incomingMessage(const MyMessage &message) {
              if (message.type == V_LIGHT) {
                if (message.getInt() == 1) digitalWrite(7, HIGH);  
              }
            }
            
            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.0k

            Posts


            Copyright 2019 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