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

Webserver unreachable with static IP set. #1291

Closed
aero83 opened this issue Apr 21, 2018 · 23 comments
Closed

Webserver unreachable with static IP set. #1291

aero83 opened this issue Apr 21, 2018 · 23 comments
Labels
Category: Wifi Related to the network connectivity Status: Fixed Commit has been made, ready for testing

Comments

@aero83
Copy link

aero83 commented Apr 21, 2018

Summarize of the problem/feature request

WEmos D1 Mini.
When I set static ip, webserver unreachable, serial debug output as follows. Always shows NTP server unreachable.
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

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

INIT : Booting version: mega-20180420 (core 2_4_0)
60 : INIT : Warm boot #7
61 : FS : Mounting...
86 : FS : Mount successful, used 75802 bytes of 957314
405 : CRC : program checksum ...OK
409 : CRC : Settings CRC ...FAIL
411 : CRC : SecuritySettings CRC ...OK
517 : INIT : Free RAM:18432
518 : INIT : I2C
518 : INIT : SPI not enabled
534 : INFO : Plugins: 72 [Normal] [Testing] [Development] (core 2_4_0)
534 : WIFI : Switch on WiFi
535 : WIFI : Set WiFi to STA
536 : WIFI : Connecting NSA attempt #0
555 : WD : Uptime 0 ConnectFailures 0 FreeMem 17696
3614 : WIFI : Connected! AP: NSA (2C:30:33:F6:EA:27) Ch: 6 Duration: 3076 ms
3614 : IP : Static IP : 192.168.10.60 GW: 192.168.10.1 SN: 255.255.255.0 DNS: 192.168.10.1
3618 : WIFI : Static IP: 192.168.10.60 (ESP-Easy-0) GW: 192.168.10.1 SN: 255.255.255.0 duration: 5 ms
3640 : Webserver: start
14219 : Host unreachable: 0.0.0.0
14219 : NTP : NTP host 0.us.pool.ntp.org (0.0.0.0) unreachable

Expected behavior

YOUR TEXT GOES HERE

Actual behavior

YOUR TEXT GOES HERE

Steps to reproduce

  1. Flash mega-20180420 (core 2_4_0), dev 4096 also occurred on 2018417 build
  2. Set static ip.
  3. reboot
  4. unreachable webserver and serial debug output above.

System configuration

Hardware:

ESP Easy version: mega-20180420 (core 2_4_0) also occurred on 2018417 build

ESP Easy settings/screenshots:

Rules or log data


@Budman1758
Copy link

I had the exact same problem.

@TD-er
Copy link
Member

TD-er commented Apr 21, 2018

Yesterday I added a commit that should solve this.
Could you test with the latest code?

@stafil
Copy link

stafil commented Apr 21, 2018

I try latest release, bat not working. thx

@v-a-d-e-r
Copy link

v-a-d-e-r commented Apr 21, 2018

No issue here with static IP. 😁

@TD-er
Copy link
Member

TD-er commented Apr 21, 2018

@stafil What do you mean with "bat not working" ?

@ghtester
Copy link

ghtester commented Apr 21, 2018

Hello, I have also encountered an issue after upgrade from mega 2.0.0 dev 11 to mega-20180421 test on NodeMCU Amica. There's a rule which beeps on a boot and use IR receiver plugin to control relay. No other plugin is used. Also the Fixed IP Octet is configured. After the successfull OTA firmware upgrade the device rebooted itself, then I heard 3 beeps (so three times rebooted), then I could access it on configured fixed IP address by PING but the web interface is not accessible anymore. When unplugged from power and plug again, several beeps heard (first almost immediately, next after about 10 sec) until device get connected to AP. The IR plugin and rule looks working but the web interface is dead.
Update: after some time (don't know when exactly, checked after several hours) the device hanged completely. Maybe the factory reset is necessary when upgrading to recent firmware releases, can't do it at the moment - later I'll connect to serial to check what's going on there.

@giig1967g
Copy link
Contributor

Hi am facing the same problem: no access to the web interface.
I use static IP.
Everyting was fine until 20180402.
Yesterday's version didn't solve for me.

@giig1967g
Copy link
Contributor

Tried 20180421 version with DHCP but could not access webinterface either.

@v-a-d-e-r
Copy link

v-a-d-e-r commented Apr 21, 2018

I don't know what you guys are doing, but I flashed the firmware from tonight, just to reproduce your issues, but it works!

  • Wifi setup with AP mode: ok
  • DHCP: ok
  • Static IP: ok
  • Web server: ok

TD-er made all right. So, you are making something wrong!

@TD-er
Copy link
Member

TD-er commented Apr 21, 2018

Like I said in another thread, there are a lot of issues which are hard to reproduce.
So could you please give more information on what settings are being used.
Also used plugins and controllers and notifications (email/buzzer)

@v-a-d-e-r
Copy link

v-a-d-e-r commented Apr 21, 2018

This was a test under real conditions. I installed it on a fresh and clean flash chip. Only so you can be sure, that there is no crap left from a previous installation or config. No task, no rule, yet. And that works! ;-)

