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

Reset or Restart alwayf wdt reset #244

Closed
tontito opened this issue May 15, 2015 · 36 comments
Closed

Reset or Restart alwayf wdt reset #244

tontito opened this issue May 15, 2015 · 36 comments

Comments

@tontito
Copy link

tontito commented May 15, 2015

i have save eeprom ssid and password html and reset esp.

ESP.reset() or
ESP.restart() or
system_reset() or
system_restart() or

i tried code same error
wdtDisable()
ESP.restart()

Error:
ets Jan 8 2013,rst cause:2, boot mode:(1,7)

ets Jan 8 2013,rst cause:4, boot mode:(1,7)

wdt reset

not boot i have hardware reset and working esp.

@Links2004
Copy link
Collaborator

add a pullup resistor to GPIO0 (10k).
for normal boot you need a high (3V3) signal on GPIO0.

@tontito
Copy link
Author

tontito commented May 15, 2015

Yes work.

GPIO0 to 3.3v resistor and
ESP.restart()

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 29504, room 16
tail 0
chksum 0x9c
load 0x3ffe8000, len 1596, room 8
tail 4
chksum 0xf6
load 0x3ffe8640, len 3276, room 4
tail 8
chksum 0xc9
csum 0xc9

boot working normaly.

@tontito tontito closed this as completed May 23, 2015
@phamtankhai2202
Copy link

hi @tontito
i have a problem like you and i don't know resolve... Can you help me?

@phamtankhai2202
Copy link

i tried add pullup resistors to GPIO0 (10k) and GPIO2(10k), but it not work.

ets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset

@asetyde
Copy link

asetyde commented Aug 11, 2015

Also my board not always Reset correctly , I think is strong important that esp.restart() do a reset, if not I will try to use a pin to rst

Sent from my iPhone

On 11 Aug 2015, at 05:23, phamtankhai2202 notifications@github.com wrote:

i tried add pullup resistors to GPIO0 (10k) and GPIO2(10k), but it not work.

ets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset


Reply to this email directly or view it on GitHub.

@igrr
Copy link
Member

igrr commented Aug 11, 2015

Make sure you also have GPIO15 pulled low, and both RST and CH_PD pins pulled high.

@phamtankhai2202
Copy link

yes,ESP.restart() working . when you Upload Code to ESP8266. ESP8266 in mode UART so when restart esp will in mode UART. you should turn off power after use ESP.restart()

@lnsriravichandran22
Copy link

Sorry for asking this Question here.
Is there any option in esp8266 for remembering SSID and Password without storing it in EEPROM?

Thank in Advance!!

@Links2004
Copy link
Collaborator

take a look here:
#724 (comment)

@lnsriravichandran22
Copy link

@Links2004 Thanks a lot for your reference!!. But I could not understand , how it could remember the SSID and PASSWORD, even after the unit is restarted??

@igrr
Copy link
Member

igrr commented Sep 2, 2015

SSID, password, and WiFi mode (AP/STA) are stored in flash memory.
Therefore device will attempt to connect to the last AP, even after reset.

On Wed, Sep 2, 2015, 09:14 Lakshmi Narasimhan Ravichandran <
notifications@github.com> wrote:

@Links2004 https://github.com/Links2004 Thanks a lot for your
reference!!. But I could not understand , how it could remember the SSID
and PASSWORD, even after the unit is restarted??


Reply to this email directly or view it on GitHub
#244 (comment).

@lnsriravichandran22
Copy link

@igrr Thanks for that!!. I have a question now.
If so, then where should we mention the WiFi.begin () in the code? If it is in the void setup(), the code will anyways run it too and this applies for void loop() too right? As @Links2004 said, unless "WiFi.begin()" is called, the unit retains the SSID and PASSWORD set by the user.

@Links2004
Copy link
Collaborator

