- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
When using the Wiced HTTP Client, occasionally when calling http_client_connect(), it returns an error. Typically the error code is #4.
Laird Sterling EWB ( Cypress CYW4343W + STM32F412)
Wiced Studio 6.6
-Rocko
Solved! Go to Solution.
- Labels:
-
WICED Studio Wi-Fi Combo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Murali,
I have made good progress.
As I mention before, I found when a socket error occurs I was exiting early and not cleaning up the socket resources and a semaphore properly. The next time through, I didn't have a clean start which caused every packet thereafter to fail. I tested over 17 hours sending a packet every 10 seconds. I received a single 5031 (HANDSHAKE_TIMEOUT) error. I am now properly handling the error and I can continue to operate without issue.
I will close this thread and open a new one if I require assistance with the 5031 issue.
Thank you,
-Rocko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
*UPDATE*
On a recent test, after 360 successful calls of http_client_connect(), I've triggered an error.
This time I received error #7014 followed by a error #4 on all subsequent attempts.
RESULT_ENUM( prefix, SOCKET_CLOSED, 7014 ), /**< Socket closed */
-Rocko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@RoMc_863046 Looks like this is some issue that is popping up when put under a stress test. Is this the default httpbin_org app that is available or have there been any customizations?
Can you provide me the steps to try and reproduce this?
Also, i'll need some debug logs from this. Can you enable WICED NETWORK and LIB INFO,DEBUG and ERROR logs in wiced_defaults.h and provide the logs. This might help in isolating the root cause.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the quick reply MuraliR_36.
This is not the default httpbin_org app. This is a custom solution. Since the error occurs randomly, I created a stress test to try and re-create the errors more regularly. The number of cycles seems unimportant. I have a test running now on cycle #1800 without any error.
While I have not determined what causes the error, I have found a few issues in my code. After the error occurs, I was not calling http_client_deinit() before trying to init the client again. I was also not using a wiced semaphore properly. This could have been the reason for the subsequent issues after the initial error. I am now doing a proper cleanup before trying to re-connect.
I will work on creating the debug logs you have requested.
Thank you,
-Rocko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Murali,
I have made good progress.
As I mention before, I found when a socket error occurs I was exiting early and not cleaning up the socket resources and a semaphore properly. The next time through, I didn't have a clean start which caused every packet thereafter to fail. I tested over 17 hours sending a packet every 10 seconds. I received a single 5031 (HANDSHAKE_TIMEOUT) error. I am now properly handling the error and I can continue to operate without issue.
I will close this thread and open a new one if I require assistance with the 5031 issue.
Thank you,
-Rocko