Project Description
1. What is WizFi250 <Air Command Mode>?
The Air Command Mode enables the WizFi250 to use AT Commands via WiFi, whereas the AT commands
were normally used via Serial(UART). Now users can implement the WizFi250 AT command function with
their PC or smart phones without a physical interface like Serial.
For example,
WizFi250 GPIO control (Controlling the LED connected with WizFi250 by smart phone)
+ NOTICE that the <Air Command Mode> is only operable for F/W 1.0.1.8 or up +
2. How to start WizFi250 <Air Command Mode>
: Users can start the <Air Command Mode> by using (a) the AT Command or (b) the GPIO.
(a) <Air Command Mode> by using the AT Command
The command for AT command is as below.
1
AT+MAIRCMD=<OpenType>,<SocketType>,<LocalPort>,<Reserved>
2
<OpenType> : O(open at Once), S(register as a Service)
3
<SocketType> : T(TCP Server), U(UDP Server
4
<LocalPort> :
5
<Reserved> : Reserved
2
[ERROR: WiFi Status]
The error was caused because the WIFI network for WizFi250 is not enabled.
In other words, if WizFi250 is connected to the AP or not operating in AP mode, the socket cannot be opened
and thus the error.
Now set the WizFi250 in AP mode and input the <Air Command> command.
1
AT+WSET=1,WizFi250_AIRCMD
2
[OK]
3
AT+WSEC=1,WPA2,123456789
4
[OK]
5
AT+WNET=0,192.168.11.1,255.255.255.0,192.168.11.1
6
[OK]
7
AT+WJOIN
8
9
[Link-Up Event]
1
0
11
IP Addr
Gateway
: 192.168.11.1
: 192.168.11.1
1
2 [OK]
1
3
1
4 AT+MAIRCMD=O,T,50001,0
1
5 [OK]
The WizFi250 is now operating as Soft AP and is ready for Air Command with TCP 5001.
2
[OK]
3
4
[Link-Down Event]
5
WizFi250 Version 1.0.1.8 (WIZnet Co.Ltd)
6
7
[Link-Up Event]
8
IP Addr
: 192.168.11.1
9
Gateway
: 192.168.11.1
To send AT command to a WizFi250 in <Air Command Mode>, send WizFi250AirCmd: (15byte) first, and
then the AT command, and lastly <CR>(Carriage Return,0x0d) 1 byte.
The actual example is as below.
1
(TX)
2
WizFi250AirCmd:AT+MINFO\r (24 Byte)
3
(RX)
4
FW version/HW version
5
1.0.1.8/WizFi250 Rev 1.0
6
[OK]
7
8
(TX)
9
WizFi250AirCmd:AT+WSEC=?\r (25 Byte)
1
0 (RX)
11
1,WPA2,123456789
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
[OK]
(TX)
WizFi250AirCmd:AT+WSEC=1,WPA2,aaaabbbb\r (39 Byte)
(RX)
[OK]
(TX)
WizFi250AirCmd:AT+MMAC=?\r (25 Byte)
2
1 (RX)
2
2 00:08:DC:00:55:76
2
3 [OK]
1
(TX)
2
WizFi250AirCmd:AT+WSET=0,MySSID\rAT+WSEC=0,,12345678\rAT+WNET=1\rAT+MPROF=S\r
3
(RX)
4
[OK]
5
[OK]
6
[OK]
7
[OK]
8
9
(TX)
1
0 WizFi250AirCmd:AT+MRESET\r
If you send above commands, WizFi250 performs as below
1
AT+WSET=0,MySSID
2
AT+WSEC=0,,12345678
3
AT+WNET=1
4
AT+MPROF=S
5
AT+MRESET
It can be seen as below that the WIFI Provisioning values from the rebooted WizFi250 are correctly set.
1
WizFi250 Version 1.0.1.8 (WIZnet Co.Ltd)
2
3
at+mprof=vd
4
+WSET=0,MySSID,,0
5
+WSEC=0,,12345678
6
+WNET=1,192.168.13.1,255.255.255.0,192.168.13.1
7
+WREG=AU
8
+SCON=O,TSN,,0,5000,1
9
+SFORM=111111111,7b,2c,7d,0d,0a
1
0 +MMSG=2
11
+MMAC=00:08:DC:00:55:76
1
2
1
3
1
4
1
5
1
6
+USET=115200,N,8,1,N
+MECHO=1
+FWEBS=0,M
+FGPIO={1,1,3,0},{1,5,3,0},{1,6,3,0},{1,7,3,0},{1,8,3,0}
[OK]
Methods for setting up WizFi250 with a smartphone can be roughly divided into 2 ways.
1.
No concerns with problems that could occur from using an external MCU to set-up WizFi250 (SSID, Key, etc.)
2.
Uses a Web browser in HTTP format so all equipment with a Web browser can be set-up easily
<Cons>
1. Provides a general and very basic set-up menu that is not optimum for users
2. Inconvenience of having to access WizFi250, enter in the password, and pass through other set-up processes
B. An external MCU utilizing the AT Command to control WizFi250 and directly communicate with a smartphone app
<Pros>
1. Screen composition and other controls can be optimized (Ex: Automate WizFi250 AP to access and input
common information on its own and only require necessary items to be input manually)
2. Not only the WizFi250 but also the MCU can be set up the same way
<Cons>
1. A separate Application needs to be developed for each system used for the WizFi250 set-up (Android, IOS,
Windows, etc.)
(1) To set-up WizFi250, click <Pin 42, Function Button> and <WizFi250 Set-up Mode> will initiate.
Here, WizFi250 will switch to Soft AP Mode and run the internal Web Server
1
Set AP Mode & Web Server Launch
2
[OK]
3
WizFi250 Version 1.0.1.8 (WIZnet Co.Ltd)
4
5
[Link-Up Event]
6
IP Addr : 192.168.12.1
7
Gateway : 192.168.12.1
(2) After accessing WizFi250 Soft AP through the smartphone and WizFi250 Web Server through a Web browser, set up
the SSID, Key, etc.
A more detailed explanation for setting up through a Web browser is provided in the link below.
http://wizwiki.net/wiki/doku.php?id=products:wizfi250:wizfi250pg:web_config
B. An external MCU utilizing the AT Command to control WizFi250 and directly communicate with a smartphone app
(1) To set-up the Device, click the Button and <WizFi250 & MCU Set-up Mode> will initiate.
(2) Here, use the MCU to do the AT Command and set-up WizFi 250 to <Soft AP & TCP Server Mode>.
1
AT+WSET=1,My_WizFi250_AP_Mode
2
[OK]
3
AT+WSEC=1,WPA2,12345678
4
[OK]
5
AT+WNET=0,192.168.12.105,255.255.255.0,192.168.12.1
6
[OK]
7
AT+WJOIN
8
9
[Link-Up Event]
1
0 IP Addr : 192.168.12.105
11
Gateway : 192.168.12.1
1
2 [OK]
1
3 AT+SCON=O,TSN,,,5000,0
1
4 [OK]
(3) Access the promised SSID with the smartphone app, and the set up TCP Server from above. Then, the input
<WizFi250 and MCU Set Point> from the smartphone app will be delivered through WizFi250 to the MCU.
TCP Client Base composed smartphone apps TCP communication data can be assumed as below.
1
(TX) "Get-WiFi"
2
(RX) "OldSSID,OldKey,....."
3
(TX) "Set-WiFi NewSSID,NewKey,....."
4
(RX) "OK"
5
(TX) "Set-MCU option1,option2,....."
6
(RX) "OK"
(4) The MCU will save the necessary set points (option1, ), and apply the WizFi250-related set points (SSID, Key, )
through the AT Command to WizFi250.
Remote Control means the connection and control of the embedded devices from a remote location through a
wired or wireless network. It is becoming a must element for the IoT(Internet of Things) devices. You can find
more than 50 contents related to remote control in WIZnet museum site.
In this posting, we will provide a simple guide how you can implement Remote Control function in your
device using WIZnet products.
What to control?
We can control all devices such as light, door lock, air conditioner, boiler and etc.
How to control?
GPIO, UART, SPI, S2C & PWM are normally used.
What kind of solution will be used for the connectivity (including Internet connectivity)?
ZigBee, X20, Bluetooth are used for the local communication, and gateway device for
the Internet connectivity.
Without gateway, you can directly connect the device to Internet using Ethernet or WiFi
Here, we will explain how to develop remote control device using GPIO & WIZnet solutions (TCP/IP Ethernet
& WizFi2xx WiFi)
You can easily control GPIO just by changing high & low value, but should be careful of GPIO input voltage.
GPIO normally operates with 3.3V & 5V tolerant.
If your device does not support 3.3V, you need to isolate the voltage. For example, if you connect the lamp
operates with 220V to the MCU with 3.3V, the MCU will be critically damaged. To solve this kind of problem,
voltage isolation is required.
A. using a relay
Connect the GPIO to V_in. If you control the Hign/Low, the electromagnet will turn on or off the switch that
connects to +/-.
B. Using a Photo-Coupler
Photo-coupler is a device that used to transmit signals, data, or DC levels across a circuit interface while
providing high isolation between input & output. It operates in the same way of the Relay.
Connect the PIN 2 to Ground, and PIN 3 &4 to the device to control. If you input High/Low to PIN 1, internal
LED is on or off as PIN3 & 4 is connected or not.
B. WiFi Module
There are five WiFi products that WIZnet provides. Among them, we are recommending WizF210, WizFi220 &
WizFi250 for the embedded system. Those products operate based on AT command and support the UART or
SPI for MCU interface.
Source : http://wiznetmuseum.com/portfolio-items/arduino-ethernet-shield-tutorial
B. Remote Control using Relay & GPIO
Source : http://wiznetmuseum.com/portfolio-items/arduino-web-server-with-bmini-ethernet-relay-shieldbiemme-automations/
C. Remote control using GPIO & WizFi250
Source : http://wiznetmuseum.com/portfolio-items/control-moter-driver-using-wizfi250/