logo elektroda
logo elektroda
X
logo elektroda

WiFi-Plug Startup Command Length Issue: SyntaxError in Web App JSON Data

ElektroTechnikus 534 5
ADVERTISEMENT
  • Helpful post
    #1 21039445
    ElektroTechnikus
    Level 8  

    I've got a little problem with a simple WiFi-plug. Is there a length-constraint with the startup command text?

    If I put the following text in the field, it is loaded and seems to work:
    backlog
    alias mode_wifi setPinRole 6 WifiLED;
    alias mode_relay setPinRole 6 LED_n;
    mode_wifi;
    addChangeHandler WiFiState == 4 mode_relay;
    addChangeHandler WiFiState != 4 mode_wifi;
    startDriver NTP;
    ntp_setServer 192.168.0.1;
    ntp_timeZoneOfs +1;
    ntp_setLatlong aa.aaaaaa b.bbbbbb;
    waitFor NTPState 1;
    


    But the web application Config says:
    Code: Text
    Log in, to see the code


    The command in the template is empty ("command": "",) and OTA does not work, as the Chipset isn't known:
    View of the OTA application screen with chipset and build data not filled in.

    But:
    Screenshot of application interface with device information.

    So I think, it's a problem of the web app and not of the firmware? (If I shorten the command string, it works...)
  • ADVERTISEMENT
  • #2 21039521
    p.kaczmarek2
    Moderator Smart Home
    Thanks for the report, I will investigate, but first of all, why aren't you using the autoexec.bat from littleFS?


    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21040101
    ElektroTechnikus
    Level 8  

    Thanks for the reply.

    I'm just starting out with OpenBeken and found the startup command handy for simple things - so I tried it that way and suddenly my test socket had partial amnesia. That piqued my curiosity... ;-)

    Was almost about to flash it once again as before...
    Test setup with a breadboard and electronic modules.
  • ADVERTISEMENT
  • #4 21040269
    p.kaczmarek2
    Moderator Smart Home
    Thank you again for reporting the problem.
    After a brief investigation, I have concluded that there was an issue with handling startup commands longer than 255 characters and you must have been the first user to try creating such a long command in startup string. Usually, everyone uses autoexec.bat.
    Still, the issue have been found and hopefully should be fixed now:
    https://github.com/openshwprojects/OpenBK7231...mmit/89fc09a921cf7b3a9431b30c09d598ec1c6f7d76
    I have only tested the problem on Windows Simulator:
    WinTest graphical interface with simulator and console.
    So I am currently not sure if it's also solved for you. Can you update to 1.17.542 once it's built and let me know if it works good for you now?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21041434
    ElektroTechnikus
    Level 8  

    Quote:
    ... let me know if it works well for you now?


    Yes, it does! Thank you very much.

    As it is a plug that is very easy to open and (re-)flash, I intend to lend it to interested makers in my space to get hands-on or use it in a demonstration. We've only played with Shellys and Tasmota so far.
  • #6 21041751
    p.kaczmarek2
    Moderator Smart Home
    Thank you, feel free to ask if you need any futher assistance. I can help with DIY IoT projects, etc.

    Btw, you can also try OBK running on Windows:
    OpenBeken IoT device simulator - first early alpha version release for testing
    Helpful post? Buy me a coffee.
ADVERTISEMENT