I have my implementation up and running with WiFi. Now I have two questions concerning it.
For initializing the wifi card and connecting to a network, I am using a slightly edited version of the infrastructure example in the nburn folder.
Now for my two questions:
1- When the card first initializes it runs a scan to detect any AP's in the area. Near as I can tell this happens within the AddWifiInterface(); call. Then if after it completes, I use the ( void )WifiAttachTo(ssid, key, mode); call to get it to connect to my network and it scans for AP's again before attempting to connect to my network. Is there anyway to keep it from running the first scan so that it will only scan in the AttachTo function? With running the scan twice, startup time is effectively doubled and I'm wanting to try to reduce startup time as much as possible.
2- I have error checking in place in certain areas (if it cant connect to the desired network, if the wifi card returns an error instead of getting an interface id, etc.) that runs a function to communicate the error to the user using a status LED. But there is one last one I need a little help with. In testing I tried disconnecting the WiFi card to see if it would reach an error state. In the MTTTY window it prints "WiFi: Scanning..." and hangs there. Is there a way to detect that no WiFi card is present so I can force it to an error state in code?
EDIT: Number 1 can easily be answered by using AddWiFiInterfacewName() instead. The problem is last time I tried to use that call, it wouldn't connect so I stuck with AddWiFiInterface(). As it turns out, it couldn't connect because I was trying to use WPA2 AES encryption. If I stick with a WEP key, AddWiFiInterfacewName() works just fine. Answering that question poses another one however. I was looking in the wifi.h header file and it states that to use WPA2 encryption, the key needs to be inputted as "WPA2:Password" The question is, why isn't that working? The router is set to WPA2 AES encryption with "Password" as the PSK and the netburner key is inputted as "WPA2:Password" and the netburner won't connect with the router.
A few WiFi related coding questions
-
- Posts: 26
- Joined: Wed Oct 19, 2011 8:40 pm
Re: A few WiFi related coding questions
Okay, I had gotten my startup time down to an adequate amount so I kind of forgot all about this and it hit me this morning that I thought I remembered seeing something in the wifi.h header file from the nburn folder so I went and checked it out. Sure enough, right at the top of the header file in the second set of comments, where it goes over the supported options:
"NBWIFIUG-200CR"
So my assumption is that some of those options aren't yet supported because we have no 200 series wifi card yet.
Anyway, that answers my own (pretty stupid ) question so mods can delete this thread if they want.
"NBWIFIUG-200CR"
So my assumption is that some of those options aren't yet supported because we have no 200 series wifi card yet.
Anyway, that answers my own (pretty stupid ) question so mods can delete this thread if they want.