- #Esp8266 firmware update instructables mod
- #Esp8266 firmware update instructables Patch
- #Esp8266 firmware update instructables full
- #Esp8266 firmware update instructables code
What started as a simple way to hack a cloud bound Sonoff Basic (one of the first cheap and accessible smart home devices in the market) into a locally controlled device has grown into a fully fledged ecosystem for virtually any ESP8266 based device.Įverything documented here started from the … Getting Started page at Tasmota again. Its goal was to provide ESP8266 based ITEAD Sonoff devices with MQTT and ‘Over the Air’ or OTA firmware using Arduino IDE. Tasmota is an open source firmware for ESP8266 based devices created and maintained by Theo Arendst.Įverything began as Sonoff-MQTT-OTA-Arduino with a commit on 10. It’s way easier to just quote the Tasmota page : Well, not exactly, each button uses one of 4 codes. I’m still posting this as I’d like to use it later on anyway. Something I wasn’t aware of when purchasing the bridge. Spoiler : That failed because my remote controller uses rolling codes while the bridge only support fixed codes.
#Esp8266 firmware update instructables full
Replace the Sonoff firmware by Tasmota to access its full potential and integrate it into local only Home Assistant.Now, I just need to come up with some mechanism for triggering the OTA state in a device using MQTT, and for devices that are not continually awake (I have several sensors that use deep-sleep for some time, and then wake up, publish an MQTT message and then go back to sleep).
#Esp8266 firmware update instructables code
ESP8266 devices retain their WiFi credentials and attempt to restore their connection state after restart, so that can simplify code somewhat, and you can just edit the configuration in the modules/inisetup.py module. It’s a shame that the sonoff devices don’t expose enough pins to hook this up though.Īs an aside, my micropython builds contain the mqtt client library, and automatically set up the WiFi credentials for the network they are installed in. Having a USB-serial converter that has RTS/DTR means you can have esptool.py automatically trigger boot mode. That is, you will be able to flash them, but not boot into regular apps. Some USB-serial converters do not provide enough current to power an ESP8266 running in anything other than flash-from-UART mode. The sonoff device(s) I have require flashing using -fm dout mode: with other modes a write_flash will appear to succeed, but the binary will not be viable, and only garbage will be seen on the screen. This could be because it doesn’t have enough flash, or some other reason. I was unable to get an OTA update to work on my ESP8266-01 device. In my case, the boot sequence was performing as expected, but when no OTA state was detected, and the micropython app was due to start, it was crashing with an error: If you are able to flash both images correctly, but get errors from the micropython app, check that you aren’t flashing a non-ota build.
Notes that I came across during this process. Note you’ll need to supply your firmware file and IP address. This will send off the 2274-ish packets to the device, and after this you should have your new firmware installed. Then, in the ota-client directory, execute the following: $ ota_client.py live-ota -a Trigger an OTA state (either using the process above, or by hitting a button in the 3 seconds after the bootloader is complete). Otherwise you won’t be able to sign the updates, and the ota-server binary will reject them. In order to do this, you must have built and flashed your own yaota8266, with your own keys.
This means I can trigger an OTA state by doing: import ota I added into my micropython firmware a file ota.py, that contains:
#Esp8266 firmware update instructables Patch
I also included in my ota-server the patch from ulno that allows for triggering OTA from within micropython code. You should now be able to apply OTA updates. Once these patches have been applied, run make at the root of the project.įlash the generated yaota8266.bin file to location 0x0 of your device.įlash the micropython OTA build to location 0x3c000 of your device. They are seperate pull requests, because whilst they all need to be applied to get a build to complete, they are all independent. I needed to make some other changes too: until they are merged, you can see them here. Duplicate the config.h.example file, and replace the MODULUS value with your public key’s modulus.
#Esp8266 firmware update instructables mod
The last step outputs some data from the key - specifically you need the mod value, and this needs to be used in a config.h file at the root of the project. $ python -c "import rsa_sign rsa_sign.dump_c(rsa_sign.load_key())"