@weisskopfjens
Copy link
Contributor

weisskopfjens commented Apr 21, 2018

I have check both settings. For me DHCP and Static IP work. I do a reset (factoryreset) between the two settings. My version is mega-20180421 build in platformIo. Hardware is NodeMCU 1.0 amica ESP8266.

@szwigiel
Copy link

szwigiel commented Apr 21, 2018

Feuerreiter,
First try to totally clear (erase) your ESP through "ESP FLASH DOWNLOAD TOOL V3.6.4". It helped me.

@ghtester
Copy link

ghtester commented Apr 22, 2018

Just tried to reset settings through serial console, configured only wifissid and wifikey, saved settings and rebooted. After reboot ESP connected to AP, reported Settings CRC FAIL, it's accessible via PING but the web console is still dead...

So it looks there's an issue with saving config and even reset does not help.

Any hint what could be tested except total ESP clear?

reset
RESET: Resetting factory defaults...
RESET: Warm boot, reset count: 0
RESET: formatting...
RESET: formatting done...
667097 : FILE : Saved config.dat
667130 : FILE : Saved security.dat
RESET: Succesful, rebooting. (you might need to press the reset button if you've justed flashed the firmware)

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

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9

...
...

INIT : Booting version: mega-20180421 (ESP82xx Core 2_4_0)
65 : INIT : Warm boot #1
66 : FS : Mounting...
91 : FS : Mount successful, used 75802 bytes of 957314
409 : CRC : program checksum ...OK
413 : CRC : Settings CRC ...FAIL
442 : CRC : SecuritySettings CRC ...OK
548 : INIT : Free RAM:18384
548 : INIT : I2C
548 : INIT : SPI not enabled
564 : INFO : Plugins: 71 [Normal] [Testing] (ESP82xx Core 2_4_0)
565 : WIFI : Switch on WiFi
565 : WIFI : Set WiFi to STA
567 : WIFI : Connecting IOTAP attempt #0
574 : WD : Uptime 0 ConnectFailures 0 FreeMem 17464
4548 : WIFI : Connected! AP: IOTAP (xx:xx:xx:xx:xx:xx) Ch: 4 Duration: 3980 ms
8196 : WIFI : DHCP IP: 192.168.0.14 (ESP-Easy-0) GW: 192.168.0.1 SN: 255.255.255.0 duration: 3647 ms
8199 : Webserver: start
222461 : WD : Uptime 1 ConnectFailures 0 FreeMem 9112
252461 : WD : Uptime 1 ConnectFailures 0 FreeMem 9168
282461 : WD : Uptime 2 ConnectFailures 0 FreeMem 9168
478545 : WD : Uptime 2 ConnectFailures 0 FreeMem 9112
508544 : WD : Uptime 3 ConnectFailures 0 FreeMem 9168
538544 : WD : Uptime 3 ConnectFailures 0 FreeMem 9168
739153 : WD : Uptime 4 ConnectFailures 0 FreeMem 4208
769153 : WD : Uptime 4 ConnectFailures 0 FreeMem 4264
799153 : WD : Uptime 5 ConnectFailures 0 FreeMem 4264
829153 : WD : Uptime 5 ConnectFailures 0 FreeMem 4264
859153 : WD : Uptime 6 ConnectFailures 0 FreeMem 4264
889153 : WD : Uptime 6 ConnectFailures 0 FreeMem 4264
919153 : WD : Uptime 7 ConnectFailures 0 FreeMem 4264
949153 : WD : Uptime 7 ConnectFailures 0 FreeMem 4264
979153 : WD : Uptime 8 ConnectFailures 0 FreeMem 4264
1009153 : WD : Uptime 8 ConnectFailures 0 FreeMem 4264
1039153 : WD : Uptime 9 ConnectFailures 0 FreeMem 4264
1069153 : WD : Uptime 9 ConnectFailures 0 FreeMem 4264
1099153 : WD : Uptime 10 ConnectFailures 0 FreeMem 4264

@TD-er
Copy link
Member

TD-er commented Apr 22, 2018

You're not running the latest code.
And while you're at it, I will push an update in a few minutes to give the accesspoint some slack by adding some delay between attempts.
The current implementation does retry immediately and I've noticed my own Fritzbox accesspoints don't like that very well.
I had to reboot them all a few times in the last week to be able to connect to them.

@ghtester
Copy link

ghtester commented Apr 22, 2018

Yes that's the latest release with settings CRC, I did not update to today's code yet just for the case if there's anything to be debugged.
I think there's no problem with connection in my case as the ESP device is still PINGable but the webserver does not work. It's strange as the configuration was reset to defaults, only primary wifi SSID / key was entered through serial console and the IP address is DHCP.
Update:
BTW. after some time device disconnected from AP and switched to AP mode (No AP found probably because of weak WiFi signal - there's just one attempt?):
455490 : WD : Uptime 29 ConnectFailures 0 FreeMem 4264
2485490 : WD : Uptime 30 ConnectFailures 0 FreeMem 4264
2503486 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 41 m 38 s
2503487 : Webserver: stop
2503487 : WIFI : Connecting IOTAP attempt #0
2505633 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2143 ms
2505634 : WIFI : Connection Failed
2505734 : WIFI : Set WiFi to AP
2506623 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
2515490 : WD : Uptime 30 ConnectFailures 0 FreeMem 13728
2545490 : WD : Uptime 31 ConnectFailures 0 FreeMem 13728
2575490 : WD : Uptime 31 ConnectFailures 0 FreeMem 13728
2605490 : WD : Uptime 32 ConnectFailures 0 FreeMem 13728
2635490 : WD : Uptime 32 ConnectFailures 0 FreeMem 13728
2665490 : WD : Uptime 33 ConnectFailures 0 FreeMem 13728
2695490 : WD : Uptime 33 ConnectFailures 0 FreeMem 13728
2725490 : WD : Uptime 34 ConnectFailures 0 FreeMem 13728

....

I was able to connect and see the WiFi select webpage
....

8035506 : WD : Uptime 122 ConnectFailures 0 FreeMem 13728
8065514 : WD : Uptime 123 ConnectFailures 0 FreeMem 13728
8095517 : WD : Uptime 123 ConnectFailures 0 FreeMem 13728
8125519 : WD : Uptime 124 ConnectFailures 0 FreeMem 13728
8126812 : AP Mode: Client connected: XX:XX:XX:XX:XX:XX Connected devices: 1
8126813 : Webserver: start
8155519 : WD : Uptime 124 ConnectFailures 0 FreeMem 12624

.....
When entered the same SSID and key as configured earlier through serial console:

185519 : WD : Uptime 125 ConnectFailures 0 FreeMem 12624
8215519 : WD : Uptime 125 ConnectFailures 0 FreeMem 12624
8231784 : WIFI : Set WiFi to AP
8245519 : WD : Uptime 126 ConnectFailures 0 FreeMem 10240
8275519 : WD : Uptime 126 ConnectFailures 0 FreeMem 10240
8305519 : WD : Uptime 127 ConnectFailures 0 FreeMem 10240
8335519 : WD : Uptime 127 ConnectFailures 0 FreeMem 10240
8346155 : WIFI : Set WiFi to AP+STA
8346158 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
8346159 : Webserver: stop
8346159 : WIFI : Connecting IOTAP attempt #0
8346162 : WIFI : Credentials Changed, retry connection. SSID: IOTAP
8346218 : WIFI : Connecting IOTAP attempt #0
8348156 : WIFI : Connected! AP: IOTAP (xx:xx:xx:xx:xx:xx) Ch: 4 Duration: 1937 ms
8353785 : WIFI : DHCP IP: 192.168.0.14 (ESP-Easy-0) GW: 192.168.0.1 SN: 255.255.255.0 duration: 5629 ms
8353786 : Webserver: start
8353848 : FILE : Saved config.dat
8365519 : WD : Uptime 128 ConnectFailures 0 FreeMem 8480
8367429 : FILE : Saved config.dat
8395519 : WD : Uptime 128 ConnectFailures 0 FreeMem 8696
8425519 : WD : Uptime 129 ConnectFailures 0 FreeMem 8696
8428092 : WIFI : AP Mode Disabled for SSID: ESP_Easy_0
8428092 : WIFI : Set WiFi to STA
8428107 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 1 m 19 s
8428108 : Webserver: stop
8428109 : WIFI : Connecting IOTAP attempt #0
8428114 : AP Mode: Client disconnected: XX:XX:XX:XX:XX:XX Connected devices: 0
8430256 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2146 ms
8430257 : WIFI : Connection Failed
8430358 : WIFI : Set WiFi to AP
8431247 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
8435489 : AP Mode: Client connected: XX:XX:XX:XX:XX:XX Connected devices: 1
8435490 : Webserver: start
8437264 : AP Mode: Client disconnected: XX:XX:XX:XX:XX:XX Connected devices: 0
8455519 : WD : Uptime 129 ConnectFailures 0 FreeMem 11288
8485519 : WD : Uptime 130 ConnectFailures 0 FreeMem 11288
8515519 : WD : Uptime 130 ConnectFailures 0 FreeMem 11288
8545519 : WD : Uptime 131 ConnectFailures 0 FreeMem 11288
8604640 : AP Mode: Client connected: XX:XX:XX:XX:XX:XX Connected devices: 1
8605519 : WD : Uptime 132 ConnectFailures 0 FreeMem 10240
8635519 : WD : Uptime 132 ConnectFailures 0 FreeMem 10240
8665519 : WD : Uptime 133 ConnectFailures 0 FreeMem 10240
8680302 : WIFI : Set WiFi to AP
8695521 : WD : Uptime 133 ConnectFailures 0 FreeMem 10240
8725523 : WD : Uptime 134 ConnectFailures 0 FreeMem 10240
8731291 : WIFI : Set WiFi to AP+STA
8731293 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
8731295 : Webserver: stop
8731295 : WIFI : Connecting IOTAP attempt #0
8731298 : WIFI : Credentials Changed, retry connection. SSID: IOTAP
8731352 : WIFI : Connecting IOTAP attempt #0
8733247 : WIFI : Connected! AP: IOTAP (xx:xx:xx:xx:xx:xx) Ch: 4 Duration: 1893 ms
8737185 : WIFI : DHCP IP: 192.168.0.14 (ESP-Easy-0) GW: 192.168.0.1 SN: 255.255.255.0 duration: 3938 ms
8737186 : Webserver: start
8737246 : FILE : Saved config.dat
8753292 : FILE : Saved config.dat
8755523 : WD : Uptime 134 ConnectFailures 0 FreeMem 8696


On second attempt the ESP connected to AP and got IP address from DHCP, it was reachable through PING but web config still did not respond.

@TD-er TD-er added Category: Wifi Related to the network connectivity and removed Category: Wifi Related to the network connectivity labels Apr 22, 2018
@IlluminatMartin
Copy link

Hi,
I has also instaled today the last version (ESP_Easy_mega-20180501_test_ESP8266_4096) and my static IP is also not working. the modules use the IP from DHCP what they get from the initial phase.

@TD-er
Copy link
Member

TD-er commented May 1, 2018

Can you add a log via serial output, with the log level set to "Debug More" ?
That level does include the internal log of the Arduino library, which states enable/disable of DHCPclient.

Is it a binary built in the daily build, or one you built yourself?

@stafil
Copy link

stafil commented May 2, 2018 via email

@stafil
Copy link

stafil commented May 2, 2018 via email

@TD-er TD-er added the Status: Fixed Commit has been made, ready for testing label May 2, 2018
@IlluminatMartin
Copy link

Hi,
in oposite to older versions it works it works if you (or I) fill every value (GW, Subnet, DNS) .
In older versions it was enought to fill just the IP field.
So I "solved" my problem

thanks
Andy

@TD-er
Copy link
Member

TD-er commented May 4, 2018

OK, that's an interesting point you make.
Maybe we should make some kind of explicit enable/disable static IP and set some kind of defaults for the static settings, which can be changed if desired.
Or... we must warn the user if not all is set.

TD-er added a commit to TD-er/ESPEasy that referenced this issue Oct 13, 2018
@TD-er
Copy link
Member

TD-er commented Oct 13, 2018

The last remark is now implemented in PR #1901
I'll close this one now.
If it is still a bug, please re-open.

@TD-er TD-er closed this as completed Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Wifi Related to the network connectivity Status: Fixed Commit has been made, ready for testing
Projects
None yet
Development

No branches or pull requests

10 participants