Skip to content
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

Allow user app to signal need to enter an OTA bootloader #10

Open
pfalcon opened this issue Jan 10, 2017 · 6 comments
Open

Allow user app to signal need to enter an OTA bootloader #10

pfalcon opened this issue Jan 10, 2017 · 6 comments

Comments

@pfalcon
Copy link
Owner

pfalcon commented Jan 10, 2017

Allow user app to call some function which cause a reboot with unconditional start of ota-server part. (E.g., to implement MicroPython's pyb.bootloader()).

@pfalcon
Copy link
Owner Author

pfalcon commented Jan 29, 2017

This is actually soft-blocked on micropython/micropython#2779

@ulno
Copy link

ulno commented Jul 24, 2017

Isn't it possible to write a magic word with machine.RTC().memory(magicword) into the RTC-memory and check for this from boot8266.c?

I can set and re-read (after reset) the memory successfully from the RTC-mem in micropython, however I am kind of pulling my hair, how to get the user-memory contents from boot8266.c. I have printed all the memory (512 bytes) starting from BASE_RTCMEM=0x60001000, but can't find anything defined before in micropython in the output - after entering micropython again, I can see the memory in machine.RTC().memory().

http://www.esp8266.com/viewtopic.php?f=8&t=3505 mentions to use system_rtc_mem_read but I assume that his should map anyways back to the aforementioned memory address.

Any idea or advice, how I can get the RTC-memory-content and any suggestions for magic words ("YAOTAOTA","MPOTAOTA")? Then I will happily fork and patch.

@ulno
Copy link

ulno commented Jul 24, 2017

Ah, just saw that the memory start seems to be 0x60001200 and I found the contents there too.

@ulno
Copy link

ulno commented Jul 25, 2017

Working and implemented in ulno@566a292

You can now trigger the OTA mode via the following:

import machine
machine.RTC().memory("yaotaota")
machine.reset()

After such a reset, the memory will show zaotaota:

import machine
machine.RTC().memory()
machine.RTC().memory()
b'zaotaota'

@hexxter
Copy link

hexxter commented Apr 22, 2018

Hi @ all,
is a better way available as this to start the ota server via remote? My IOT device are build in (wall, housings, ...) and i will make update over the air without press a button. Is this way to write a magic word in the flash the best solution?
Thx Hexxter

@ulno
Copy link

ulno commented Apr 22, 2018

What I described, works pretty well, and is just a small patch to yaota - just check out my fork.

Though recently I have trouble compiling it against head (compare #19) - does the normal yaota still compile against micropython head?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants