This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220SF-LAUNCHXL: Help needed with dropped Connections with Simplelink HTTP Server

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: UNIFLASH, CC3220SF

Hi,

I am looking for assistance with my Simplelink HTTP server application. I have read the documentation and I like what it's promising me, but the reality is somewhat different. My use-case is akin to the Power Socket application in SWRU455L (2.2.2) which needs to be "Always Connected". However, all too frequently, I send a request and it gets timed out. Some time later I get

[WLAN ERROR]Device disconnected from the AP AP: <MySSID>,BSSID: 40:d:10:e8:4e:a9 on an ERROR..!! 

[WLAN EVENT] STA Connected to the AP: <MySSID>,BSSID: 40:d:10:e8:4e:a9
[NETAPP EVENT] IP Acquired: IP=192.168.0.38 , Gateway=192.168.0.1

(I have omitted my SSID: IP address reveals nothing!)

and connection is restored. The error is displayed as frequently as 3 mins.

I've tried changing the policy (in provisioning_task.c) as follows, bu to no effect.

ret = sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0, 1, 0, 0), NULL, 0);

My application is an extension is an extension to the Out of the Box Demo. I do everything in the application on several tasks, from UART access to a Sub-GHz collector, a periodic timer task and the HTTP server (local link task +).  The non network tasks are working OK, but I need to maintain a reliable network connection for the User Interface to be responsive.

So, any ideas on why the above error is happening so frequently and what I can do to fix it?

Thanks, in advance.

