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.

Problem getting the AP list using sl_WlanGetNetworkList

Part Number: CC3100BOOST
Other Parts Discussed in Thread: LAUNCHXL-TMS57004, , CC3100SDK, CC3100, HALCOGEN, CC31XXEMUBOOST

Tool/software: Code Composer Studio

Hi,

I am trying to setup a Wi-Fi configuration menu via UART in wich I should be able to configure the connection parameters through a serial terminal. I am using a launchxl-tms57004 and cc3100boost module for the job.

The configuration I apply to the module during initialization is the next one:

- TX power: Max power

- DHCP: enabled

- Connection policy: "Auto"

- Power management policy: "Always on"

- Scan policy: enabled with a 10 second interval

The problem I have encountered is that when I try to show the AP list, I call the sl_WlanGetNetworkList funciton and I get a -100 return wich I observed it could be SL_API_ABORTED. I tried to disable the connection policy and the scan policy in the initialization and enabling the scan policy just before the sl_WlanGetNetworkList call. In this case i get the same return, but I get the results correctly in the Sl_WlanNetworkEntry_t,

Thanks in advance,

Jon

  • Hi Jon,

    I do not see -100 within the wlan.h error codes.

    Below is an example of using the getNetwork function

    An example of fetching max 10 results:
    
    	Sl_WlanNetworkEntry_t netEntries[10];
    	_i16 resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
    	for(i=0; i< resultsCount; i++)
    	{
    		  printf("%s\n",netEntries[i].ssid);
    	}

    For more info check out the "programmers_guide.html" file within the SDK and search for the WlanGetNetworkList functio.

    C:\ti\CC3100SDK_1.2.0\cc3100-sdk\docs\simplelink_api

    Hope this helps,

    Kevin

  • Hi Kevin,

    Meaning of code -100 is SL_API_ABORTED as Jon written at first post (it is device error).

    I think he should check:
    - what Service Pack version is uploaded in CC3100BOOST
    - if he not call sl_WlanGetNetworkList() if SimpleLink is disabled
    - if he not call sl_Stop() without sl_Start()

    I only guessing... he call sl_WlanGetNetworkList() in cycle without any delay or serving SimpleLink events. First call is successfully and call crashed driver. Also it can be issue with using SimpleLink driver in multi-thread environment without proper synchronisation.

    Jan
  • Jan,

    Yes, you are correct. Did not realize it was within the device.h file. Thank you for the correction.

    Jon,

    Please check Jan's suggestions.

    Best,
    Kevin
  • Hi,

    Thank you for your answers, first of all, I am using the driver in a single thread environment wich discards the synchronisation problem. I do initialize the driver with sl_Start() so  there should be no problem with that also. I do serve simplelink events and delay the sl_WlanGetNetworkList call 1 second after the scan policy enable to wait for results so this parts should be OK.

    To give you the other information you are asking I have a couple of questions .

    How do I check the service pack version?
    What do you mean with Simplelink being disabled? How do I enable it?

    Thanks in advance,
    Jon
  • Hi Jon,

    Meaning of disabled SimpleLink is not started by sl_Start() - not asserted nHIB pin. Service Pack can be read by sl_DevGet() API - SL_DEVICE_GENERAL_CONFIGURATION - SL_DEVICE_GENERAL_VERSION.

    I am not sure if your issue can have something to do with old version of service pack, but it is recommended to use latest Service Pack version uploaded in sFlash. ServicePack version contains fixes for CC3100 internal firmware and from this reason is good to use latest version. For example latest version have implemented important security fix for KRACK Attacks.

    Jan
  • Hi Jan,

    I have checked this and the module is enabled, the nHib pin is asserted. The firmware version was old (v1.4.0.1) so I upgraded it to the the lastest version (1.5.0.2), but I still have the same result.
  • Hi Jon,

    I suppose that all sl_ API called before sl_WlanGetNetworkList() are returned without error code, right?

    I don't understand issue which you have. Maybe it can be problem with porting of SimpleLink driver to your platform. Unfortunately reasons for error SL_API_ABORTED can be more (you can see in file driver.c). I think one of reasons can be timeout of communication between driver and device. Maybe you could check this part of porting layer.

    Maybe someone from TI could have any idea.

    Jan
  • Hi Jan,

    The API functions called before are executed correctly, I can still use the CC3100 module perfectly, after executing the sl_WlanGetNetworkList() funciton so looks like the API is still working.

    Thank you for your help, I'll try to find what else could be failing while I wait for some answer.

    Jon
  • Hi Jon,

    Have you had a chance to review the scan_policy example program on the CC3100 SDK?

    This program performs a similar function to the one you have implemented. You could try running the example and see if sl_WlanGetNetworkList is correctly returning the number of valid network lists. If it works as intended compare the code to your own and make any changes that appear necessary.

    Example Code locations:

    C:\ti\CC3100SDK_1.2.0\cc3100-sdk\examples\scan_policy

    or if using with LaunchPad:

    C:\ti\CC3100SDK_1.2.0\cc3100-sdk\platform\msp430f5529lp\example_project_ccs\scan_policy

    Hope this helps,
    Kevin
  • Hi Kevin,

    I did check the scan_policy example, but I didn't tested it until now. I executed it in the CC31XXEMUBOOST and the result is ok so it looks like the problem is in my code. I repeated the exact same steps of the example in the launchpad with my code and I got the -100 return again, so i will be reviewing the SPI API I made for the launchpad and SPI settings in HALCoGen in case there is something wrong with the communication.

    Thank you for your response,
    Jon
  • Hi Jon,

    No problem, hope you are able to fix the issue. Please let us know if you need any more support!

    Best,
    Kevin