logo elektroda
logo elektroda
X
logo elektroda

OpenBeken script for LED - WifiLed on start-up, change to Led function once connection established

waldi_8601 345 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21869673
    waldi_8601
    Level 13  
    Posts: 132
    Rate: 29
    I came across a similar problem with OpenBeken and the script for LED - WifiLed at start-up, and once the connection is established, change to LED function for relay status

    Unfortunately the solution from the post below doesn't work for some unknown reason, topic closed so I can't add a working solution
    https://www.elektroda.pl/rtvforum/topic4012418.html

    Solution hinted by chatbot, u finally does not work as expected, LED flashes when no wifi, and shows relay status when connected to WIFI

    Code: Text
    Log in, to see the code
  • ADVERTISEMENT
  • #2 21873878
    max4elektroda
    Level 24  
    Posts: 746
    Help: 48
    Rate: 184
    Sorry, the translation is not totally clear: Do you present a working solution or does your code not work?
    It states first: " I can't add a working solution "
    and later: " .. finally does not work as expected..."
  • ADVERTISEMENT
  • #3 21883330
    waldi_8601
    Level 13  
    Posts: 132
    Rate: 29
    I have an identical problem to the quoted closed thread, however the solution is not working for me and I seemed to have a solution.

    I am using BK7231N and OpenBeken
    Built on Mar 28 2026 21:08:06 version 1.18.280
    Unfortunately after testing I found that the solution doesn't work either, it works sort of randomly.

    After further testing it turned out that the wifi status is 0 as I am connected (if WiFiState==0 then mode_relay it worked and toggled the pin setting).
    I checked on other modules of the same type and it is the same, I checked on BL602 modules and the situation is identical, wifi status 0 when connected to the WIFI network, I don't know what the status is when disconnected.
    I have uploaded another OpenBeken, also older versions and still the same result.

    I don't know if I'm doing something wrong or if it's some problem with the modules, or maybe with OpenBeken in some truncated version.
  • #4 21883486
    max4elektroda
    Level 24  
    Posts: 746
    Help: 48
    Rate: 184
    I think your problem is the last line:

    addRepeatingEvent 10 -1 if $WiFiState!=4 then mode_wifi


    If I'm not mistaken, there's nothing like "$WiFiState", so this unknown var will always be 0.

    You can easily check by using "$someUnknownVar" instead.
ADVERTISEMENT