FireBeetle_ESP8266_IOT_Microcontroller_SKU__DFR0489-DFRobot

FireBeetle ESP8266 IOT Microcontroller

Introduction

DFRobot FireBeetle is a series of low-power-consumption development hardware designed for Internet of Things (IoT). Firebeetle ESP8266 is a development board integrated with IoT WiFi, TCP/IP, 32-bit MCU, 10-bit ADC and multiple interfaces such as HSPI, UART, PWM, I2C and I2S. In DTIM10, the full power consumption to maintain WiFi connection reached to 1.2mW. Equipped with 16MB outer SPI flash memory, ESP8266 is available for programs and firmware storage. Compatible with Arduino programming enables Firebeetle ESP8266 to lower the barrier of programming. Operator can implement Arduino programming codes directly onto ESP8266 to reduce the difficulty of operating and increase the stability of board.

warning_yellow.png NOTE: There still remains some bugs to be detected and fixed by developers. In some cases some peripherals may not work perfectly by embedding Arduino sample codes in ESP8266. Much more functions implemented in Arduino are still under development and improvement. An alternative way is to change development tool such as RTOS and MicroPython towards a more operating-friendly experience in some conditions.

Specification

Board Overview

FireBeetle Board - ESP8266 is not only compatible with ESP8266 PinMap, but also make a special compatible with Arduino IDE PinMap. Dx (x=0,1,2,3...9)

warning_yellow.png NOTE: NC = Empty; VCC = VCC (5V under USB power supply, Around 3.7V under 3.7V lipo battery.power supply)

Tutorial

In this tutorial, we'll show you some basic operation with FireBeetle-ESP8266 Microcontroller.

Requirements

warning_yellow.png NOTE: CH340 driver is free to install for most of Windows OS, if you find there is no COM Port in Device Manager, please download the driver and install it.

Setup Arduino IDE Development Environment

For domestic users: https://downloadcd.dfrobot.com.cn/boards/package_DFRobot_index.json

For overseas users: https://raw.githubusercontent.com/DFRobot/FireBeetle-ESP8266/master/package_firebeetle8266_index.json

File->Preferences

paste url here

Now, the development environment has been installed, you can use it like a normal Arduino board.

The default LED for FireBeetle Board-ESP8266 is D5 (IO2), input following code:

// GPIO 2 (D5) has a LED_BLINK attached to it. Give it a name:
int LED_BLINK = 2;
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BLINK, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BLINK, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BLINK, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

warning_yellow.png NOTE: ESP8266 has different pinmap in different development environment, For example: the LED connects IO2, which maps D5 in Arduino IDE It is totally different mean with 2 and D2 !

Sample Code - Scan WiFi

After you have installed the FireBeetle ESP8266 development environment, it will comes with a lot of sample code in Arduino IDE, you can find them in File > Examples. The follow sample code scans the around WiFi:

/*
 *  This sketch demonstrates how to scan WiFi networks.
 *  The API is almost the same as with the WiFi Shield library,
 *  the most obvious difference being the different file you need to include:
 */
#include "ESP8266WiFi.h"

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

  // Set WiFi to station mode and disconnect from an AP if it was previously connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  Serial.println("Setup done");
}

void loop() {
  Serial.println("scan start");

  // WiFi.scanNetworks will 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);
}

Open your Arduino IDE serial monitor:

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents