RavenSystem / esp-homekit-devices

Advanced firmware to add native Apple HomeKit and custom configurations, compatible with any SoC based on ESP32, ESP32-S, ESP32-C and ESP8266 series. (Shelly, Sonoff, Electrodragon, Tuya...)
Other
2.76k stars 361 forks source link

Ota in Sonoff Raven_Core #17

Closed sn0wst0rm closed 6 years ago

sn0wst0rm commented 6 years ago

@RavenSystem Hello, I was reading your code to better understand the functionalities of the homekit lib. I'm really interested in including an ota upgrade method, I've already understood the ota update mechanism in open-rtos, but what I am not understanding is what you are doing in this example. I've tried to flash it to figure out, for example, the meaning of the modified characteristics you have made. In home app, it isn't shown any of them, either figures any button to reboot the device. So my question is: after implementing that ota function, needed to switch between ROMs, how do you actually upload and flash it?

Thank you in advance!

kiralikbeyin commented 6 years ago

I will try this https://github.com/SuperHouse/esp-open-rtos/tree/master/examples/http_client_ota

RavenSystem commented 6 years ago

OTA firmware update system used by Sonoff_RavenCore is this: https://github.com/HomeACcessoryKid/life-cycle-manager

kiralikbeyin commented 6 years ago

@RavenSystem please can you put some screenshots or video to wiki? https://github.com/HomeACcessoryKid/life-cycle-manager#how-to-use-it is not enough for a beginner like me.

kiralikbeyin commented 6 years ago

Need tutorial

RavenSystem commented 6 years ago

OTA is not ready yet. When it is ready, a tutorial will be published.

RavenSystem commented 6 years ago

https://github.com/RavenSystem/esp-homekit-devices/wiki/Sonoff-RavenCore

kiralikbeyin commented 6 years ago

I checked "ota_repo" word and only found in devices/Sonoff_RavenCore/main.c line 703 status = sysparam_get_string("ota_repo", &char_value);

Where do you "sysparam_set_string" ?

Nothing about ota found in https://github.com/RavenSystem/esp-homekit-devices/blob/master/libs/legacy_config/content/index.html

RavenSystem commented 6 years ago

It's explain in the wiki:

Sonoff RavenCore is an unified firmware for several Sonoff devices, with OTA updates and some user settings. It uses a OTA update system called Life-Cycle-Manager (LCM) from @HomeACessoryKid.

kiralikbeyin commented 6 years ago

Thanks this is very useful.

Where is repo of otaboot.bin image how did you make it?

RavenSystem commented 6 years ago

All is explained in the wiki:

Sonoff RavenCore is an unified firmware for several Sonoff devices, with OTA updates and some user settings. It uses a OTA update system called Life-Cycle-Manager (LCM) from @HomeACessoryKid.

https://github.com/HomeACcessoryKid/life-cycle-manager

And there you can read:

Meanwhile, the development area is at https://github.com/HomeACcessoryKid/ota

And there you can find https://github.com/HomeACcessoryKid/ota/releases

i3laze commented 5 years ago

A question:

If I flash main.bin instead OTA-boot.bin, I will have no OTA (for doing f/w updates via Eve.app) like forever? I flashed v0.5.4 and I don’t see this particular toggle in Eve.

RavenSystem commented 5 years ago

@i3laze I don't know. That kind of questions is better that you ask in official OTA repo: https://github.com/HomeACcessoryKid/life-cycle-manager

HomeACcessoryKid commented 5 years ago

No, the ota concept depends on loading the ota-main program in the second partition.

if you start with ota-boot, that loads the ota-main in there and oat-main then loads the user-main in the primary partition If you load the user-main directly into the primary partition, then no ota can happen

hope this is clear, HacK