WIZnet Developer Forum

Reliable AP connection

Hello,

I have created a Access Point at WizFi210. After turning off the working module, waiting less than 20s, and than turning it back on, my PC cannot connect again. So, I have to wait more than 20s between turning-off and turning-on to have a proper connection. When the problem occurs, Windows shows message “windows system could not connect to the network XYZ-WiFi 9999999”. I would like to turn off/on the module at anytime without getting any errors.

I turning WizFi210 module off by cutting off the power supply.

First, my initialization list was longer, but in order to find an error I cut them to necessary three commands:
AT+WM=2
AT+NSET=192.168.5.1,255.255.255.0,192.168.5.1
AT+WA=XYZ-WiFi 9999999,8

These commands are sent from uC everytime the module is turning on.

What am I doing wrong?

Hi, kszkutnik

If you want to create an AP mode after turning off the WizFi210, you have to use AT command “atc1”.
“ATC1” will try auto connection using AT command “AT+WAUTO and AT+NAUTO” after rebooting WizFi210.
So, you have to set AT+WAUTO and AT+NAUTO. Not WM, NSET, WA…

There are necessary AT commands.

AT+WAUTO=2,XYZ-WiFi 9999999 <<< AP mode, SSID
AT+NAUTO=1,1,5000 <<< Server mode, TCP, Port number
AT&W0 <<<< save profile #0
ATC1 <<<< auto connection after rebooting wizfi210

If you check any status about WizFi210. You can enter an AT command “AT+XVP” and check “+WAUTO=2,XYZ-WiFi 9999999”, “+NAUTO=1,1,0.0.0.0,5000” that was saved.

Good luck with your project with WizFi210.

Thank you Wizdaniel,