using WiFi.begin() in the setup is no problem, but you not need to do it.
the cases where you not doing it are for example is you have a configuration process where the you setup the connection once by Web interface, a APP or WPS.
Its also possible to flash one time an a code with the WiFi.begin() begin in setup and after this you can flash other code where you not need to do the begin any more.
to delete the local stored information you can use WiFi.disconnect()

@lnsriravichandran22
Copy link

@Links2004 Thanks a lot for the information!!. Sorry for my Consecutive questions. It would be of a great help if you could post here an example for setting up the connection only once and to use that connection further , unless and until there is a change with the network configuration!!

Thanks in Advance!!

@Links2004
Copy link
Collaborator

a simple SSID check will do it for example:

#define SSID "test123"
#define PW "123456789"

if(String(SSID) != WiFi.SSID()) {
     WiFi.begin(SSID, PW);
}

can be called in setup or loop.

@lnsriravichandran22
Copy link

@Links2004 For the First time, I would use this "WiFi.begin(ssid,password)" to connect with the specified network. Let's say that I am restarting the WiFi Module after successfully connecting with the specified network. As @igrr says #244 (comment), how could I reconnect with the network , without using WiFi.begin() after restarting it. In short , my question is if WiFi.begin () is to be used , whenever there is a change with the network settings, so which command should I use to connect with the network using the ssid and password that are stored already there in the flash memory i.e when there is no change with the ssid and password?

@mtnbrit
Copy link

mtnbrit commented Sep 8, 2015

WiFI.begin(“”,””)

On Sep 8, 2015, at 3:01 AM, Lakshmi Narasimhan Ravichandran notifications@github.com wrote:

@Links2004 https://github.com/Links2004 For the First time, I would use this "WiFi.begin(ssid,password)" to connect with the specified network. Let's say that I am restarting the WiFi Module after successfully connecting with the specified network. As @igrr https://github.com/igrr says #244 (comment) #244 (comment), how could I reconnect with the network , without using WiFi.begin() after restarting it. In short , my question is if WiFi.begin () is to be used , whenever there is a change with the network settings, so which command should I use to connect with the network using the ssid and password that are stored already there in the flash memory i.e when there is no change with the ssid and password?


Reply to this email directly or view it on GitHub #244 (comment).

@Links2004
Copy link
Collaborator

@lnsriravichandran22 you need to do nothing the SDK handle it itself no need for any peace of code.
@mtnbrit the code will Overdrive the flash stored informations

@mtnbrit
Copy link

mtnbrit commented Sep 8, 2015

its working for me.

What IS the right command to start wifi using stored credentials then?

On Sep 8, 2015, at 9:47 AM, Markus notifications@github.com wrote:

@lnsriravichandran22 https://github.com/lnsriravichandran22 you need to do nothing the SDK handle it itself no need for any peace of code.
@mtnbrit https://github.com/mtnbrit the code will Overdrive the flash stored informations


Reply to this email directly or view it on GitHub #244 (comment).

@Links2004
Copy link
Collaborator

no command is needed this mean nothing too do. eaven with a code like this:

void setup(void) {
}

void loop(void) {
}

the SDK will connect to the last wifi configuration :)

the WiFI.begin(“”,””); is only working be course the code check for wrong configurations like an empty SSID.
https://github.com/esp8266/Arduino/blob/esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp#L102
so it do not change the current Wifi settings.

@Humancell
Copy link

I'm curious ... is there a way to have the module only connect when I explicitly request it to? If you are saying it will always connect to the last stored credentials, is there a way - before I go to DeepSleep - to "disconnect" the Wifi and NOT have it reconnect when it wakes ... until I explicitly tell it to?

@Links2004
Copy link
Collaborator

yes WiFi.disconnect(); will do it.

int ESP8266WiFiClass::disconnect(bool wifioff)

@hallard
Copy link
Contributor

hallard commented Nov 10, 2015

Sorry guys, just discovered this very interesting point and I'm wondering if I can have more details?
If SDK memorize AP credential, when do we know when it start trying to connect? and when do we have hand in our code?
IE does I need to wait connection in setup or is it already done when called setup() ?

