-
Notifications
You must be signed in to change notification settings - Fork 7
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
OTA Flashing? #1
Comments
Thank you for the old professor... ;-) Actually, I havn't thought about reverse engineering the various stock firmwares. Trying to analyze the default cloud communication might be interesting. As it has only 1MB flash it has perhaps not OTA. If it had, it is most probably not secured by TLS... Will think about it. Nice work for a student's thesis... ;-) |
That's quite easy in the end. Just add a few lines to include the WebUpdate feature that is already included in the ESP library. You then have a small webserver running which you can use to upload new code (as long the sketch size is max 1/2 of the available memory). The link is YourDeviceIPAddress/update. You can then upload the compiled *.bin file (e.g. OBISocket.ino.bin) from the Arduino IDE compile folder. After upload it restarts with the new firmware loaded.
One last remark: I didn't know which type of ESP to choose, but "Wemos D1 mini Lite" seems to work quite well. Maybe you can add this note to the Readme document (or the correct settings if this one is not correct). |
Thank you for the hint. Actually, I havn't done anything wih the Arduino OTA so far. Btw, do you have any experience with the resulution of the ".local" address on Linux (or Windows) as these do not support mDNS by default, as far as I know? Also I think, the first idea from jreinert was, to hack any OTA mechanism of the stock firmware of the socket switch in order to be able to reflash it without opening it and soldering. |
I'm no expert in Arduino OTA, I just used this code in a few of my smarthome sensors and so far it works quite well. I also didn't test the mDNS stuff, I just use IPs in my home network. Ah, ok, I didn't get that right. Unfortunately I don't have any un-flashed plugs anymore and I didn't test the original software, so I can't check if there is any OTA functionality out of the box.. |
Haha. I couldn't resist after seeing your github name. :)
Exactly. OTA updates (if any) will probably be done via polling to a centralized update server. I also doubt that it will have any serious security, but you never know. If what I'm suspecting is correct, it will most likely contact the update server just after booting so it should be easy enough to sniff the communication with tcpdump/wireshark. There's also open specification of how the update server should respond and which headers it should set (MD5 sum for one): https://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html#http-server This is all assuming that the stock firmware is built using the arduino toolchain. Could be something else which would be trickier. I still have to get my hands on a plug to test this all this out. Will report back, when I've got the chance to stop by an OBI with the plugs in stock. |
Nice to see old professors from the uni doing useful tinkering with consumer products ;)
Have you tried intercepting any OTA updates as a way to flash the ESP without having to open up and solder the pin header to it? Or is it the usual IOT product which was never designed to get any updates.
Also take a look at marvinroger/homie-esp8266
It's perfect for these kinds of things and brings you easy configuration, mqtt, some metrics and OTA out of the box.
The text was updated successfully, but these errors were encountered: