Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

ESP32 Connection Failure after esp-idf update

Hi All,
Currently I am using esp-idf v2.0 release along side mongoose networking library 6.7.1. I tried updating to esp-idf v2.1 and ran into an issue with wifi stability. The ESP32 is still able to connect to an AP, but after about a minute of successful communication it begins to fail to create a connection to our remote server. There is no indication that it disconnected from the AP. I have updated mongoose to 6.10 to try to fix this, but the same issues persisted. I am unsure if the problem lies with esp-idf, mongoose or my code, but I am just looking for any insight, if any one else has ran into similar problems, or if anyone can make more sense out of the below logs than I can.

Here are my logs from a successful connection to a AP within 15 ft (with ip addresses obscured):
mg_socket_if_init 0x3ffe1280 using select()
mg_mgr_init_opt ==================================
mg_mgr_init_opt init mgr=0x3ffe1280
mg_connect_http_base http://IPADDRESS/index.php/v1/device use_ssl? 0 tcp://IPADDRESS:80
mg_do_connect 0x3ffeeb30 tcp://IPADDRESS:80
mg_socket_if_connect 0x3ffeeb30 sock 3 rc -1 errno 119 err 0
mg_add_conn 0x3ffe1280 0x3ffeeb30
mg_mgr_handle_conn 0x3ffeeb30 fd=3 fd_flags=2 nc_flags=8 rmbl=0 smbl=19530
mg_if_connect_cb 0x3ffeeb30 connect, err=0
mg_call 0x3ffeeb30 proto ev=2 ev_data=0x3ffe1190 flags=0 rmbl=0 smbl=19530
mg_call 0x3ffeeb30 user ev=2 ev_data=0x3ffe1190 flags=0 rmbl=0 smbl=19530
mg_call 0x3ffeeb30 after user flags=0 rmbl=0 smbl=19530
mg_call 0x3ffeeb30 after proto flags=0 rmbl=0 smbl=19530
mg_write_to_socket 0x3ffeeb30 5840 bytes -> 3
mg_if_sent_cb 0x3ffeeb30 5840
mg_call 0x3ffeeb30 proto ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=13690
mg_call 0x3ffeeb30 user ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=13690
mg_call 0x3ffeeb30 after user flags=0 rmbl=0 smbl=13690
mg_call 0x3ffeeb30 after proto flags=0 rmbl=0 smbl=13690
mg_mgr_handle_conn 0x3ffeeb30 after fd=3 nc_flags=0 rmbl=0 smbl=13690
mg_mgr_handle_conn 0x3ffeeb30 fd=3 fd_flags=2 nc_flags=0 rmbl=0 smbl=13690
mg_write_to_socket 0x3ffeeb30 3720 bytes -> 3
mg_if_sent_cb 0x3ffeeb30 3720
mg_call 0x3ffeeb30 proto ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=9970
mg_call 0x3ffeeb30 user ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=9970
mg_call 0x3ffeeb30 after user flags=0 rmbl=0 smbl=9970
mg_call 0x3ffeeb30 after proto flags=0 rmbl=0 smbl=9970
mg_mgr_handle_conn 0x3ffeeb30 after fd=3 nc_flags=0 rmbl=0 smbl=9970
mg_mgr_handle_conn 0x3ffeeb30 fd=3 fd_flags=2 nc_flags=0 rmbl=0 smbl=9970
mg_write_to_socket 0x3ffeeb30 5840 bytes -> 3
mg_if_sent_cb 0x3ffeeb30 5840
mg_call 0x3ffeeb30 proto ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=4130
mg_call 0x3ffeeb30 user ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=4130
mg_call 0x3ffeeb30 after user flags=0 rmbl=0 smbl=4130
mg_call 0x3ffeeb30 after proto flags=0 rmbl=0 smbl=4130
mg_mgr_handle_conn 0x3ffeeb30 after fd=3 nc_flags=0 rmbl=0 smbl=4130
mg_mgr_handle_conn 0x3ffeeb30 fd=3 fd_flags=2 nc_flags=0 rmbl=0 smbl=4130
mg_write_to_socket 0x3ffeeb30 4130 bytes -> 3
mg_if_sent_cb 0x3ffeeb30 4130
mg_call 0x3ffeeb30 proto ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=0
mg_call 0x3ffeeb30 user ev=4 ev_data=0x3ffe1160 flags=0 rmbl=0 smbl=0
mg_call 0x3ffeeb30 after user flags=0 rmbl=0 smbl=0
mg_call 0x3ffeeb30 after proto flags=0 rmbl=0 smbl=0
mg_mgr_handle_conn 0x3ffeeb30 after fd=3 nc_flags=0 rmbl=0 smbl=0
mg_mgr_handle_conn 0x3ffeeb30 fd=3 fd_flags=1 nc_flags=0 rmbl=0 smbl=0
mg_handle_tcp_read 0x3ffeeb30 257 bytes (PLAIN) <- 3
mg_recv_common 0x3ffeeb30 257 0
mg_call 0x3ffeeb30 proto ev=3 ev_data=0x3ffe1150 flags=0 rmbl=257 smbl=0
mg_call 0x3ffeeb30 user ev=3 ev_data=0x3ffe1150 flags=0 rmbl=257 smbl=0
mg_call 0x3ffeeb30 after user flags=0 rmbl=257 smbl=0
mg_http_handler2 0x3ffeeb30 IPADDRESS:80
mg_call 0x3ffeeb30 user ev=102 ev_data=0x3ffe0f80 flags=0 rmbl=257 smbl=0
mg_call 0x3ffeeb30 after user flags=0 rmbl=257 smbl=0
mg_call 0x3ffeeb30 user ev=101 ev_data=0x3ffe0f80 flags=0 rmbl=257 smbl=0
mg_call 0x3ffeeb30 after user flags=2048 rmbl=257 smbl=0
mg_call 0x3ffeeb30 after proto flags=2048 rmbl=0 smbl=0
mg_mgr_handle_conn 0x3ffeeb30 after fd=3 nc_flags=2048 rmbl=0 smbl=0
mg_close_conn 0x3ffeeb30 2048 3
mg_call 0x3ffeeb30 proto ev=5 ev_data=0x0 flags=2048 rmbl=0 smbl=0
mg_call 0x3ffeeb30 user ev=5 ev_data=0x0 flags=2048 rmbl=0 smbl=0
mg_call 0x3ffeeb30 after user flags=2048 rmbl=0 smbl=0
mg_call 0x3ffeeb30 after proto flags=2048 rmbl=0 smbl=0
mg_mgr_free 0x3ffe1280

And here is a log of the failed connect to a AP about 30 ft away:
mg_socket_if_init 0x3ffe1280 using select()
mg_mgr_init_opt ==================================
mg_mgr_init_opt init mgr=0x3ffe1280
mg_connect_http_base http://IPADDRESS/index.php/v1/device use_ssl? 0 tcp://52.207.116.53:80
mg_do_connect 0x3ffeeb58 tcp://IPADDRESS:80
mg_socket_if_connect 0x3ffeeb58 sock 1 rc -1 errno 119 err 0
mg_add_conn 0x3ffe1280 0x3ffeeb58
// about 8 seconds pass until it times out and closes
mg_mgr_free 0x3ffe1280
mg_close_conn 0x3ffeeb58 2056 1
mg_call 0x3ffeeb58 proto ev=5 ev_data=0x0 flags=2056 rmbl=0 smbl=19530
mg_call 0x3ffeeb58 user ev=5 ev_data=0x0 flags=2056 rmbl=0 smbl=19530
mg_call 0x3ffeeb58 after user flags=2056 rmbl=0 smbl=19530
mg_call 0x3ffeeb58 after proto flags=2056 rmbl=0 smbl=19530

Any help is greatly appreciated.
Thanks,
- Brett

Sign In or Register to comment.