Following your instructions and those of the user kaizen in the other post (http://www.wizwiki.net/forum/viewtopic.php?f=31&t=483#p1514).
I have used the following commands:

AT&F
AT+WD
AT+XDUM=0
AT+WM=2
AT+NSET=192.168.55.1,255.255.255.0,192.168.55.1
AT+DHCPSRVR=1
AT+NAUTO=1,1,,5000
AT+WAUTO=2,XYZ-WiFi
AT+WAUTH=1
AT+WWEP1=1234567890
AT&W0
AT&Y0
ATC1

After each command I received an [OK] response. After restart, the WizFi210 properly sets an access point. But when I turn off power of the module, wait less than 20 seconds and than turn it on, I can not connect to the access point. So the issue of this topic remains.

I have connected a sniffer to Tx line of the module. After power on, I send a AT&V command as you recommended. Here is what I can see after the long power cycle (when the duration between switching off and switching on is more than 20 seconds):

[code] Serial2WiFi APP (WIZnet Co.Ltd)

IP              SubNet         Gateway   

192.168.55.1: 255.255.255.0: 192.168.55.1

AT&V
ACTIVE PROFILE
C1 &Y0 E1 V1 B=115200,8,N,1 &K0 &R0
+NDHCP=0 +NSET=192.168.55.1,255.255.255.0,192.168.55.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=2 +WAUTO=2,“XYZ-WiFi”,
+WRETRY=5 +WP=0 +WRXPS=0 +WRXACTIVE=1
+NAUTO=1,1,0.0.0.0,5000
+WAUTH=1 +WWPA=""+PSK-valid=0 +SSID=
+WWEP1=1234567890 +WWEP2= +WWEP3= +WWEP4=
+WEAPCONF=13,26,
S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150
+BDATA=0 +WSEC=0
+XEB=0 +XE2B=27 +XDUM=0 +XEHT=2,1,0,3 +XAIRCMDPORT=5001
+XDO=0,0,0 +XAR=0 +XUAP=0 +XPSO=0,0

STORED PROFILE 0
E1 V1 B=115200,8,N,1 &K0 &R0
+NDHCP=0 +NSET=192.168.55.1,255.255.255.0,192.168.55.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=2 +WAUTO=2,“XYZ-WiFi”,
+WRETRY=5 +WP=0 +WRXPS=0 +WRXACTIVE=1
+NAUTO=1,1,0.0.0.0,5000
+WAUTH=1 +WWPA=""+PSK-valid=0 +SSID=
+WWEP1=1234567890 +WWEP2= +WWEP3= +WWEP4=
+WEAPCONF=13,26,
S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150
+BDATA=0 +WSEC=0
+XEB=0 +XE2B=27 +XDUM=0 +XEHT=2,1,0,3 +XAIRCMDPORT=5001
+XDO=0,0,0 +XAR=0 +XUAP=0 +XPSO=0,0

STORED PROFILE 1
E1 V1 B=115200,8,N,1 &K0 &R0
+NDHCP=0 +NSET=192.168.1.254,255.255.255.0,192.168.1.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=0 +WAUTO=0,“WizFiAP”,
+WRETRY=5 +WP=0 +WRXPS=0 +WRXACTIVE=1
+NAUTO=1,1,0.0.0.0,4000
+WAUTH=0 +WWPA=""+PSK-valid=0 +SSID=
+WWEP1=0000000000 +WWEP2= +WWEP3= +WWEP4=
+WEAPCONF=13,26,
S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150
+BDATA=0 +WSEC=0
+XEB=0 +XE2B=27 +XDUM=1 +XEHT=2,1,0,3 +XAIRCMDPORT=5001
+XDO=0,0,0 +XAR=0 +XUAP=0 +XPSO=0,0

[OK][/code]

Here is what I can see after the short power cycle (when the duration between switching off and switching on is less than 20 seconds):

[code][UnExpected Warm Boot(Possibly Low Battery)]

IP              SubNet         Gateway   

192.168.55.1: 255.255.255.0: 192.168.55.1

AT&V
ACTIVE PROFILE
C1 &Y0 E1 V1 B=115200,8,N,1 &K0 &R0
+NDHCP=0 +NSET=192.168.55.1,255.255.255.0,192.168.55.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=2 +WAUTO=2,“XYZ-WiFi”,
+WRETRY=5 +WP=0 +WRXPS=0 +WRXACTIVE=1
+NAUTO=1,1,0.0.0.0,5000
+WAUTH=1 +WWPA=""+PSK-valid=0 +SSID=
+WWEP1=1234567890 +WWEP2= +WWEP3= +WWEP4=
+WEAPCONF=13,26,
S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150
+BDATA=0 +WSEC=0
+XEB=0 +XE2B=27 +XDUM=0 +XEHT=2,1,0,3 +XAIRCMDPORT=5001
+XDO=0,0,0 +XAR=0 +XUAP=0 +XPSO=0,0

STORED PROFILE 0
E1 V1 B=115200,8,N,1 &K0 &R0
+NDHCP=0 +NSET=192.168.55.1,255.255.255.0,192.168.55.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=2 +WAUTO=2,“XYZ-WiFi”,
+WRETRY=5 +WP=0 +WRXPS=0 +WRXACTIVE=1
+NAUTO=1,1,0.0.0.0,5000
+WAUTH=1 +WWPA=""+PSK-valid=0 +SSID=
+WWEP1=1234567890 +WWEP2= +WWEP3= +WWEP4=
+WEAPCONF=13,26,
S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150
+BDATA=0 +WSEC=0
+XEB=0 +XE2B=27 +XDUM=0 +XEHT=2,1,0,3 +XAIRCMDPORT=5001
+XDO=0,0,0 +XAR=0 +XUAP=0 +XPSO=0,0

STORED PROFILE 1
E1 V1 B=115200,8,N,1 &K0 &R0
+NDHCP=0 +NSET=192.168.1.254,255.255.255.0,192.168.1.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=0 +WAUTO=0,“WizFiAP”,
+WRETRY=5 +WP=0 +WRXPS=0 +WRXACTIVE=1
+NAUTO=1,1,0.0.0.0,4000
+WAUTH=0 +WWPA=""+PSK-valid=0 +SSID=
+WWEP1=0000000000 +WWEP2= +WWEP3= +WWEP4=
+WEAPCONF=13,26,
S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150
+BDATA=0 +WSEC=0
+XEB=0 +XE2B=27 +XDUM=1 +XEHT=2,1,0,3 +XAIRCMDPORT=5001
+XDO=0,0,0 +XAR=0 +XUAP=0 +XPSO=0,0

[OK][/code]

As you can see, after short power cycle I am receiving a message about Unexpected Warm Boot. I thing that this message is associated with the connection issue. Do you know what this message means and how to avoid it?

Thank you.

The warm boot mode means to lack of voltage or reset as an external input.

MAC address will be used on each subsequent cold boot(from power off) or warm boot(from standby).

if power to the device is lost, the next cold boot will use the MAC address stored in FLASH MEMORY(from ‘AT+NMAC’ command)
but Warm boot will use MAC address stored in non-volatile RAM from standby(it is related 'AT+NMAC2’command

Thank you Wizdaniel for your response,

So I checked the MAC address of the module I’m working on, with both commands: AT+NMAC and AT+NMAC2. Below are the results of the commands in two cases:

Cold Boot

 Serial2WiFi APP (WIZnet Co.Ltd) 

    IP              SubNet         Gateway   
 192.168.55.1: 255.255.255.0: 192.168.55.1
AT+NMAC=?
00:08:dc:1b:03:4c
[OK]
AT+NMAC2=?
00:08:dc:1b:03:4c
[OK]

Warm Boot

[UnExpected Warm Boot(Possibly Low Battery)]

    IP              SubNet         Gateway   
 192.168.55.1: 255.255.255.0: 192.168.55.1
AT+NMAC=?
03:4c:00:00:03:4c
[OK]
AT+NMAC2=?
03:4c:00:00:03:4c
[OK]

As you can see there is a difference between the response during warm boot and cold boot. How is it possible and how to fix it?

Thank you

hi

i guess you do not have to worry about warm boot. you can just use ap mode as you want.

undefined signals(noise) into gpio or uart can cause that warm boot mode are occured.

Hello Wizdaniel,

When I set the both MAC address (NMAC, NMAC2) as 00:08:DC:11:22:33 than, at the warm boot mode the NMAC and NMAC2 commands returns 22:13:00:00:22:33. So I changed MAC address of the Wizfi210 to 22:13:00:00:22:33 in order to have the same MAC address at the warm and cold boot mode.

So I created a situation, where in a both boot modes I receive the same MAC address:

Cold boot mode

Serial2WiFi APP (WIZnet Co.Ltd) 

    IP              SubNet         Gateway   
 192.168.55.1: 255.255.255.0: 192.168.55.1
AT+NMAC=?
22:13:00:00:22:33
[OK]
AT+NMAC2=?
22:13:00:00:22:33
[OK]

Warm boot mode

[UnExpected Warm Boot(Possibly Low Battery)]

    IP              SubNet         Gateway   
 192.168.55.1: 255.255.255.0: 192.168.55.1
AT+NMAC=?
22:13:00:00:22:33
[OK]
AT+NMAC2=?
22:13:00:00:22:33
[OK]

After that, I can see that I am able to connect to the Wizfi210 at any time. I don’t have to wait for 20 seconds for a cold boot to have a proper connection. I can connect at the warm boot mode as well.

I deduce from this case that during a warm boot, the module changes the MAC address to another. It is quite undesirable.

Why this is happen? What to do to have the same MAC address?

Thank you

Hi kszkutnik.

first of all. i’m sorry. i didn’t understand what was happening. Any thought of changing the Mac address was unthinkable.

I tried to make a situation same yours.(warm boot mode)
But, MAC address hasn’t changed after warm boot mode in my case.

So, i prefer to check a firmware version(1.1.1.0(W)) and module version(it was written in front of module like WizFi210 V1.0 or V1.01.

After that you need to check the voltage(or signals) enabled on another GPIO or module’s RX when you re-boot.
If possible, warm boot mode will start after re-booting.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.