I am having trouble using the wlan_ioctl_get_scan_results function. I think there might be a problem with the structure type (WLAN_San_Result_t) that is passed into the function not matching what is actually returned byt the cc3000.
The defintition of the function in the Simplelink API reference manual does not match up with the actual definition in wlan.c
-------------------------------- Here is the documentaion for the function call ------------------------------------
Gets the WLAN scan operation results.
Gets entry from scan result table. The scan results are returned one by one, and each entry represents a single AP found in the area. The following is a format of hte scan result:
------------------------------- Here is the structure defined in wlan.c -------------------------------------------
#ifdef __CCS__typedef struct __attribute__ ((__packed__)) _WLAN_San_Result_t#elif __IAR_SYSTEMS_ICC__#pragma pack(1)typedef struct _WLAN_San_Result_t#endif{ // // Set to 1 if this entry is occuiped // unsigned long isValid : 1; long rssi : 7;
// // Holds one of the parsed security-modes // SECURITY_OPEN, SECURITY_WEP, SECURITY_WPA, SECURITY_WPA2, // unsigned long securityMode : 2; long ulSsidLen : 6;
// // The time of which the frame has enterd (in seconds) // short frameTime;
// // AP name and MAC address // char ssid[MAXIMAL_SSID_LENGTH]; unsigned char ucBssid[ETH_ALEN];
}WLAN_San_Result_t;
Problems
1) It says 44 bytes follow but the bytes listed add up to 56
2) The structure does not match documentation.
I found that if this is called multiple times, the driver evenually crashes. I was able to change the structure and get it to work using this as my structure:
typedef struct wlan_test_get_scan{ unsigned long num_networks; unsigned long scan_status; unsigned char byte1; unsigned char byte2; unsigned short time; unsigned char ssid_name[32]; unsigned char bssid[6];}wlan_test_get_scan;
As you can see this also does not match the documentation. I came up with this after tracking the problem to where the data is copied in the hci_event_handler.
So, can you please confirm the data format for the wlan_ioctl_get_scan_results and the bit packing for the results?
Finally, is there additional documentation that gives the api for the cc3000 part (not the driver, but the chip itself)?
Thanks
Hello Jason,
thank you for confirmation. I agree that there is "something rotten" in CC3000 around scanning functionality. I hope it will be fixed soon too.
Hello Martin
CC3000 has its scans enabled by default.
Please note that when you are connected the scans are performed each 10 minutes (refreshed each 10 minutes).
On top of that can you please clarify me how do you know that you are not able to scna while you are not connected?
Regards
Igor
Hello Igor,
as I described before I don't get any valid data from wlan_ioctl_get_scan_results() until I attempt to connect to any witeless network. So no matter if I enable scannig by wlan_ioctl_set_scan_params ( 1, ....) or not, wlan_ioctl_get_scan_results() returns zero (command successfull) and return scan result sruct is filled by zeros except status of the scan which is 2 = no results.
I must call ConnectUsingSSID() from CC3000.c to be able to scan anything. Then if the SSID of network is not in the area, I can scan only one (strongest) network in the area (number of scanned networks hadn't exceeded no. 1).
When I call DisconnectAll() from CC3000.c (or wlan_disconnect(); from wlan.h, I am not sure if DisconnectAll() was implemented out of the box), or when I call assoc and successfully connect to a network, I can scan for networks too, but still I cannot get any better result then only two networks in the area. And it is definitely not because of weak signal of other networks, because there are about 7 networks in the area and it depends on fortune which one I scan as a send result (first one is always the TP-Link AP on my table).
That is my observation.
edit:
Sometimes I get three networks, but the first char in SSID field of result structure is zero, so it is not printed correctly (SSID is 0x00, r, b, a, 0x00 instead of V, r, b, a, 0x00);
Hi
I will attempt to re-create the problem and will explain you the behavior.
Igor,
I have seen the same behavior where the scan will not return any results unless a wlan_connect() has been previously attempted. There is also some time delay between when wlan_connect() is called and when the scan results are valid.
Is there ANY documentation or design notes that actually explain how the module is working internally? I'm finding myself having to 'try things out' with respect to timing and function sequence with this module, similar to what others have been describing on the forum. Another issue I've found is that I have to put a delay between wlan_disconnect() and a subsequent wlan_connect() for the new connect command to 'take hold' in the module. Even when the wlan_connect() function returns 0, it is clear that the module has not started connecting yet (indicated by wlan_ioctl_statusget() returning 0 instead of 2). And I can even get the module into a state where wlan_ioctl_statusget() continually returns 2 without ever successfully connecting to an AP, even though I've been able to successfully connect to that particular AP previously.
Thanks,
Andy
Hi Andy,
There is no documentation available on the internal logic of the scan.We are working to recreate the problem and fix it.I'll update you on our progress in the next couple of days.
Thanks,Alon.S
Hello Alon,
Have you checked this problem? Because I experienced the same behaviour
with scanning and missing the SSIDs so I would be grateful if you can help me with that. Do you have errata of the
HW/SW?
/Roman
Hi Roman,
We are currently working on a fix for the scan issue you reported on this topic but we don’t have a timeline for this release yet.
Yael
Hi Yael,
Thank you for the answer. I'm looking for the new release. Can I ask you for the errata, debug list
for the SimpleLink API?
Please find the known issues list in the release note:
http://processors.wiki.ti.com/index.php/CC3000_Release_Note
Hello All,
I am also facing some issues related to Scan AP function. Initially i was able to Connect to AP, IP configuring(Both DHCP/ Static), Open Sockets(Both TCP/UDP), Send/Receive data Successfully. All these functionality i tried with CODE, not UART operation.
Then i tried for SCAN function, after that it was not at all connecting to access point. Not receiving any CC3000 connected flag in handler. I am unable to proceed with the things. Can you please guide if you have faced a similar issue.
I am using CC3000 Wi-Fi kit, interfaced with MSP430FR5739 development board
Doubts: When we set the scan parameters, where does these settings save to. ???
Is this problem due to invalid setting of parametes ???
Regards Amit G.
Hi Amit,
The scan parameters are saved to the EEPROM.
Can you please specify the exact API you apply? Which scan parameters did you configured?
Hello,,
Initially i used API wlan_ioctl_set_scan_params(1, NULL, NULL, NULL, NULL, NULL,NULL, NULL). Then later i found that there are some defaullt settings to be entered, i altered the API wlan_ioctl_set_scan_params(1, 20, 30, 2, 0x7FF, 80,0, 205, NULL);
What is that last parameter, it should be an array of scanning timeouts???
Can u just insist me to scan the available networks??
with Regards,
Amit G
Amit,
The last parameter is array of scan intervals.
The first parameters actually enable and disable the scan.
There is a known issue with wlan_ioctl_set_scan_params that will be fixed in the upcoming release but it should effect cc3000 connection to an AP.
After applying wlan_ioctl_set_scan_params(1, 20, 30, 2, 0x7FF, 80,0, 205, NULL) , were you able to get the scan results? you can do that by using this API:
wlan_ioctl_get_scan_results()
Were you able to connect to AP?
Hello Yael,
Yes you are right... Its not connecting to AP.
Code will be waiting for the ulcc3000connected flag, This perticular flag is not setting. (AP not connected).
We tried to debug it, it didnt solve.
No it was not possible to get the scan results.
Amit G.