This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/beautify-web/js-beautify | |
// https://github.com/oracle/graaljs | |
// Inspired by https://gist.github.com/fedochet/d41442e735eaa277937a094ab8e5fc8f | |
import org.apache.commons.io.IOUtils; | |
import org.graalvm.polyglot.Context; | |
import org.graalvm.polyglot.HostAccess; | |
import org.graalvm.polyglot.PolyglotAccess; | |
import org.graalvm.polyglot.Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Needed software: | |
- HFS HTTP fileserver (for serving firmware file) - https://www.rejetto.com/hfs/?f=dl | |
- Not all HTTP servers will work, it has to support streaming, I think | |
- Postman (for instructing device to download file from URL) - https://www.postman.com/downloads/ | |
- OTA protocol documentation: https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v2.0%20Doc.pdf | |
Steps: | |
- Prepare your firmware you want to flash (for example from ESPHome) |