WiFiBee-MT7681__Arduino_WiFi_Wireless_Programming__SKU__TEL0107-DFRobot

Introduction

The WiFi Bee MT7681 is an Arduino WiFi XBee module based on the MT7681 serial Wi-Fi module. It is compatible with an XBee slot, supports Arduino wireless programming and is ideal for Internet of Things (IoT), home automation and robotics applications. The WiFi Bee supports the IEEE802.11b/g/n standard protocols, with 2.4G Wi-Fi bands, 14 channels and WEP/WPA-PSK/WPA2-PSK/TKIP/AES encryption methods, compatible with many mainstream routers. It has STA and AP working modes, is free to switch, and supports TCP/IP communications. In addition the WiFi Bee also supports Smart Link intelligent connection. The unit is easy to use - just install the app (Android), and connect to your wireless router. The WiFi Bee has same pin mappings as an XBee. It can be inserted in any device which has an existing XBee socket for full networking capability. For Arduino UNO and Arduino Mega 2560 boards, the WiFi Bee can also be used as a wireless code upload module eliminating the need for a USB cable or physical connection. This is very convenient when debugging robots or mobile platforms. In addition the module breakouts include three I/O ports. Use it as a Wi-Fi remote control - each I/O supports software PWM outputs. You can configure the parameters using serial AT commands via the serial terminal.

There are also other wifi bee such as ESP32 and ESP8266 wifi bee for you to choose.

Features

Specification

Board Overview

Pin_map.png

Label Name Description
VCC VCC 3.3V only
IO0 GPIO 0 GIPO 0
IO1 GPIO 1 GIPO 1
IO2 GPIO 2 GIPO 2
GND GND GND
RESET Arduino Reset Reuse with GPIO 0, Arduino Reset Pin
WIFI Reset WiFi Reset Reset WiFi Only

WiFiBee Wireless Network Configuration

WiFiBee-MT7681 supports STA and AP mode. In the first, we'll demonstrate 3 kinds of connection methods under STA Mode:

  1. SmartLink (Android APP)
  2. Configure the wireless network parameters via AT command
  3. Configure the wireless network parameters via Arduino UNO/Mega2560
LED Status Mode
0.5/s Boot Mode
1/s Operational mode, not connect
2/s Operational mode, connected

Download App DFRobot IoT Manager

image:mt7681_smartlink_0.png|DFRobot IoT Manager image:mt7681_smartlink_1.png|

  1. Connect your phone to the target network, this is ouki image:mt7681_smartlink_2.png|

  2. Open DFRobot IoT Manager, Select SSID ouki, Enter WiFi Password image:mt7681_smartlink_3.png|

  3. Click Start Connection

    • Wait for some seconds, when the LED flashes slowly (2/s), it means it has been connected to the WiFi. You can see the device IP address in the APP.

Configure the wireless network parameters via AT command