Martin

  • You need to understand the cause of the frequent disconnection from the AP.

    You will  need  to read the reason code from the disconnect event (in SimpleLinkWlanEventHandler: case SL_WLAN_EVENT_DISCONNECT: print the pWlanEvent->Data.Disconnect.ReasonCode).

    What AP are you using? few APs causes iop issues in regards to Power-Save support. 

    you can try using the "no ps-poll" whch can help with certain APs. see below:

          //Disable no PS_Poll mode (default) - station sends PS-Poll ctrl frame to receive buffered frames from the AP when 
                                                unicast traffic is indicated in the beacon
          //Enable no PS_Poll mode - Stating transition from PS to Active whenever unicast traffic is indicated in the beacon
                                     (this mode is for inter operability issues with access points that doesn't fully support 
                                      PS-Poll) 
          SlWlanNoPSPollMode_t NoPsPollMode;
          NoPsPollMode.Enable = 1; // enable no PS-Poll mode (work without PS-Poll frames)      
          sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE,sizeof(SlWlanNoPSPollMode_t),(_u8 *)& NoPsPollMode);
    

    Are you using LSI? if yes, you can try to reduce the interval.

    You should keep the auto-connect enabled in the policy (with the FAST-connect).

    Br,

    Kobi

  • Hi Kobi,

    Thanks for the prompt reply.  I am new to all the complexities of network programming (hence using the OOB as a template). However, I have researched your response (in SWRU455L) and determined the following:

    • The reason code for the SL_WLAN_EVENT_DISCONNECT is always 6, i.e. SL_WLAN_DISCONNECT_FRAME_FROM_NONAUTH_STA
    • The power policy setting was Normal, so LSI not operative, I guess? I have changed the policy to Always On.

    I have also changed

    • SL_WLAN_POLICY_CONNECTION to SL_WLAN_CONNECTION_POLICY(1, 1, 0, 0)  (auto + fast) as suggested
    • SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE to Enabled as suggested

    I am still seeing the reason-6 disconnects, but they are less frequent. I changed my web app to turn on periodic (30s) status polling and that seems to keep the connection alive for longer. However, I am not always accessing the web app, and my concern is when I pick up my iPad to change settings and find it unresponsive, after a period of unuse.

    My Access point is a consumer grade VirginMedia Hub 3.0:

    Hub 3.0 device information

    The information below shows current status of this Hub 3.0.

    Standard specification compliant : DOCSIS 3.0
    Hardware version : 10
    Software version : 9.1.1912.302

    I will monitor the activity over the next few days and will update this thread with my findings.

    Thanks for you help navigating the minefield of information regarding the SimpleLink API 

    Best Regards,

    Martin

  • Do you still see reason code 6 after enabling the "NO PS-POLL"?

    What is the frequency of disconnections?

    Do you face the HTTP issues, when the device is connected to the AP?

    Was the IP address of the device modified following the re-connections?

    Br,

    Kobi

  • Hi Kobi,

    "Do you still see reason code 6 after enabling the "NO PS-POLL"?"

    Yes, every 15 mins or so. It sort of depends. When the webapp is running, it polls for status every 30s and this keeps the connection alive. When it is not running I get reason code 6 after a while.

    "Do you face the HTTP issues, when the device is connected to the AP?"

    I'm not sure what you mean. The intention is that it will alwyas be a part of my home network. At present, it so happens, the AP (aka the Hub 3.0) cannot see the device and the web page is unresponsive.... ( a few minutes latger and...) I have just got the reason 6 code and it is back on-line and the AP sees it. So, it seems to drop sometime before the Reason 6 event and when it is invoked it attaches again!

    "Was the IP address of the device modified following the re-connections?"

    No, it retains the same address.

    Best Regards,

    Martin

  • Hi Martin,

    Just a comment.

    According reviews at Internet it looks that your modem/router VirginMedia Hub 3.0 (TG2492) is a very problematic hardware. It seems that WiFi part is almost not functional and routing features not works properly as well. I read many recommendation to switch this device into modem mode only and use external router and access point.

    Jan

  • Are you using the latest SP (3.17 from SDK 4.30)? If not please try it.

    This SP fixes an issue with regards to AP that as a constant drift of their beacons. 

    If this won't work, i suggest you will try to work with other AP.

    Typically the disabling of PS poll should does the trick (especially in regards to disconnect reason 6 or 7), but as Jan mentioned, this AP may be have other issues.

    We are doing massive IOP testing against hundreds of the most popular APs in the market (the VirginMedia is not one of them). We are aware of few with issues, but most of them are related to LSI (that you are not using) and PS-Poll.

    We will need air sniffer logs to further analyze the behavior of this AP.

    Br,

    Kobi

  • Hi Kobi,

    Uniflash (1.0.22.1) is showing that it is using sp_3.17.0.4_2.0.0.0_2.2.0.7.bin with the OOB example. But I had to reset to factory before I could download via the debugger. I have yet to work out how to flash my own program. (Despite being a full-time embedded s/w engineer for the last 20+ years, I am finding it extremely difficult to find the right information I need to successfully build and deploy using the tools at hand). 

    I am now trying to flash my application with the above SP and so on, using the advanced settings in Uniflash and I'm hitting the following error:

    An old post of yours (c2017) states: The CC3220SF device only supports secured images so you must follow the instructions to authenticate and sign it (using valid certificates). Where are these instructions. Will this then remove the above error.

    Please, could you give me some concrete links to the right documentation to learn how to use Uniflash to create my own 'image' (if that's the correct term for the final artifact that is burnt to flash). I am also trying to find out the size of the serial flash on the CC3220SF launch XL Rev A. Could you let me know what the capacity is, please.

    My AP works fine for other things, although I do get the occasional outage. But i'm working from home at the moment and Teams etc works fine over the router (admittedly I tend to connect to the 5GHz channel).

    I think I can live with my AP for now and any minor glitches. I may experiment with my ASUS router at some point.

    Thanks,

    Martin

  • Hi Kobi,

    The error image didn't show it is: err: 2633 FS_WRONG_CERTIFICATE_FILE_NAME.

    Cheers,

    Martin

  • Thanks Kobi,

    This document is very useful. I have successfully, after many attempts, programmed the OOB demo with SP 3.17. I still get lock-outs. I guess, I will have to live with this for now until I change my ISP router, or get another AP.

    I have also managed to build an image with my own application and html files etc. This application kicks off with the same provisioning code that the OOB example uses and outputs the provisioning details to the VCP terminal when run from the debugger. After provisioning is complete it then kicks off my application tasks.

    However, on reset/power on, it does not output anything to the terminal and does not provision. Any ideas why this would be so?

    Thanks,

    Martin

  • Probably the application gets stuck on something. You should debug your application and find where where.

    There is on obvious reason for this.

    Br,

    Kobi