-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle preflight requests #1927
Conversation
Hi There is already a Web based application for uploading firmware to several sonoff at the same time. |
Hi, I know SonWeb. That's great work. The problem is that the Tasmota devices need either direct access to the internet or you need to set up a web server on your local machine. My devices are not allowed to connect directly to the internet due to security concerns. Setting up a web server is not trivial and for a lot of people too much effort for just updating a few devices. Of course, that is not a problem of SonWeb but in general of the update mechanism. In my opinion, the easiest way to send the firmware directly to the devices is to handle the preflight requests. That are just a few lines of code and I can't think of any problems. |
Hi, I understand. So, just few lines on webserver.ino and https://github.com/WoHinDu/Tasmota-Firmware-Updater can be used, right? That is a nice python solution. I can think that this approach is also very useful for an android app to update Tasmota Firmwares directly. Like your approach as another update option. 👍 Hope to be included in Tasmota. BTW, Installing SonWEB on windows is just unziping the provided ready to use SonWEB-XAMP-Portable-2018-01-20.zip on c:\XAMPP and run once setup_xampp.bat and then run xampp-control.exe |
Will be in next pre-release |
@ascillato @arendst Thanks a lot for reviewing this code so fast! |
5.12.0b * Add Webserver upload preflight request support (arendst#1927) * Add Home Assistant clear other device (arendst#1931)
Currently, I'm writing a little web programme to make the batch updating from multiple tasmota devices easier.
My preferred method to update the devices is to send the firmware directly to the device via a POST request. That is basically the same what the original built-in updater is doing. The problem is that a browser sends before the actual POST request a so-called preflight request (an OPTIONS request). The browser asks the web server whether the request is allowed or not. Currently, the preflight requests are not handled by tasmota and therefore the response is an error 404.
This pull request implements the correct handling of preflight requests for the firmware update page.