Chat freely about anything...
User avatar
By tigers75
#73941 I'm experiencing a very strange problem while connecting to a webserver on the ESP8266 (a NODEMCU 1.0 clone, the code is based on the Advanced webserver example, so the page is just a very long concatenated string): everything works fine as long as I connect from my local wi fi network (even different SSID via some repeaters, but all with the same router/modem as a gateway).
Then I configured port forwarding on my router and a dynamic DNS service as usual and still everything works fine if I call the dydns.xxx/port while connected from my wifi.

If I disconnect from the wifi and access via 3G (or if I access via a 3G router - so the phone is in wifi, but the connection comes form the outside) suddenly something strange happens: page starts to load but stops right after - with "stops" I mean that the wheel keeps turning like data is being received, but the page never loads fully; if I insist after some retries it works but the page got corrupted (some parts are messed up - it skips a little part of some css definitions). From this point on the page is corrupted in the same way even if I access it from inside my network: the string is sent only partially, but it's always the same, corrupted, string, like something changed in the FLASH of the ESP8266.
If I reset the ESP8266 everything is back to normal until I access from outside my network.

So I tried to upload the Advancedwebserver example and the problem is the same: form inside my network all is OK, form the outside the Hello page shows up only until it loads the graph, that never gets there.

I strongly suspect my router setup or my ISP, because I tired to setup some webserver before changing ISP (that forces me to use his own router, so I'm stuck with that), but I don't know what to check; so far I can say that:
- The port forwarding is OK, the local IP is OK, the port is 851, that should be in a "free" range;
- I access other devices on my network from the outside just forwarding the ports;
- manually inserting my IP instead of using the dyndns service doesn't change a thing;
- I tried putting the machine in the DMZ, nothing changes;
- If I don't insist in connecting from the outside the page does not load but does not get corrupted either; after it corrupts it stays corrupt;
- if I insist the page in the end shows up even from the outside, so I know I am pointing to the device.

Do you have any clue in what I could check?

EDIT: after trying out everything I discovered it's a problem with lwIP v.1.4, that I was using because v2.0 has a bug that prevents DNS resolving. I manually set the DNS server to Google 8.8.8.8 and switched back to lwIP v2.0 and everything is OK.