-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Connection to static IP fails #3489
Comments
Have you tried testing this with other micro controllers? May be due to the timers within the chip... Although this is just theorising |
@bbkiwi I have similar problem. |
I have not solved it. I have been programming using nonos directly and just
wanted to see
if the similar problem occurred using Arduino ide (which it did hence me raising
the issue).
Once it starts refusing to connect, if I reset my router, it will connect again
to specified IP.
|
Try this:
Regards |
@bbkiwi @lrmoreno007 is this still valid with latest git? |
I don't have problems. |
Hello, please try to check the reset reason!
The the problem should never occur. |
Hello I think I have understood the Problem, see description below:
|
Your comment about turning off the wifi fixed my issues, thanks. this snippet is what makes all your static ip problems go away (at least for the ESP8266).
|
I prefer to set at the first line within the setup: WiFi.setAutoConnect(false); The you will also have no problems anymore |
Hi, Which solution would be the best, power consuming talking: Thanks |
When you know you nerd wifi then boot with wifi. |
About power saving we now have
BTW, any good battery-powered example is welcome. |
I have one good example |
Take this adapter: and use a Voltage controller up to 6 V or up to 13 V. |
@d-a-v I'm not sure this is a good example for you, but it's good enough for me. |
Or you can take this one for the small Brother: |
The lowest power ESP device I have tried is with following code: https://github.com/happytm/BatteryNode It is work in progress but I have tested it for about a month and I am hoping to run it for ever without ever changing coin cell battery I use (LIR2450). I use 53x30 mm micro solar panel to charge it using TP4056 charge controller. ESP8266 is bear bone ESP12 chip with BME280. Very inexpensive and most power efficient setup. The most power saving come from code as it requires very little uptime. Thanks |
Description
In the attached sketch, having a small delay at the beginning of setup() seems to cause connection to a static IP to fail.
The code below produces the error: it fails to connect. I expected it connect quickly using static IP, but it usually fails to connect at all or takes a very long time. If I try a new static IP, sometimes it seems to connect once, but after resetting or even recompiling and loading fails from then on.
In the example, If either the delay(500); or WiFi.config(staticIP, gateway, subnet); is commented out
the problem goes away. Connection to the static IP is very fast or connection to the assigned IP as usual. Upon reset or power on, connects each time.
(I looked at issue #128 but the problem is there with either order of config and begin)
Of course the solution is not to put a delay, but it is a puzzle why this happens :-)
Settings in IDE
Module: NodeMCUv1.0 (ESP 12E module)
Flash Size: 4M(3M spiff)
CPU Frequency: 80Mhz
Upload Using: SERIAL 256000
The text was updated successfully, but these errors were encountered: