ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By alphaomega
#17739 Hi!

So, first off, thanks a lot for all the hard work that has already been done for the ESP8266!
Secondly, I apologize if this is the wrong place to post.

I'm not new to embedded programming or C, but I am new to the ESP8266. I just started playing with an ESP-03 today. I've got a modified CH340 usb to serial adapter (to bring out RTS aswell) + an USB 3.3 volt power supply. I'm running linux Mint.
I've tried to read as much as possible, but this platform is still a bit confusing to me.

I do have a project in mind, so I do have an idea of what I want to achieve, and an HTTP server, preferrably with OTA would be a great first step. So I have cloned pfalcon's development tools and build that (SDK 1.0.1). And then I cloned https://github.com/billprozac/esphttpd (got heatshrink also). It would not build, so I messed with setting environment varirables until I was getting close. Still, a lot of warnings (implicit declarations) so I had to add a few includes here and there until it finally built ok.

Upload seems to work without a hitch, and the WIFI network shows up. However, when I go to http://192.168.4.1/wifi/wifi.tpl, I get an 404 'Not found' response. Had to fiddle with downloading CuteCom-my to have control of RTS and DTR from serial terminal, but finally I could see:

Code: Select allCon req, conn=0x3fff6888, pool slot 0
URL = /wifi/wifi.tpl
Is
url index 11
Magic mismatch. EspFS image broken.
Got 0xc92aa4b/wifi/wifi.tpl not found. 404!
Conn 0x3fff6888 is done. Closing. 


Now, from the build process I can see that website.espfs is being built and it is a binary with data. I can also see that the call to esptool.py includes this data at 0x12000.

Now, I may have borked some configuration somewhere in the process of trying to getting everything working. Or maybe the SDK versions are incompatible (that is esphttpd needs an older SDK) or maybe something has changed in heatshrink.

I'm sorry if this answered somewhere else. I tried searching, but the only other similar problem I found, suggested that the website needs to be built (which I think it is). I really appreciate all and any help! Thanks!

Update: Ok, I have had a look at website.espfs and it seems to have the magic in the beginning (0x53457366) and I can unpack files with espfstest. I also tried not using compression, but still it won't work...

Update 2: Now, I've also tried building against SDK 0.9.3 and 0.9.5. I've tried the original esphttpd (make; make htmlflash;) as well with 0.9.5. No matter what I do, I always end up with the 404 page and 'Magic mismatch' in the console...
I'm starting to run out of ideas here...
User avatar
By hooded_paladin
#17773 Hey alphaomega, I had to fiddle with some environment variables too, and I had the same problem with "magic mismatch" because the EspFS file was flashed to the wrong offset. It took some debugging to find that there's an environment variable "OTA" and you have to define it yourself - it doesn't get auto-configured. OTA selects between two possible layouts, one supports OTA and one doesn't.

I think when OTA=0 then it's appropriate for the makefile command "make flash" and that configuration won't work for OTA.
OTA=1 works for "make flashcloud" and later "make rawflash" which goes over the network.
User avatar
By dacb
#19177 Using esp-open-sdk 1.1.0. In the Makefile, had to change XTENSA_TOOLS_ROOT, SDK_ROOT and SDK_VERSION to reflect my installation. Got rid of SDK_EXTRA_INCLUDES and SDK_EXTRA_LIBS as they didn't appear to be needed.

I can build this with a simple make.

Flashes w/ serial without a problem.

Now I'm trying to figure out the OTA pieces.

When I do a 'make flashcloud OTA=true' the build fails and the output ends with:

Code: Select allAR build/httpd_app.a
LD build/httpd.out
sh: 1: xt-nm: not found
no entry point!!
FW firmware/user1.new.bin
mv: cannot stat ‘eagle.app.flash.bin’: No such file or directory
make: *** [firmware/user1.new.bin] Error 1


Any help would be great! Thanks!