Page 1 of 2

Firmware upgrade via NodeMCU

Posted: Thu Jan 21, 2021 4:45 pm
by tjfs
I saw 5.0 firmware is out for the PIC so I tried upgrading using the NodeMCU + Robert's firmware 0.6.0 and OTMonitor 5.0

Unfortunately the upgrade slowed down at 43% and failed altogether at 50% with lots of errors.

I'm not sure why this is. I notified Robert who has now added this to his documentation:

**WARNING: Do not upgrade your PIC thru port 1023! Connect Your OTGW to your serialport instead for upgrade.**

Fortunately I had some spare pre-programmed PICs so I put one of those in and my gateway is working again.

Any recommendations for PIC programmers?

Thanks

Tim

Re: Firmware upgrade via NodeMCU failed

Posted: Thu Jan 21, 2021 6:35 pm
by hvxl
If the upgrade fails at 50%, you should be able to recover by starting the upgrade again and resetting the PIC.

Simply telling people to use some other method to upgrade is a very easy way out. But I don't know if it's a good idea if you want people to actually use your firmware. Such a limitation makes the firmware pretty useless.

I have used Robert's 0.6.0 firmware to upgrade the OTGW firmware many times successfully. So the advise is also nonsense. Of course, when upgrading the firmware via WiFi, it is important to have a stable connection.

Re: Firmware upgrade via NodeMCU failed

Posted: Thu Jan 21, 2021 6:45 pm
by vamp
Same problem. One OTGW is update without any problem, the second one is not... I wait a UART-USB programmer, i hope i able to flash it with the serial intrerface...

Re: Firmware upgrade via NodeMCU failed

Posted: Thu Jan 21, 2021 7:01 pm
by Templar
tjfs wrote: Any recommendations for PIC programmers?

Thanks

Tim
I have a XGecu-TL866II-Plus-Programmer.
But I have been updating the OTGW firmware via OTA several times without any problems.

Re: Firmware upgrade via NodeMCU failed

Posted: Thu Jan 21, 2021 7:08 pm
by hvxl
OK. If everyone knows better, I give up. I hope you have fun with your USB cables and PIC programmers.

Re: Firmware upgrade via NodeMCU failed

Posted: Fri Jan 22, 2021 4:09 pm
by tjfs
I will still try to update via OTA as it is much more convenient than using a cable or a programmer.

I was looking for a programmer to recover the PIC which no longer boots into OTGW. Not urgent!

Robert has made some improvements to his firmware which should make upgrading over WiFi more reliable.

It's up to him what he puts in his documentation. I think it is temporary until his new firmware is released.

Tim

Re: Firmware upgrade via NodeMCU failed

Posted: Fri Jan 22, 2021 5:53 pm
by hvxl
Even if the PIC doesn't appear to boot anymore, there's still a good chance that you can do a firmware upgrade to recover it.

If the LEDs flash after power-up or a reset, then you should definitely be able to do a firmware upgrade. But even if the LEDs don't flash, it may still be possible. The only special action you have to take is to briefly short the pins on the RST jumper next to the PIC when OTMonitor indicates to manually reset the OTGW.

I suspect I've done more OTGW firmware upgrades than anyone else and I have never needed to dust off my PIC programmer to recover a non-functional PIC after a failed upgrade, or even a bad code change.

Re: Firmware upgrade via NodeMCU failed

Posted: Fri Jan 22, 2021 6:34 pm
by tjfs
When the upgrade failed and the gateway wouldn't boot, I remembered my box of spare pre-programmed PICs which seemed the quickest way to get it working.

I got the gateway from the boiler and put the original PIC back in. After shorting the reset pins I was able to program it successfully using Robert's 0.7.0 firmware.

I believe Robert has discovered how to reset the PIC from the NodeMCU so it may not be necessary to physically access the gateway in future if this happens again.

Best wishes

Tim

Re: Firmware upgrade via NodeMCU failed

