Small e Development Board (ESP8266) connects Arduino for WiFi scanning

Source: Internet
Author: User

Bo Master's first article, Hope Toto support.

1, the first is the wiring.


VCC corresponds to Arduino Development Board 5V

GND Connection Gnd

TXD Connect TX

Rxd receiving RX

GPI00 Connect Gnd (This is uploaded when used, upload must be grounded, otherwise it will cause upload failure)

Wiring is not very simple.

Attach a picture


2. Then download the Esp8266 extension library.

Open the IDE and click File--preferences, as shown in


Fill this URL into the red circle on the map: Http://espduino.doit.am/package_esp8266com_index.json

Restarting the IDE

Click Tools, Development Board, Development Board Manager


Enter esp8266 in the search box and click to select the appropriate version to install. We choose 2.0.0.

Note: The installation process is lengthy and may take up to 20 minutes, please wait patiently. After all, it's a foreign site.

After the download is complete, we can change the development board to generic Esp8266 module as shown


3, then is the upload stage.

Compilation is a bit slow.

We click File---Example->esp8266wifi->wifiscan, and then click Upload

Upload must be aware that in the Arduino display upload when the small e-Development board quickly power off, and then power on. Failure to do so will cause the upload to fail.

The following image is a screenshot of the successful upload:


Congratulations on your success.

Open the Serial viewer, you will find the small e-Development Board (ESP8266) is scanning nearby WiFi, and displayed in the string, is not a sense of accomplishment.

Finished product screenshot:


Attach the sample code:

/* * This sketch demonstrates how to scan WiFi networks. * The API is almost the same as with the Wi-Fi Shield library, * The most obvious difference being the different file Y

  ou need to include:/* #include "ESP8266WiFi.h" void Setup () {serial.begin (115200);
  Set WiFi to station mode and disconnect from an AP if it is previously connected Wifi.mode (Wifi_sta);
  Wifi.disconnect ();

  Delay (100);
Serial.println ("Setup done");

  } void Loop () {serial.println ("scan start");
  Wifi.scannetworks would return the number of networks found int n = wifi.scannetworks ();
  Serial.println ("Scan done");
  if (n = = 0) serial.println ("No networks found");
    else {serial.print (n);
    Serial.println ("networks found");
      for (int i = 0, i < n; ++i) {//Print SSID and RSSI for each network found Serial.print (i + 1);
      Serial.print (":");
      Serial.print (Wifi.ssid (i));
      Serial.print ("(");
      Serial.print (Wifi.rssi (i)); SErial.print (")"); Serial.println ((Wifi.encryptiontype (i) = = Enc_type_none)? "
      ":"*");
    Delay (10);

  }} serial.println ("");
Wait a bit before scanning again delay (5000); }










Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.