zwiebert / tronferno-mcu-bin

Binary firmware images and flash tools for tronferno-mcu
9 stars 1 forks source link

Firmware OTA update fails #9

Open zwiebert opened 6 months ago

zwiebert commented 6 months ago

Version: any version prior 1.12.2.13

Solution: Update firmware from FHEM homeserver (set tfmcu mcu-firmware-esp32 upgrade-beta-version) if connected to USB -or- manually download version 1.12.2.13 or later and flash via USB using the flash script or menutool.(sh|com)

(Not sure why it no longer works in the older versions, or if its just temporarily. This time it does not seem to be an outdated certificate. Now, I switched from using ca_cert.pem file to CERT_BUNDLE and it works)

-Bert

jochenpa commented 5 months ago

Hello

Some comments on the manual update:

I used the linux package.

The flash_esp32.sh tries to install esp tool with pip, which does not work. When I tried it manually:

# python -m pip install -t tools/python
/usr/bin/python: No module named pip

So maybe python3-pip package is required? I did not test it.

But why is that necessary? There already is tools/esptool.py ...

So I changed it like this: python tools/esptool.py --chip esp32 --port $comport --baud 230400 \ ...

And it just works ...

Mit freundlichen Grüßen Jochen Pawletta

zwiebert commented 5 months ago

Hello Jochen.

I'm glad it worked. Thanks for the feedback.

Yes, it would work if you installed python3-pip. Its for downloading and installing python packages.

The flash_esp32.sh really needs pip, because its called by the FHEM module when doing update from there, which downloads just the esptool.py file. This used to work, but newer versions of esptool need a subfolder esptool which contains the actual python code. This folder is not downloaded by the FHEM module.

I used this method for menutool.sh too, because a user should have an easier time to figure out what pip is, than what pyserial is. The windows version just comes bundled with all packages using a python bundler. So on windows it would always work (at leas, if you have the correct USB driver for your ESP32 board installed).

Maybe I can change the script. so it tries it without pip or checks for the esptool subfolder, just in case it may work.

kind regards, Bert

jochenpa commented 5 months ago

Hi

You can add python-pip to the requirements here: https://github.com/zwiebert/tronferno-mcu-bin/blob/master/docs/starter_flash-de.md

That is if you keep using pip ...

Mit freundlichen Grüßen Jochen

zwiebert commented 5 months ago

Thanks. I improved the flash scripts, and added pySerial to the distribution. It seems the best solution, because its not even possible to install "pyserial" if you already have installed "serial". The only requirement now ist python3 on Linux. On Windows its the virtual COM-port driver for the specific USB chip on the ESP32 board. Pip is still there as fallback for FHEM or when the bundled esptool.py will not run for any reason.

kind regards, Bert