thinger-io / Arduino-Library

IOTMP Arduino Library for connecting devices to thinger.io #IoT
https://thinger.io
MIT License
111 stars 66 forks source link

Arduino-Library library loops when trying to connect to websocket via GSM #47

Open georgevbsantiago opened 1 year ago

georgevbsantiago commented 1 year ago

I identified that, in occasional situations, after the GSM modem connects with the APN, the library is stuck trying to connect in the websocket. Apparently, this problem might be with the TinyGSM library. (https://github.com/vshymanskyy/TinyGSM/issues/62, https://github.com/vshymanskyy/TinyGSM/issues/434, https://github.com/vshymanskyy/TinyGSM/issues/35, https://github.com/vshymanskyy/TinyGSM/issues/57, ) However, could the Arduino-Library library make some approach to work around this problem? Any approach to clear cache, or try 10 times and restart the modem? I remember that Arduino-Library already made similar approaches when it had a problem getting the date and time from NTP (see this post).

11:03:34.551 > [NETWORK] Starting connection...
11:03:34.552 > Thinger State Listener: NETWORK_CONNECTING
11:03:34.571 > [NETWORK] Initializing Modem...
11:03:39.695 > [NETWORK] Modem Info: XXXXXXXXXXXXXX
11:03:39.716 > [NETWORK] Waiting for Network...
11:03:56.129 > [NETWORK] Network Connected!
11:03:56.148 > [NETWORK] Connecting to APN...
11:04:59.787 > [NETWORK] Connected!
11:04:59.807 > Thinger State Listener: NETWORK_CONNECTED
11:04:59.824 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:04:59.824 > [_SOCKET] Using secure TLS/SSL connection: yes
11:04:59.829 > Thinger State Listener: SOCKET_CONNECTING
11:06:14.872 > [_SOCKET] Error while connecting!
11:06:14.884 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:06:24.033 > [NETWORK] Starting connection...
11:06:24.033 > Thinger State Listener: NETWORK_CONNECTING
11:06:24.094 > [NETWORK] Connecting to APN...
11:06:30.766 > [NETWORK] Connected!
11:06:30.785 > Thinger State Listener: NETWORK_CONNECTED
11:06:30.802 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:06:30.802 > [_SOCKET] Using secure TLS/SSL connection: yes
11:06:30.808 > Thinger State Listener: SOCKET_CONNECTING
11:07:45.843 > [_SOCKET] Error while connecting!
11:07:45.861 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:07:51.000 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:07:51.008 > [_SOCKET] Using secure TLS/SSL connection: yes
11:07:51.013 > Thinger State Listener: SOCKET_CONNECTING
11:08:05.039 > [_SOCKET] Error while connecting!
11:08:05.057 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:08:10.190 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:08:10.196 > [_SOCKET] Using secure TLS/SSL connection: yes
11:08:10.202 > Thinger State Listener: SOCKET_CONNECTING
11:08:24.243 > [_SOCKET] Error while connecting!
11:08:24.264 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:08:29.394 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:08:29.400 > [_SOCKET] Using secure TLS/SSL connection: yes
11:08:29.406 > Thinger State Listener: SOCKET_CONNECTING
11:08:43.457 > [_SOCKET] Error while connecting!
11:08:43.462 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:08:48.598 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:08:48.613 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:08:48.613 > Thinger State Listener: SOCKET_CONNECTING
11:09:02.647 > [_SOCKET] Error while connecting!
11:09:02.647 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:09:07.782 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:09:07.782 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:09:07.788 > Thinger State Listener: SOCKET_CONNECTING
11:09:21.840 > [_SOCKET] Error while connecting!
11:09:21.846 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:09:26.976 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:09:26.982 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:09:26.987 > Thinger State Listener: SOCKET_CONNECTING
11:09:41.044 > [_SOCKET] Error while connecting!
11:09:41.044 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:09:46.175 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:09:46.181 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:09:46.187 > Thinger State Listener: SOCKET_CONNECTING
11:10:00.237 > [_SOCKET] Error while connecting!
11:10:00.243 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:10:05.373 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:10:05.379 > [_SOCKET] Using secure TLS/SSL connection: yes
11:10:05.384 > Thinger State Listener: SOCKET_CONNECTING
11:10:19.432 > [_SOCKET] Error while connecting!
11:10:19.432 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:10:24.561 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:10:24.568 > [_SOCKET] Using secure TLS/SSL connection: yes
11:10:24.573 > Thinger State Listener: SOCKET_CONNECTING
11:10:38.592 > [_SOCKET] Error while connecting!
11:10:38.600 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:10:43.727 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:10:43.733 > [_SOCKET] Using secure TLS/SSL connection: yes
11:10:43.746 > Thinger State Listener: SOCKET_CONNECTING
11:10:57.796 > [_SOCKET] Error while connecting!
11:10:57.796 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:11:02.927 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:11:02.933 > [_SOCKET] Using secure TLS/SSL connection: yes
11:11:02.939 > Thinger State Listener: SOCKET_CONNECTING
11:11:16.975 > [_SOCKET] Error while connecting!
11:11:16.976 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:11:22.111 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:11:22.111 > [_SOCKET] Using secure TLS/SSL connection: yes
11:11:22.117 > Thinger State Listener: SOCKET_CONNECTING
11:11:36.137 > [_SOCKET] Error while connecting!
11:11:36.142 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:11:41.272 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:11:41.277 > [_SOCKET] Using secure TLS/SSL connection: yes
11:11:41.283 > Thinger State Listener: SOCKET_CONNECTING
georgevbsantiago commented 12 months ago

Hi @alvarolb A doubt. Could some of the new connection improvement approaches used in MKR and bc66 also help in SIM800, as in the problem reported above?

Thanks