Hi,
I’m working on a project using a STM32L4R9 with FreeRTOS 10.3.1 and the LTS 202210 Libraries for connecting to AWS. I’m using the FreeRTOS Cellular Interface with an HL7802 for internet access. In general I’m able to use all the different AWS services, like Shadow, OTA, Jobs without any problems.
The problem I’m facing is that my code is locked from time to time when calling the TCP_Sockets_Connect function (From ports/celluar/tcp_sockets_wrapper.c). Here I’m stuck in the wait call for socket connection setting the bits SOCKET_OPEN_CALLBACK_BIT or SOCKET_OPEN_FAILED_CALLBACK_BIT. Since the CELLULAR_SOCKET_OPEN_TIMEOUT_TICKS is portMAX_DELAY, I never return from the function causing my program to stop.
I have no idea how to fix this bug as it is inside libraries I haven’t written, so hope that someone can help with how this should be fixed.
Thank you for your interest in cellular interface.
After socket connect command AT+KTCPCNX=<session_id> is sent, HL7802 may return the following URCs to indicate socket connect status.
+KTCP_IND: <session_id>,1 : SOCKET_OPEN_CALLBACK_BIT will be set in the socket open callback.
+KTCP_NOTIF: <session_id>, <tcp_notif> : SOCKET_OPEN_FAILED_CALLBACK_BIT will be set in the socket open callback if <tcp_notif> is TCP_NOTIF_TCP_CONNECTION_ERROR
It looks like the socket connect status URC is not received. Can you help to share the debug log by setting LIBRARY_LOG_LEVEL to LOG_DEBUG in cellular_config.h?
Hi CHING,
I have done some further debugging and as you also have mentioned, I don’t receive the KTCP_IND. The picture show left side a scenario where we are stuck as I don’t receive KTCP_IND or KTCP_NOTIF while the right side, it continues to connect. Maybe I need to enable URC using the AT+KURCCFG command? Sadly it is not available for the module, so guess I need to do a manual raw AT command?
To avoid editing my post above to much, it actually seems like I receive +KTCP_NOTIF: 1,3
If 3 = DNS error does this mean that I have to add this error to the handleTcpNotif function? If so, should the implementation just be as TCP_NOTIF_TCP_CONNECTION_ERROR?
Hmm using the same code as TCP_NOTIF_TCP_CONNECTION_ERROR, it deletes the socket and try again, but I’m running into same DNS issue. If i restart my code it will connect many times without any problems until DNS error is hit again. Sad if modem needs a complete reset…
Thank you for information sharing. We may not be able to solve the DNS error problem and can only suggest the following approaches:
HL7802 modem sometimes returns +KTCP_NOTIF: 1, 3 to indicate DNS error. We can use at+cgcontrdp to check if DNS is provisioned. You can contact your network provider for more support. Reference this thread in sierra wireless forum.
+KTCP_IND: 1,1 can be observed in right hand side TX window in the first image you shared. TCP URC is default enabled. You can still use AT+KURCCFG? to double confirm.
Thank you for reporting the problem that DNS error is not handled in HL7802 port. We will also create a PR to update the port.