Anda di halaman 1dari 12

WizFi250 (Air Command Mode)

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,

WiFi Provisioning (Setting the SSID, Passphrase, or IP of the AP trying to connect)

Serial-to-WIFI function socket control (using AT+SCON)

WizFi250 GPIO control (Controlling the LED connected with WizFi250 by smart phone)

Checking the current WIFI information connected with WizFi250 (AT+WSTAT)

WizFi250 remote reset

+ 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

Input the command as above.


1
AT+MAIRCMD=O,T,50001,0

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.

(b) <Air Command Mode> by using GPIO


Click the function button (pin42) of the WizFi250-EVB, and the WizFi250 will operate in AP mode,
automatically enabling the <Air Command Mode>.
1
Set AP Mode & Web Server Launch

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

3. How to use WizFi250 <Air Command Mode>

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]

4. How to set WIFI using WizFi250 <Air Command Mode>

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]

Configuration WizFi250 using Smartphone


Project Description

Methods for setting up WizFi250 with a smartphone can be roughly divided into 2 ways.

A. Using a Web browser to access WizFi250 internal web server


B. An external MCU utilizing the AT Command to control WizFi250 and directly communicate with a smartphone app
Pros and cons of those two methods will be discussed below.

A. Using a Web browser to access WizFi250 internal web server


<Pros>

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.)

Now, we will delve deeper into the details of the process.


Of course, the directions below are simply a reenacted example so there may be some necessary changes.

A. Using a Web browser to access WizFi250 internal web server

(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.

To implement Remote Control using WIZnet


Project Description

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.

We can start the Remote Control by considering below

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)

Remote Control through GPIO

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.

WIZnet solution for Remote Control


A. TCP/IP Chip
WIZnet provides Fully Hardwired TCP/IP Ethernet controllers such as W5100, W5200, W5300 & W5500. You
can select one of them for the Ethernet based remote control system. You can check the features and difference
of each mode here.

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.

Examples from WIZnet Museum


We are introducing remote control examples from WIZnet Museum site.

A. LED Control through GPIO

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/

Anda mungkin juga menyukai