{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/816","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/816/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/816/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/816/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/816","id":120566939,"number":816,"title":"Initial rBoot bootloader implementation","user":{"login":"raburton","id":433543,"avatar_url":"https://avatars.githubusercontent.com/u/433543?v=3","gravatar_id":"","url":"https://api.github.com/users/raburton","html_url":"https://github.com/raburton","followers_url":"https://api.github.com/users/raburton/followers","following_url":"https://api.github.com/users/raburton/following{/other_user}","gists_url":"https://api.github.com/users/raburton/gists{/gist_id}","starred_url":"https://api.github.com/users/raburton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raburton/subscriptions","organizations_url":"https://api.github.com/users/raburton/orgs","repos_url":"https://api.github.com/users/raburton/repos","events_url":"https://api.github.com/users/raburton/events{/privacy}","received_events_url":"https://api.github.com/users/raburton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-12-05T15:51:00Z","updated_at":"2016-01-19T15:56:50Z","closed_at":null,"body":"After discussion in #806 (and as previously requested in #477) I have prototyped rBoot integration into nodemcu. You can find it here: https://github.com/raburton/nodemcu-firmware/tree/rboot\r\n\r\nThis allows you to have two versions of nodemcu-firmware on the device at the same time, switch between them and perform over the-air-updates (OTA).\r\n\r\nYou can use the following commands to interact with it:\r\n`print(rboot.rom())` - prints the current running rom number (0 or 1).\r\n`rboot.swap()` - change the active rom and reboot into it\r\n`rboot.ota()` - perform an OTA update of the rom\r\n`rboot.otafs()` - perform an OTA update of the spiffs (for the other rom, not the current one!)\r\n\r\nYou will need:\r\n- A nodemcu devboard or other esp8266 device with 2mbyte flash or larger. Support for 512k devices is impossible (no way to fit two 450k roms on a 512k flash), 1mb devices is just about possible but requires a slightly different approach and more changes to the build system.\r\n- esptool2 from https://github.com/raburton/esptool2/tree/master add it to your path or define the env var esptool2 to point to the binary.\r\n- A decent webserver to serve the OTA rom from (Apache/IIS would be fine, some people have had trouble with python web server modules).\r\n\r\nInstructions:\r\n- Checkout the rboot branch from my nodemcu-firmware fork.\r\n- Edit app/include/user_config.h and set the details for your ota webserver.\r\n- Build as normal.\r\n- Flash rboot.bin to 0x00000, eagle.app.v6.bin to 0x02000.\r\n- Copy eagle.app.v6.bin to the root of your webserver and rename it to whatever file name you gave in user_config.h\r\n- Run `print(rboot.rom())` and check it returns 0.\r\n- Connect to wifi.\r\n- Run `rboot.ota()` and wait a minute, a second copy of the rom will be flash and the device will reboot into this rom.\r\n- Run `print(rboot.rom())` and check it now returns 1.\r\n"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/172897473","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/816#issuecomment-172897473","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/816","id":172897473,"user":{"login":"raburton","id":433543,"avatar_url":"https://avatars.githubusercontent.com/u/433543?v=3","gravatar_id":"","url":"https://api.github.com/users/raburton","html_url":"https://github.com/raburton","followers_url":"https://api.github.com/users/raburton/followers","following_url":"https://api.github.com/users/raburton/following{/other_user}","gists_url":"https://api.github.com/users/raburton/gists{/gist_id}","starred_url":"https://api.github.com/users/raburton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raburton/subscriptions","organizations_url":"https://api.github.com/users/raburton/orgs","repos_url":"https://api.github.com/users/raburton/repos","events_url":"https://api.github.com/users/raburton/events{/privacy}","received_events_url":"https://api.github.com/users/raburton/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T15:56:50Z","updated_at":"2016-01-19T15:56:50Z","body":"> Was just searching for this feature, great to see someone working on it :) unfortunately I'm not familiar with building NodeMCU so haven't had a chance to test it out.\r\n\r\nI think this is the problem, nodemcu is a distributed as a binary which users flash once and forget about, only working with their apps afterwards. Unlike, for example sming or sdk apps, where the framework forms part of the same rom. Sure, you can get nodemcu as source, but unless you are looking to fix it or add to it why would you? And perhaps much of it's target audience running are just learning a bit of programming with lua scripts so wouldn't be in a position to do these things anyway.\r\n\r\nTo be useful it doesn't need to be something users play with, it needs to be built in to the official rom and the ota updates put on the projects own server so that users can just use it when a new version is released."}}