I'm asking this because I want to manage connexion and I think it's not very optimized to disconnect (because SDK is connected) to plug my connection routine. By the way is it safe calling wifi.begin(bla,bla) when SDK is still trying to connect ?
Does setting SDK autoconnect to 0 (seen calling WiFi.printDiag(Serial);) prevent it doing anything ?

========== SDK Saved parameters Start
Mode: STA
PHY mode: N
Channel: 1
AP id: 0
Status: 0
Auto connect: 0
SSID (12): HOME-HOTSPOT
Passphrase (13): blablabla
BSSID set: 0
========== SDK Saved parameters End

@Links2004
Copy link
Collaborator

sdk docs says:
image

but I have never seen that the value is to be respected by the SDK, it looks like it allways connect to the last settings after boot up.
wifi_station_set_auto_connect is never used in the core.

the easiest way is may simply compare the wifi config with stored one from SDK and if no changes,
no need to call WiFi.begin.

I think its possible change the begin function to do this kind of check internally so that there is no need for the application to keep track of it.

@hallard
Copy link
Contributor

hallard commented Nov 11, 2015

@Links2004
thank for these explanation ;-)

@calozano
Copy link

I got the same issue showing the reset was for watchdog. I just Insert "ESP.wdtDisable();" inside loop and it doesn´t reset again.

@Mewiss
Copy link

Mewiss commented Jan 18, 2016

ESP.wdtDisable(); worked for me but my code had some while's and I had to put this line in each while

@JitenMhatre
Copy link

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld

please help!!!

@Links2004
Copy link
Collaborator

please open a new Issue for you problem and provide more information's,
like core version, your hardware, your code.

@aaszabo
Copy link

aaszabo commented Apr 10, 2016

Hi,
I had the same reboot issue (wdt reset rst cause:4)
After trying many things and ran out of ideas I realized that I changed the ESP panel settings about the FLASH by mistake. Even the upload went well the module was not able to operate. The origin settings was 512k, but I set it to 1M. As the 512k was set back everything went well again.

I hope this helps You too!

@amirebr
Copy link

amirebr commented May 17, 2016

Hi everybody.

To prevent reset, go to:
Tools -> Flash Size: -> 1M(512K SPIFSS)

It solved my reset problem in login to network.

@webliya
Copy link

webliya commented May 28, 2016

Thank you amirebr it saved my day.

amirebr:
To prevent reset, go to:
Tools -> Flash Size: -> 1M(512K SPIFSS)

It solved my reset problem in login to network.

@KamaJogi
Copy link

NodeMCU v1.0 ESP-12E -> This solved my problem:

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
...
}

They conect LED to GPIO16 - this is the case

LED_BUILTIN = D0 = GPIO16 and GPIO16 has Deep-sleep/wake function

look this: https://www.losant.com/blog/making-the-esp8266-low-powered-with-deep-sleep

In this case GPIO16 can't stay floating pin, use: "pinMode(LED_BUILTIN, OUTPUT);" to set pin GPIO16.

For me, this is work even for Adafruit NeoPixel - no "wdt reset" ;)

I don't see this message any more:
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld

@rodrigormelo
Copy link

@KamaJogi Thanks a lot for your tip!!

@asdrubalfuentes
Copy link

asdrubalfuentes commented Jul 1, 2018 via email

@radhey04ec
Copy link

I have solved it !!,
Please try to comment all pin you used in programming and it's related function )like pinMode , digitalWrite etc.

  • Again save and upload it
  • check the serial monitor
  • if you not getting error that means this is because of pin declaration
  • to solve this issue : dont use #define declaration for initialize pin.
    -Direct use pin in pinMode definition and read /write function
  • Use GPIO no in if you are doing it in ARDUINO IDE

May be helpfull

Thanks :
Jaydeep Shah
E-mail : radhey04ec@gmail.com

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