ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By tve
#17491 Thanks for the encouragement! Attached is another patch with a shell script to reflash the esp using curl. It's also added to the Makefile as 'make wiflash' assuming you have set the ESP_HOSTNAME in the makefile (or environment). The shell script takes care of uploading the correct partition and this set-up works quite well for me. I'll probably add a web page to manually upload the firmware, but this may take a few days. I don't really want to do it as long as I can't distinguish between user1.bin and user2.bin in the handler 'cause such as mix-up would be very uncool.

If you want to get started, you will need the SDK 1.0.1 (1.0.0 should also work), flash the boot_v1.3(b3).bin from the SDK's bin directory to 0x00000, flash blank.bin to 0x7E000, flash firmware/user1.bin to 0x01000, then connect to the AP and configure /wifi to hook up to your local AP. After that 'make wiflash' should reflash your puppy...
You do not have the required permissions to view the files attached to this post.
User avatar
By wwpants
#17577 Yes this will be incredibly useful please keep it in the public repo :)

On another note - did you ever figure out the issue with slow WiFi? I know you had mentioned in another forum that you were not getting packets fast?

Thanks
Jay
User avatar
By tve
#17716 At this point I don't expect to do more work on the flashing in the short term. What I have works for me for now. I type 'make wiflash' and it comples, uploads, restarts all in one. I added checks to ensure that a proper firmware gets uploaded but not a user1.bin vs user2.bin check. I looked into it and it's not trivial. The best would be to add a marker into each binary explicitly and check for that.

The next thing would be to download the firmware from a (cloud) server. Similar to what espressif supports but I'd like to be able to download from a github release or something like that. I'm not planning on adding a form-upload page 'cause I don't have a use for it and I find it too error prone (the user1.bin vs. user2.bin thing). Either you're developing your firmware and then 'make wiflash' is the most convenient or you want to consume a ready-made firmware and then might as well download it straight from github.

It would be great for Jeroen to chime in whether he wants to merge in what I did or not. I'm happy to make changes to make it mergable. My stuff is now at https://github.com/jeelabs/esp-link/tree/ota-mods (note ota-mods branch, you can diff with the 'upstream' branch to see everything I changed, the master branch has further changes for my own project).
User avatar
By Sashpi
#18324 Great work tve. This is exactly what I've been looking for although my journey on the OTA part has only just started.
I need to further dive into the work you already did.

Did anybody already manage to do the OTA upgrade for files of >512KB size? The flash locations change at that point and I'm not quite sure how this impacts the process and how the bootloader knows where to load user2.bin from.