r-downing / wifi-sous-vide

WiFi-controlled Sous Vide on ESP8266 (arduino)
19 stars 8 forks source link

Crashes before can connect to Sous Vide web server? #5

Closed cymen closed 6 years ago

cymen commented 6 years ago

I can get it to boot up and appear as an access point named Sous Vide however if I try to connect to it via an Android device or a Mac desktop, it eventually crashes like so:

setup complete.

Exception (28):
epc1=0x40212e9e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3fff0f70 end: 3fff1260 offset: 01a0

>>>stack>>>
3fff1110:  3ffe8cd4 3ffefa44 3fff1140 3ffefac8  
3fff1120:  3ffe8cd4 3ffefa44 3fff114c 4020f766  
3fff1130:  3ffe8cd4 3ffefa44 3ffefa20 4020cf3d  
3fff1140:  00000000 00000000 00000000 3fff3a24  
3fff1150:  0000000f 00000000 3fff3024 0000000f  
3fff1160:  0000000a 00000000 00000000 4021f45b  
3fff1170:  401068c0 00000004 00037011 3fff300c  
3fff1180:  0000000f 00000000 3fff3a6c 0000000f  
3fff1190:  00000000 3fff3164 0000000f 00000001  
3fff11a0:  3fff8584 0000000f 00000008 3fff48fc  
3fff11b0:  0000000f 00000003 3fff8c94 0000007f  
3fff11c0:  00000074 3fff1210 3ffefa20 4020a0c0  
3fff11d0:  3ffefa60 00000000 3fff3054 4020a7b0  
3fff11e0:  3ffe90a8 00000000 4020adf0 0000000a  
3fff11f0:  00000000 3fff3f14 3ffefa20 3fff022c  
3fff1200:  00000001 3ffefa44 3ffefa20 4020bbbb  
3fff1210:  3ffe90a8 00000000 00001388 4020d2fd  
3fff1220:  00000000 3fff3f14 3ffefb7c 401069b9  
3fff1230:  3fffdad0 00000000 3fff0225 40207326  
3fff1240:  3fffdad0 00000000 3fff0225 402100c0  
3fff1250:  feefeffe feefeffe 3fff0240 40100710  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,0)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld

I'm using the most recent versions of the required libraries via the Arduino library manager.

cymen commented 6 years ago

The problem appears to be that the home page does a 302 which causes Chrome on Mac to keep requesting over and over. I think that is what is making it crash. If I instead access this URL:

http://192.168.1.1/io

I get a JSON response without issue:

{"temperature":69.0125,"setTemp":0,"power":0,"running":false,"upTime":0,"errors":[]}

This is just powering on, connecting to Sous Vide AP and then attempting to access it. Should the wifi part be prompting me for joining to the AP? I wonder if the sketch is starting up too soon. The part I'm missing is what is actually serving at the root URL. I guess that goes right off to SPIFFS and maybe there is an index.html or something there? I'll go look.

cymen commented 6 years ago

So I see the files -- it's almost like anything that comes from SPIFFS causes a 302. The directly handled URLs work. So I'm not sure what is broken and/or what to try next. I did try downgrading the SPIFFSReadServer to 0.0.3 from 0.0.4 but that didn't help.

cymen commented 6 years ago

I had a chance to look at this again and I realized SPIFFS didn't work how I thought it did -- I didn't realize I needed a separate tool to upload data to SPIFFS. With that, it works!

If anyone else ends up here, what you want to do is go install this and run it after flashing the ESP8266 (or any time you change something in data directory):

https://github.com/esp8266/arduino-esp8266fs-plugin

I did realize though there is a bug in SPIFFSReadServer. I'll do a PR to fix that later today.

RainmanJS commented 6 years ago

@cymen Can you tell me what the error you found was in SPIFFSReadServer? I can't seem to get the front page to handle requests correctly, I'm wondering if that's part of the issue?

cymen commented 6 years ago

@RainmanJS So I got it working but I still couldn't set the temp or anything via the page -- the only thing that worked was clicking on a recipe. So I updated the recipes.htm file in data subdirectory for my cook and used that. The error is in how 404s are handled but you shouldn't hit that as long as you have the data directory flashed to SPIFFS.