logo elektroda
logo elektroda
X
logo elektroda

How to Achieve Dual Functionality for a Single LED for WiFi Status and Relay Control?

omniron 438 2
ADVERTISEMENT
  • #1 21032390
    omniron
    Level 10  

    https://www.elektroda.com/rtvforum/topic4045465.html

    After finally managing OTA-ing one unit I noticed that the LED -if set to WiFi- only blinks when no WiFi connection.
    When set to "LED_n" it turns on/off with the relay.
    The original firmware would however use the LED for both functions.
    Is it possible to set that dual function/messaging for the LED here, too?
  • ADVERTISEMENT
  • #2 21032504
    p.kaczmarek2
    Moderator Smart Home
    This question has been already answered here:
    Need Script for WifiLed at startup, when connection is established change LED function to On/Off
    Please try out the solution from the linked topic and let me know if it works for you.
    Helpful post? Buy me a coffee.
  • #3 21034482
    omniron
    Level 10  

    autoexec.bat:
    alias mode_wifi setPinRole 6 WifiLED_n
    alias mode_relay setPinRole 6 LED_n
    // at reboot, set WiFiLED
    mode_wifi
    // then, setup handlers
    addChangeHandler WiFiState == 4 mode_relay 
    addChangeHandler WiFiState != 4 mode_wifi 


    Changed (only) LED pin from that link you mentioned above and put it in autoexec and it worked mostly.
    When rebooted (with WiFi on) LED reacted to the relay on/off.
    Kept unit turned on and switched WiFi off, and it didn't start blinking (for WiFi) like the other units.
    Turned power off and then on again, and it started blinking (for WiFi).
    Turned WiFi on and it stopped blinking (for WiFi).

    So while on with WiFi, it doesn't register if WiFi goes out.

    Not a biggie, I'm ok with that, thank you for this.

    Now: is there a way to include FS files like this autoexec.bat file when flashing the unit with OpenBK7231?
    A flag with the autoexec.bat file or so?

    Or can we produce/download one file from a fully OpenBK7231 flashed and fully programmed unit (programmed with several FS files like autoexec.bat, AllOn.bat etc) which could be used with OpenBK7231 to fully (including FS file) flash other units?

    Something like cloning (sans MAC addresses and RF config etc)
    Thanks!!
ADVERTISEMENT