WiFi Bee also supports AT Command configuration, you can use the Xbee USB Adapter to connect WiFi Bee. If you have a DFRobot Leonardo with Xbee socket, you can achieve the same purpose with following debugging code. (Note: Since Uno has only one serial port, it doesn't support the same method, but you can check the next chapter.)


void setup() {  // put your setup code here, to run once:
    Serial.begin(115200);
    Serial1.begin(115200);
    while(!Serial);
 }
void loop() {   // put your main code here, to run repeatedly:
    while(Serial.available())
        Serial1.write(Serial.read());
    while(Serial1.available())
        Serial.write(Serial1.read());
 }

Plug WiFi Bee on the Adapter, open Arduino IDE serial monitor (Serial assistant), input “+++” to enter AT mode

image:mt7681+++.png|1. Select no line ending, baudrate 115200bps, 8/n/1, input “+++” to enter AT mode image:mt7681+++ok.png|Return OK

image:mt7681_at+ssid.png|2. Select Both NL & CR, input AT+SSID=Your WiFi SSID (WiFi Name) image:mt7681_at+ssidok.png|Return OK

image:mt7681_at+passowrd.png|3. Input AT+PASSWORD=Your WiFI Password (WiFi Password) image:mt7681_at+passowrdok.png|Return OK

image:AT_Config_7.png|4. Input AT+CONNECT image:AT_Config_8.png|Return OK

Reboot WiFI Bee (Press WiFi Reset), when the led flashes slowly (2/s), it means it has setup the WiFi connection. The IP address is 192.168.1.3 More the AT command please refer to the below section WiFiBee AT Command

Configure the wireless network parameters via Arduino UNO/Mega2560

Requirements

Sample Code

  1. Plug WiFi Bee in the shield xbee socket
  2. Turn the shield switch to "‘’‘PROG’‘’"
  3. Upload the following sketch
  4. Turn the shield switch to ”‘’‘RUN’‘’“
void setup() {
  // put your setup code here, to run once:

}

const char ssid[]={
  "AT+SSID=ouki"};   // WiFi SSID
const char passwd[]={
  "AT+PASSWORD=88888888"}; // WiFi  password

void setup()
{
  Serial.begin(115200);

  delay(100);
  while(!Serial);
  Serial.print("+++");
  delay(1000);
  Serial.println(ssid);
  delay(100);
  Serial.println(passwd);
  delay(100);
  Serial.println("AT+REBOOT");
  delay(100);
}

void loop()
{
  while(Serial.available())
  {
    Serial.write(Serial.read());
  }
}

NOTE: RUN/PROG is the serial switch, when you upload the sketch via USB, you have to turn the switch to "PROG" side. Once you want to use Xbee module, you need to turn it back to the "RUN" side. (Wireless Programming)

Result

WiFi Bee IP Address

AT Command

AT Command is generally applied to the terminal equipment and PC communication, In this section, we use AT command to configure network parameters.

How to Use AT Command

AT Command Description
+++ Enter AT Mode
AT+SSID AT+SSID=? Request WiFi SSID AT+SSID=SSIDName Set SSID Name
AT+PASSWORD AT+PASSWORD=? Request WiFi Password AT+PASSWORD=PASSWORD Set WiFi Password
AT+CONNECT Connect WiFi
AT+DISCONNECT Disconnect WiFi
Note: Except "+++", other commands need to add carriage returns and linefeed symbols, so in the previous section, you need to switch to "no line ending" when entering "+++", switch to "both CR & LF" when entering other commands.
More the AT command, please refer to the WiFiBee AT Command List V1.1

WiFi Bee TCP Server Communication

WiFi Bee supports TCP & UDP service, in this section, we'll demonstrates the TCP <-->UART communication.

Requirements

Steps

  1. Plug WiFiBee on the adapter
  2. configure network parameter: "WiFiBee IP Address", "Port: 1000" (Port: 1000 is the WiFi Bee default server port. If you need it working under client mode, you need to configure its Remote Server Address, refer to AT Command List)
  3. Click "Open" to open the terminal

image:WiFiBee_Putty_configuration.png|Configurate Putty Parameter image:WiFiBee_Putty_communication.png|Putty image:WiFiBee_Serial.png|Serial

Arduino Wireless Programming

WiFIBee supports WiFi Wireless Programming function, just connect WiFi bee to network which you PC in. For now, it supports Arduino UNO, Mega2560, DFRduino M0.

Requirement

Steps

wifibee_mt7681_mega2560_connect.png

WiFiBee-MT7681 Wireless BurnTool

Arduino IDE

wifibee_mt7681_mega2560_upload_success.png

Result

Watch the board D13 indicator LED, it should be Blinking now.

WiFiBee AP Mode

WiFi Bee can work under STA and AP mode. When it works under AP mode, the device can connect to WiFi Bee directly. But please note, AP mode only support one device simultaneously. And the IP address under AP mode has been fixed to 192.168.81.1

1_ Mode Switch: STA->AP

AT Command Description
AT+ROLE=ROLE_AP Return OK
AT+REBOOT Reboot WiFiBee and enter AP Mode

2_ Mode Switch: AP->STA:

AT Command Description
AT+ROLE=ROLE_STA Return OK
AT+REBOOT Reboot WiFiBee and enter STA Mode

3_ Set and Query SSID and Password under AP Mode

AT Command Description
AT+SOFTAPCONF=? Return WiFiBee SSID and Password
AT+SOFTAPCONF=jansion1,a12345678 Set AP SSID and Password “jansion1” “a12345678”.

Ap.jpg

MT7681 Firmware Update

The users can update the firmware by themselves.

Requirements

Steps

image:mt7681_update_tool_open.png|1. Open MT7681 Update Tool image:mt7681_update_tool_select_file.png|2. Select the newest firmware image:mt7681_update_tool_uploading.png|3. Select COM port and click "Update"

4. Success

FAQ

Q&A Some general Arduino Problems/FAQ/Tips
Q1 The Led looks dim, and no flashing, why?
A Please press WiFi Reset Button, generally it is a power issue. The power consumption of WiFi bee is a little large.
Q2 How to make a remote GPIO control?
A If the module is in the local area network, you can send AT command to Port 1001 to control the GPIOs; If you want to make a remote control via Internet, you can try router port mapping. For now it doesn't support initiative remote server connection.
Q3 How to use SmartLink?
A The module will enter smartlink mode, once it can't access any WiFI network.
A For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More

DFshopping_car1.png Shopping from WiFiBee-MT7681 or DFRobot Distributor.

Category: DFRobot > Sensors & Modules > Communications > WiFi

Turn to the Top