Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Ghil
#34201 Hello,
I have a Esp8266-01 (on Arduino Mega) which works fine with an android application. My problem is that after a few minutes of inactivity, the TCPServer refuse connection ... Android debugger said "failed to connect to /192.168.43.1 (port 80): connect failed: ECONNREFUSED (Connection refused)"
I tried to change the port number, but still failed. As everything starts to work fine when I reset the Arduino, is the esp8266 triggers deep sleep and how to wake up?
Thank you for your help
User avatar
By inx
#34204 Hi.

I don't think the esp goes to sleep automatically. usually you would tell it to sleep:
Code: Select allvoid system_deep_sleep(uint32 time_in_us);


you could observe whats happening and printout some status information (client connects etc...) over the serial.

if you suspect it is sleeping you could also check the wifi sleep_status like this:
Code: Select allenum sleep_type wifi_get_sleep_type(void);


to directly call SDK functions have a look at the CallSDKFunctions example.