[Solved] Ethernet Gateway 2.0 LEDs don't Blink



  • Gateway is W5100 Ethernet with Nano. Uploaded Ethernet Gateway sketch with Arduino 1.6.7 IDE and debug shows data is being received and it registers in MYSController 1.0. So everything works as before except the RX, TX, and ERR LEDs no longer blink. #define MY_LEDS_BLINKING_FEATURE is NOT commented out in the sketch and LEDs are connected to pins 7, 8, and 9 (default). Again, these worked before the upgrade to MySensors 2.0. Any ideas?


  • Mod

    @d-smes is the define done before including MySensors.h? Not doing that seems to be a common mistake with 2.0.



  • @mfalkvidd - The sketch is based off the EthernetGateway example in MySensors 2.0 and I have confirmed the # defines are done before the #include <MySensors.h>


  • Mod

    @d-smes I'm using the default W5100 sketch for my Ethernet gateway and the leds are working just fine.
    I did change a few led related settings; you could try them too and see if the leds start working:

    #define MY_LEDS_BLINKING_FEATURE
    #define MY_DEFAULT_LED_BLINK_PERIOD   (50)
    #define MY_WITH_LEDS_BLINKING_INVERSE
    
    #define MY_DEFAULT_ERR_LED_PIN        (A2)
    #define MY_DEFAULT_RX_LED_PIN         (A1)
    #define MY_DEFAULT_TX_LED_PIN         (A0)
    

    Btw. which MySensors version are you using? 2.0.0 or 2.0.1beta?



  • Running GatewayW5100MQTTClient from 2.0.0 and the LED are working like a charm

    The only thing I changed was this

    // Flash leds on rx/tx/err
    #define MY_LEDS_BLINKING_FEATURE
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Uncomment to override default HW configurations
    #define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
    #define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
    #define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED
    
    


  • @Martin-Tellblom - Thanks Martin, that did the trick. I thought the defaults were pins 7, 8, & 9. But true enough, one must un-comment those three overrides to get the LEDs to work.

    @Yveaux - MySensors 2.0.0

    Thanks guys!
    Oh, one last stupid question - How do I edit the topic to add "[Solved]"?


  • Mod

    @d-smes click the "hamburger"/ three dot menu in the lower right corner of your first post in this topic and select edit. Edit the topic name at the very top of the edit screen (you might need to scroll up a bit).


  • Mod

    @d-smes said:

    I thought the defaults were pins 7, 8, & 9

    Apparently when these pins are not defined, the leds do not work. You should IMHO have been warned at compile time that these pins were not defined. Will pick it up in the core team: https://github.com/mysensors/MySensors/issues/562


  • Mod

    @d-smes Had a better look at the code. There are default LED pins, but these are 4, 5 & 6 for non-ESP (https://github.com/mysensors/MySensors/blob/development/MySensors.h#L113) and 7, 8 & 9 for ESP.



  • @Yveaux said:

    @d-smes Had a better look at the code. There are default LED pins, but these are 4, 5 & 6 for non-ESP (https://github.com/mysensors/MySensors/blob/development/MySensors.h#L113) and 7, 8 & 9 for ESP.

    Thanks Yveaux. Those seem like the wrong defaults (4, 5, & 6 for non-ESP) because both the WizNET (W5100) and ENC28J60 Ethernet wiring instructions use pins 5 & 6 for the NRF24L01 Radio. And the MySensors 1.5.x Ethernet Sketch Example on that page has these definitions:

    #define RADIO_CE_PIN        5  // radio chip enable
    #define RADIO_SPI_SS_PIN    6  // radio SPI serial select
    
    #define RADIO_ERROR_LED_PIN 7  // Error led pin
    #define RADIO_RX_LED_PIN    8  // Receive led pin
    #define RADIO_TX_LED_PIN    9  // the PCB, on board LED
    

    It's also a bit confusing when you say " 7, 8 & 9 for ESP" because according to the ESP8266 WiFi Gateway page, pins 7 & 8 are used for the NRF Radio and pin 16 is the LED. Can you explain?


  • Mod

    @d-smes the whole concept of having default led pins based on platform (e. g. Avr or esp) instead of board (e.g. Uno or NodeMcu) is wrong IMHO.
    Within the core team we're discussing how to handle this. Will come back to the topic as soon as things become clear.


Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 2
  • 10
  • 1
  • 3

23
Online

11.2k
Users

11.1k
Topics

112.5k
Posts