HomeACcessoryKid / life-cycle-manager

Initial install, WiFi settings and over the air firmware upgrades for any esp-open-rtos repository on GitHub
Apache License 2.0
60 stars 11 forks source link

Problem with OTABOOT and sonoff #5

Closed GPL71 closed 5 years ago

GPL71 commented 5 years ago

Hello Thank you so much for your great work I have a very strange proble descripted below https://github.com/RavenSystem/esp-homekit-devices/issues/172

I'm using the OTABOOT.bin updated at last release to download and install ravencore in SONOFF 4ch R2 and Dual R2.

I'm waiting for the SONOFF SV and Shelly where I'll would like to do other test.

Some weeks ago I'd flashed some SONOFF basic without problem and I'm updating them without issue.

Can you forward me ideas about test to do and understanding why OTA procedure doesn't work for me? Thank you

HomeACcessoryKid commented 5 years ago

LCM has UDPlogger which you run in a mac terminal session

nc -kulnw0 45678

Please share the output? Or even better but not essential yet, from the serial console

BR, HacK

On 8 Jan 2019, at 15:25, GPL71 notifications@github.com wrote:

Hello Thank you so much for your great work I have a very strange proble descripted below RavenSystem/esp-homekit-devices#172

I'm using the OTABOOT.bin updated at last release to download and install ravencore in SONOFF 4ch R2 and Dual R2.

I'm waiting for the SONOFF SV and Shelly where I'll would like to do other test.

Some weeks ago I'd flashed some SONOFF basic without problem and I'm updating them without issue.

Can you forward me ideas about test to do and understanding why OTA procedure doesn't work for me? Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

GPL71 commented 5 years ago

Thank you for your replay .... Please be patient .... Can you explain me how to? I typed on terminal iMac nc -kulnw0 45678 but nothing happened

HomeACcessoryKid commented 5 years ago

the idea is that you’re mac is on the same wifi network as the Sonoff, and that you trigger a firmware update.

it is LCM that sends out the UDPlog, not the RavenCore software.

I’m not 100% sure where the problem is or what it is, but if it is visible in the UDPlog, we have something to work with.

RavenSystem commented 5 years ago

@GPL71 better way:

GPL71 commented 5 years ago

@HomeACcessoryKid @RavenSystem Thank you so much for helping me.

Only a consideration before. I did other tests around 4ch pro R2 while I was waiting for your suggestions using another router, but nothing was changed.

However below steps I followed: 1- erase flash 2- Flash again with otaboot 3- Choosed net, RavenSystem/ravencore repo, password net and join 4- Download of firmware starts 5- The LCM followed by last MAC adress went out of net list 6- After 15 minutes the sonoff is freezed (button and reset don't work) 7- Now.... if I check the clients list in the router the sonoff is registred with its own IP adress (what does it mean? Firmware is stored, but it can't start?)

While I'm writing I'm having a flash. I'm minding reconnect sonoff to FTDI and turn it in Flash Mode again and disconnect again and see if something change (in the evening I'll try it) My opinion is that simply it couldn't restart after downloaded the firmware via OTA. I think the problem maybe bonded to the fact boards i'm using are R2 (both 4ch and Dual). Infact I don't get any issue using basic type device, old version

OK Stop to my consideration ..... Please I need some instructions because to do log up because I'm not so expert I'm using windows 10 to flash the SONOFF @RavenSystem to do log I'll use iMac 1 open terminal 2 iMac and SONOFF just flashed with OTA in same 2.4Ghz WiFi net 3 type in terminal: screen /dev/IP ADRESS 115200 or screen /IP ADRESS 115200 or screen /MAC ADRESS? 4 configure your device with normal procedure .... Are you minding net, repo, file and net password?

Thank you again for your help

RavenSystem commented 5 years ago

I thought that you flash with a Mac. Do what @HomeACcessoryKid says.

GPL71 commented 5 years ago

@RavenSystem I have no problem to monitor the downloading of firmware by mac as I wrote up @HomeACcessoryKid wrote about mac ... If I'd understand correctly, this an indipendent operation because it will be after the flash operation Then I can flash using win10 and monitor the OTA update using mac

I need the path only how do it I've found the follow steps:

The first thing to do is determine which device you want to connect to. In terminal type ls /dev/tty.*

Once you’ve determined which device you would like to use, you can execute the SCREEN command to start the serial terminal session on your Mac.
Remember to specify the speed (baud rate) after the device name.

screen /dev/tty.usbserial-FTT3JMUZ 9600

Is that the way for log? How will I recognize my device?

Thank you

HomeACcessoryKid commented 5 years ago

My opinion is that simply it couldn't restart after downloaded the firmware via OTA.

Maybe we need to make this more clear, I wrote this in ota-demo.c

            // in ota-boot the user gets to set the wifi and the repository details and it then installs the ota-main binary
            // the below two lines are the ONLY thing needed for a repo to support ota after having started with ota-boot
            rboot_set_temp_rom(1); //select the OTA main routine
            sdk_system_restart();  //#include <rboot-api.h>
            // there is a bug in the esp SDK such that if you do not power cycle the chip after flashing, restart is unreliable
GPL71 commented 5 years ago

@HomeACcessoryKid @RavenSystem

I solved erase and flashing again .... but this time I did with iMac. I activated monitor to the FTDI e followed process while it was running Process seems oil .... :D

Another change ... I'd set the sonoff using iMac and not iPad or iPhone such last times Download ravencore firmware and setup involve 4 minutes

Another strange thing .. the duration of blank_config, otaboot and rboot using WIN10 was quickly, about 30-40 seconds Same operation using OSX take 1 minute about.

However boys thank you so much for your help

HomeACcessoryKid commented 5 years ago

I assume your problem is solved. Thanks for giving feedback, it helps to improve or work.