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

callback_example upload is fine but it gets a reset after GotIp address #56

Closed
pvdw0310 opened this issue Apr 18, 2018 · 11 comments
Closed

Comments

@pvdw0310
Copy link

Hi, I like to test the callback example and it compiles well and the upload to a esp8266-12F works fine. I start the esp to config, that works also. But then I see on the serial monitor the connection to the router and it shows the GotIp Address 192.168.1.5 like I have set it in the config. Then it dumps and reset esp. That goes on and on. Do you have a advice what I did wrong?
Thanks
Peter

@species5618
Copy link
Collaborator

try a few things,
if you are pre seting the config,json in the data folder
set the NTP interval to 0 and make sure the device name is less than 8 chars
I have been looking into a problem which caused the IP stack to crash, if NTP is enable and the device name is more than 8 chars (mDNS)

or don't upload the config,json, and let it create its own

@pvdw0310
Copy link
Author

Indeed, the device name was esp8266test and longer then 8 chars. Thats not a big problem. The NTP I like to use. Is there a way to fix that?
I use a painlessmesh-network for my home domotica and use Ntp to set the time om my touchscreen.
Thanks
Peter

@species5618
Copy link
Collaborator

With a shorter device name NOT should would. But may need 2 resets after initials code upload
Again something in the Wi-Fi/ IP code i need to understand

@rvangijlswijk
Copy link

rvangijlswijk commented May 4, 2018

I believe I have the same issue. In my case, the device name is the default one ("ESP8266fs") which is indeed 9 characters long.

I did not pre-include a config.json file. I was able to start the ESP in AP mode without a problem, and I configured the WiFi settings over the web interface. Then, I restarted the ESP, and it connects to my WiFi network. Afterwards, a core dump occurs and the ESP reboots again and again. The following exception occurs:

Fatal exception 9(LoadStoreAlignmentCause):
epc1=0x40104b0c, epc2=0x00000000, epc3=0x4024aa57, excvaddr=0x00000003, depc=0x00000000
 
Exception (9):
epc1=0x40104b0c epc2=0x00000000 epc3=0x4024aa57 excvaddr=0x00000003 depc=0x00000000
 
ctx: sys
sp: 3fffead0 end: 3fffffb0 offset: 01a0

Here is the complete Serial output, in case it may help: https://pastebin.com/n2LA6SvV.
@pvdw0310 do you get a similar stack dump?

@pvdw0310
Copy link
Author

pvdw0310 commented May 5, 2018

@rvangijlswijk I stopt working with the call_back example and use only the start_here for the moment. I'am still looking for some other possibilities to use ntp time and setup config website and I like to add a website page that shows some variables( they change often) which are provided by the serial input. I thought to do it with the call_back example .But I don't understand the software behind it.
Do you have an idea if there is some alternatief? Let me know. Thanks

@species5618
Copy link
Collaborator

I am struggling for time at the moment

However I have a project running on this library with a 5 char device name and ntp enabled
Which stayed online for 5+ days

I am still planning to investigate
But is seem to be a problem deep in the core code

@pvdw0310
Copy link
Author

pvdw0310 commented May 6, 2018

@species5618 I appreciate your effort. I hope you can solve the problem. I don't understand the code behind, so for me it is hard to help. If you can send me already what you have, so I can test it out in the meantime. Let me know what you need to send me the code.

@rvangijlswijk
Copy link

I noticed that everything runs stable when using 0 as refresh rate for NTP (effectively disables it). I could use a device name with more than 8 characters without a problem
I'm currently using the following config:

{"ssid":"xxx",
"pass":"xxx",
"ip":[192,168,1,4],
"netmask":[255,255,255,0],
"gateway":[192,168,1,1],
"dns":[192,168,1,1],
"dhcp":true,
"ntp":"pool.ntp.org","NTPperiod":0,"timeZone":10,"daylight":true,
"deviceName":"ESP8266fs"}

As you can see, the device name is 9 characters long, and NTPperiod 0. This config runs stable for me.

@species5618 Once I get the chance, I'll help you out with debugging. I have some ideas that I want to try to see if they solve the problem.

@pvdw0310 what you can do, is disable the NTPperiod, and use a different NTP library for the meantime. The NTP library used by this lib is "NTPClient" from the same author, but there are others available. So maybe you can manually implement a different ntp lib in your main .ino code.

@species5618
Copy link
Collaborator

Re debug
I got as far as enabling all the debug in NTP client
And the crash occurs immediately after the UDP time request is sent

So I believe it a lwip problem / mdns
I was about to try disabling mdns as I don't use it
(That is the main use for the device name , as far as I can tell) when I got dragged onto a non IT problem taking my spare time

@pvdw0310
Copy link
Author

Hi, Back again. I like to change the starthere without the callback routine and nothing is working any more like before. Before I could use the NTP service, after the last update it stoped working. Can you put the old version back? thank

@flurl
Copy link
Contributor

flurl commented Sep 25, 2018

I think, it's just a coincidence that the crash is related to the UDP request. You can try using different delays in AsyncFSWebServer::onWiFiConnectedGotIP() and it will crash without even calling something NTP related.
My guess is, that it's just taking to much time in a callback, as in any case I tried the program counter pointed to ets_timer_setfn. Sounds like something related to timing.
Perhaps you could try my fix where I just set a flag in the callback and update the time in AsyncFSWebServer::handle()
See flurl@904284a
This way it works for me, though I have no idea, why it might be related to the device name

@gmag11 gmag11 closed this as completed in 904284a Jun 22, 2019
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

4 participants