khoih-prog / ESP8266_AT_WebServer

This is simple yet complete WebServer library for AVR, Teensy, SAM DUE, SAMD, STM32, nRF52, etc. boards running ESP8266 AT-command shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Now with fix of severe limitation to permit sending much larger data
MIT License
48 stars 8 forks source link

Reboot Mega 2560 if server hostname can't resolve. #5

Closed OLD1976 closed 2 years ago

OLD1976 commented 2 years ago

Hello! I am using your great project and I came across an incomprehensible microcontroller behavior. A bunch of Mega 2560 + ESP 8266 - 07 works for me. ESP8266_AT_WebServer ver. 1.3.0. It accesses the web server as a client by the domain name web.infra. char server[] = "web.infra"; int httpPort = 8000; ESP8266_AT_Client client;

A DNS server on the same host is used to resolve the zone "infra" . The microcontroller receives network parameters from DHCP server. Everything works fine, but if the server becomes unavailable over the network (and the DNS server too!), microcontroller constantly reboots when trying to connect. After the line "[ESP_AT ] Connecting to web.infra", a reboot occurs.

If i"m specify IP, there are no problems. char server[] = "10.10.10.50";

[ESP_AT ] Connecting to 10.10.10.50 Connection failed [ESP_AT] Disconnecting 2

Apparently, if resolving is impossible, a reboot occurs.

khoih-prog commented 2 years ago

Thanks for your interests in the library and your nice words.

I came across an incomprehensible microcontroller behavior.

It's incomprehensible to me to, especially with the limited info you've provided.

It's possible the reset caused by:

As this library is beneficial and designed for WebServer, you can try the WebClient examples using many other libraries, such as

  1. WiFiEsp
  2. WiFiEspAT
  3. ESP_AT_Lib
  4. etc.

to see if it's better

I'm sorry I won't spend time on solving / investigating this issue as the board/shield combination is not popular and old.

I suggest you try switching to the new and better boards, such as ESP32/ESP8266 or Nano_RP2040_Connect / Nano_33_IoT.

Good Luck,