The default setting is the library UNO This tutorial can be used directly without any modifications.
use mega2560 When only need to open uartWIFI.h File, UNO Commented, uncomment MEGA ,as follows:
Define UNO // Uncomment this line when you use it with UNO board
define MEGA // Uncomment this line when you use it with MEGA board
ITEADUINO MEGA2560 Wiring in FIG.
Here Xbee Expansion board jumper cap should be 2 and 3 Instead of 0 and 1 Here is wrong. Correct jumper cap as follows:
._ .. 3
Xbee Expansion board inserted in TX2 and RX2 This is a row on the mother. Figure:
Connected to the computer, plug 9V / 1A Adapter power supply, open Arduino compatible IDE You can view the serial monitor wifi Run the state. If you are using UNO After opening the monitor need to first click UNO Reset button on the board and click xbee Extended reset button board. Then you can see the serial monitoring information. use mega2560 You do not need to operate. IF YOU HAVE Module have no response Only need to click mega Reset button on the side of the board.
After a successful connection to the router, we get WiFi Module IP Address, serial printer information is as follows:
Next, you need to install the phone APK A. download link:
software currently only supports 4 Inch -7 Inch Android smartphone or tablet, 7 Inch flat-panel layout, then there may be gaps, but does not affect use.
After downloaded, enter set up Setting interface. Client input we just get IP Address and port number 8080 , Click Start, the connection appears successful: Successful connection server . Figure:
We set about re-key commands, scroll down to the bottom, will On and Off Instructions to CH0OFF and CH0ON Command can be set as long as the instruction is consistent with the code on the line If the switch state Instead, turn to the instruction, as shown:
When you're finished, click to return to the interface, then click on On and Off You can successfully control switch it!
Serial printer can receive the following information:
Download link library file: is as follows:
#define SSID ITEAD_2 // type your own SSID name
#define PASSWORD itead2468 // type your own WIFI password
extern int chlID; // client id (0-4)
void setup ()
pinMode (6, OUTPUT); // use mega does not change the wiring, then here to D24 pin
bool b = wifi.Initialize (STA, SSID, PASSWORD);
if (! b)
DebugSerial.println (Init error);
delay (8000); // make sure the module can have enough time to get an IP address
String ipstring = wifi.showIP ();
DebugSerial.println (ipstring); // show the ip address of module
if (wifi.confServer (1,8080))
DebugSerial.println (Server is set up);
void loop ()
char buf ;
int iLen = wifi.ReceiveMessage (buf);
if (iLen 0)
if (strcmp (buf, CH0ON) == 0)
digitalWrite (6, HIGH); // use mega does not change the wiring, then here to D24 pin
if (strcmp (buf, CH0OFF) == 0)
digitalWrite (6, LOW); // use mega does not change the wiring, then here to D24 pin
|Cash on Delivery||No|