logo elektroda
logo elektroda
X
logo elektroda

How do I download autoexec.bat from a LAN server on OpenBeken via MQTT?

uszatekmis 189 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21509764
    uszatekmis
    Level 11  
    Hello.
    I have a bit of a problem, maybe not so much with the functioning of the sflashed CBU (temp/humidity sensor from SHT30) -> exactly as in this topic and this .
    I've already figured out that the latest version that supports SHT3X is 1.18.11. But that's still not what I mean.
    I would like it to download a new autoexec.bat from the server on the LAN after waking up. The sensor is awakened a few seconds, and I would like to dynamically adjust the SHT calibration of the individual sensors.
    I will of course issue a command in MQTT with the retain flag, only problem is that I don't know if such a simple command is available. I suspect there is something, because it's implemented somehow in the WebApp, but I've done some digging through the web and documentation and haven't found anything.
    Maybe it's implemented via individual lines (lfs_append/lfs_appendline, but I don't know how individual lines would be passed from MQTT, which with a larger file could be troublesome), via sentGet rather not, as it returns nothing.
    Maybe someone has somehow solved this already?
  • ADVERTISEMENT
  • Helpful post
    #2 21509927
    p.kaczmarek2
    Moderator Smart Home
    I haven't tested this in a long time, but in the code I have:
    
    // SendGet http://192.168.0.112/cm?cmnd=Power0%20Toggle
    // addRepeatingEvent 5 -1 SendGet http://192.168.0.112/cm?cmnd=Power0%20Toggle
    // addEventHandler OnClick 8 SendGet http://192.168.0.112/cm?cmnd=Power0%20Toggle
    // Following command will just send get:
    // SendGet http://example.com/
    // Following command will send get and save result to file:
    // SendGet http://example.com/ myFile.html
    // test code: addRepeatingEvent 30 -1 SendGet http://example.com/ myFile.html
    
    .
    Let's try...
    
    SendGET http://example.com/ myTest.html
    

    Screenshot of the LittleFS management panel viewed in a web browser.
    it works for me, something downloaded.
    Helpful post? Buy me a coffee.
  • #3 21509985
    uszatekmis
    Level 11  
    Actually it works as it should, but in the documentation there is only one argument given - TargetURL :-) maybe it is worth adding a second optional one there?
ADVERTISEMENT