Hi,
as it is said in the wifi tech guide, the average connection time for AP of WEP encryption is only 4,077s. However in my code tested the time, it is turned out to be 70+s. Would you please help me to figure it out why it does like this?
Here is my code:
Code:
long previous=0;
long connection_time=0;
int count=0;
void setup(){
// First, initialize the WIFI API and the connections with the waspmote
WIFI.begin();
// Then switch on the WIFI module on the desired socket.
WIFI.ON(socket0);
// If we don't know what configuration had the module, reset it.
WIFI.resetValues();
// 1. Configure the transport protocol (UDP, TCP, FTP, HTTP...)
WIFI.setConnectionOptions(CLIENT|UDP);
// 2. Configure the way the modules will resolve the IP address.
WIFI.setDHCPoptions(DHCP_ON);
Utils.setLED(LED1,LED_ON);
}
void loop(){
// 3.0 Specify the Access Point.
WIFI.setESSID("wifixs");
WIFI.setAuthKey(WEP, "369369369A");
WIFI.setTXPower(0);//12dBm
Utils.setLED(LED0,LED_ON);
previous=millis();
if (WIFI.setJoinMode(AUTO_STOR))
{
connection_time=millis()-previous;
Utils.setLED(LED1,LED_OFF);
if(WIFI.isConnected())
Utils.blinkLEDs(300);
}
count++;
WIFI.leave();
// ave=sum/count;
// Displays singal strenght information.
WIFI.getRSSI();
if(count==1)
// Displays Access Point settings.
WIFI.getWLANsettings();
USB.println(WIFI.answer);
USB.println(count);
USB.print(connection_time);
USB.println("ms");
USB.println("\r\n");
WIFI.setSleep(80,5);
USB.println("wake up");
}
result:
þ$$$$$$$$$set s p 0x4000
factory RESET
reboot
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$set s p 0x4000
set i p 9
set i d 1
set w s wifixs
set w k 333639333639333639410
set w tx 0
leave
set w j 1
save
reboot
$$$get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
leave
show r
get w
get w
SSID=wifixs
Chan=0
ExtAnt=0
Join=1
Auth=OPEN
Mask=0x1fff
Rate=12, 24 Mb
Linkmon=0
Passphrase=rubygirl
TxPower=0
<2.23>
1
76878ms
set s w 80
set s s 5
save
reboot
$$$wake up
set w s wifixs
set w k 333639333639333639410
set w tx 0
leave
set w j 1
save
reboot
$$$get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
get ip
leave
show r
show r
RSSI=(-42) dBm
<2.23>
2
73827ms