Posted: Fri Jan 22, 2021 10:04 pm
by hvxl
tjfs wrote:When the upgrade failed and the gateway wouldn't boot, I remembered my box of spare pre-programmed PICs which seemed the quickest way to get it working.
Sure. But then you went looking for a PIC programmer. I was just trying to save you from unnecessarily spending money. But apparently that's not appreciated. Got it. I won't do it again.

Re: Firmware upgrade via NodeMCU failed

Posted: Fri Jan 22, 2021 11:41 pm
by tjfs
You're absolutely right, I don't need a PIC programmer.

Thank you again for all your help.

Best wishes

Tim

Re: Firmware upgrade via NodeMCU failed

Posted: Sat Jan 23, 2021 1:28 am
by vamp
Info: After a nodeMCU fail, I able to flash the firmware with serial interface with USB UART programmer without any problem. It is about 3$ so not a PIC programmer price :)

Re: Firmware upgrade via NodeMCU

Posted: Mon Jan 25, 2021 9:08 am
by rvdbreemen
@hvxl in the mean time I have release 0.7.0 that should better be able to recover if pressed the WiFi manually.
Also I have worked on a DEV branch that resets the PIC in the OTA process in the right moment in time.

I noticed you created a seperate NodeMCU flash to recover and update PIC. Could you share source so I can include it in my version of the ESP8266 firmware?

Thanks
Robert

Re: Firmware upgrade via NodeMCU

Posted: Mon Jan 25, 2021 3:26 pm
by hvxl
I wasn't aware this was on your feature list. Your last update sounded like you were pretty much done.

The otgwmcu firmware needs to be cleaned up a bit before I will publish it. I just made sure it works and then quickly released a 0.1 version to be able to help out users that had experienced a failed upgrade. People seemed to have trouble following the instructions on how to recover the PIC themselves.

By the way, you don't have to ask me for the sources in two topics and a PM. Once is sufficient. Twice is redundant. Three times starts to feel like nagging. That doesn't usually work well with me.

It also doesn't help your cause to say things like I took your idea and based my code on your attempt. I really don't need you to come up with such ideas. The need for a better way to upgrade over WiFi became quite apparent with all the reports of failed upgrades. It looks like you first mentioned the idea on gitter on Saturday evening. By then I had already written most of the code. But because it is important that the process doesn't make things worse, I took the time to test different failure scenarios and made sure recovery still worked, even if the recovery itself was interrupted.

I realize I may sound like a grumpy old man. But I just spent a lot of time and effort to make OTGW firmware 5.0. And all I get, with only very few exceptions, is reactions from clueless people that report things that amount to: "I'm not sure, but I think your firmware is not working". Someone also pointed me to tweakers.net, where a lot of people are complaining about the OTGW, but nobody seems to have thought of contacting me.

None of the people who asked for the new OTGW features have reported whether it works for them. So this all starts to feel like a big waste of time. The OTGW has been working fine for me for a long time. I only implement new features for other users. If that's not appreciated, then I won't bother anymore. I certainly don't need this aggravation.

Re: Firmware upgrade via NodeMCU

Posted: Mon Jan 25, 2021 7:04 pm
by tjfs
Can I just say that as a new user I really appreciate all the hard work that has gone into this and the excellent support. It is unfortunate that when things go well users tend to be quiet until problems occur which may be very minor.

Thank you

Tim

Re: Firmware upgrade via NodeMCU

Posted: Sat Jan 30, 2021 8:06 pm
by Robr57
Dear Schelte,

I have your OTGW running (2 of them) since 2 years, and I am really pleased with what you made.

I noticed that you were a bit disappointed by the fact that you do not get many thank you's, but here is mine !

I do appreciate that you have published 5.0, I am exploring how I can use more info from the Opentherm interface that my heatpump uses.
Together with the work by Robert vd Breemen the new version gives me much more insight.

So again, thanks !

PS. I even decided to register myself here on this forum to give you this positive feedback.