Skip to content

iotl/ESP8266

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP8266

Arduino library to support the Espressif ESP8266 WLAN module.

You need at least the official firmware version 2.0.0. This library is not yet stable, so the API may change at any time.

Features

  • Automatically set the baud rate of the serial interface
  • Send basic AT commands to the module
  • Connect to an access point
  • Establish a TCP, UDP or TLS connection to a server
  • Send and receive data from a server
  • Make GET and POST HTTP requests

Installation

Copy Esp8266 and optionally HttpRequest from the libraries folder into your Arduino library path (eg. $HOME/Arduino/libraries/).

Example

#include <Esp8266.h>
#include <HttpRequest.h>
#include <IPDParser.h>

Esp8266<HardwareSerial> esp(Serial);

void setup() {
    esp.configureBaud();
    esp.setBaud(9600);

    esp.joinAccessPoint("ssid", "psk");
    esp.setMultipleConnections(true);
}

void loop() {
    HttpRequest req("/ping");
    req.addParameter(F("key"), "my-api-key");

    esp.connectSecure(1, F("api.myservice.test"));
    esp.send(1, req.post());

    IPDParser parser(Serial);
    if(parser.parse()) {
        doSomething(parser.getPayload());
    }
}

About

Arduino Library for the ESP8266 WiFi Module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 80.0%
  • Other 16.6%
  • C 3.4%