-
Notifications
You must be signed in to change notification settings - Fork 25
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
support for firmware update through home assistant #248
Comments
HomeAssistant has some powerful tools like Esphome, its portainer based ESP compiler and local OTA update tool.. i think it's possible to use it.. |
Also, HA is mostly based on docker, and have containers as add-ons, its possible to make some add-on's which task would be update heishamon |
And definitely i think it's possible download and simple post into heishamon interface :D |
Hey there, Two things makes me hesitate though:
But overall, I would really happy to work in that direction, thanks for the proposal! |
Good points. Let me think about those things. |
I have been testing and a basic python code upload that works below.
|
Thanks for the script, it's a very good starting point. I retried to update my firmware (from 3.0 to 3.8) but aftr the upload it fails to do anything (the script times out).
(goal of this ticket is not to troubleshoot my issue but I'll need to get this fixed to be able to develop the feature in the integration). |
There are some issue's with older firmware while uploading the firmware indeed. But most of the time, if you reboot and then do the firmware update directly from the webinterface it should work. I haven't tried 3.0 to 3.8 yet myself though. You could easily use https://espressif.github.io/esptool-js/ to upload the binary over serial (make sure to upload to address 0x0) on the ESP8266. For the ESP32 it is a bit more work. I think we should support updating from home assistant only from a firmware where we believe it is working correctly. Also indeed it should tell what controller it is running (and so, which firmware it needs). So that should be in the next firmware first (I am thinking about a GET /firmware?status request giving some info in JSON format. |
Just tried a v3.0 to v3.8 and it worked fine, right after reboot:
|
I flashed to 3.8 with a cable.
(roughly at the moment we reached 100%). I've tried to do the upgrade attempt shortly after reboot but no luck so far. |
@kamaradclimber do you have correct md5 file? Also does it fit current firmware? If you try to flash firmware without correct md5 it just reboots after upload. Don't remember it will pronounce any error or not... |
Yes md5 files are correct and fit the firmware (both for 3.8 and 3.62). To be clear, the script is not the issue, the firmware upgrade does not work better from the webui. Should I open a ticket on Egyras/Heishamon repository to summarize the issue so that we can investigate independantly of this feature? (I think I can implement a draft without having a way to test) |
I'll test @IgorYbema script also to be shure.. as he told it's simple http post process. Maybe we are missing something.. also if there is any kind of problem from heishamon side @IgorYbema is only one who could solve it ;) |
yes indeed, @IgorYbema there is a problem with web stack. If i open console web interface i am unable to update firmware. Heishamon will interrupt upload, and closes socket, also i see MQTT reconnect. Next time while trying it will get ~5% of data and does same. After closing web browser and uploading, everything works good. Console was opened from one device, and python script was run from another. if it makes any sense.. UPD: it doesn't reconnects to MQTT, just after closing upload process it just updates MQTT topic. |
Ok I'll try that also. Will be tomorrow. |
I saw same behaviour indeed. Something to fix :) |
It describes exactly what I was facing (looking at the console to follow the update). Thanks for the confirmation. |
I believe the websocket implementation is corrupting the memory somewhere. So it mangels some bytes being sent over another webserver connection. I'll take this finding back to my repo and discuss it with Curlymoo. |
Is there anyway to distinguish the small and large versions of the PCB (with current version of heishamon), something like a mqtt topic that would exist only for one of those models? In future version of heishamon it would be good to give the info about the type of build the board is running. |
This is a nice suggestion from @IgorYbema, thanks! Fix #248
I've written #249 as a draft.
Any way it's a good start. If you want to test it easily, you can use the |
Would you be able to look at IgorYbema/HeishaMon#140 and tell me if that would be a good idea for Heishamon ? |
As the developer of the Heishamon software I would like to discuss the posibility to add upgrading through the home assistant heishamon integration. I am not a python developer and am not a frequent user of home assistant. But I like where it is going and there a lot of users using it.
So what could I do on the heishamon side to support firmware upgrades through this integration?
Currently heishamon firmware updates is done using a POST to the /firmware url with filename and md5 as the post values, including the firmware itself ofcourse. Is this something which the integration could post a self-downloaded (from github) file to?
I can't make OTA upgrade on heishamon as the ESP8266 is too low on memory to add HTTPS support (required for it to download the binaries from github). I could host the binaries on a HTTP site but that would make it depended on that, probably, single server. That is why I wanted to look into the home assistant method of upgrading the firmware.
The text was updated successfully, but these errors were encountered: