ESP8266 Socket Library. AT Thinker firmware.

Dependents:   ESP8266_MQTT_HelloWorld ESP8266_IFTTT_Test ECE_4180_Lab_4 websocketmbed ... more

Fork of ESP8266Interface by ESP8266

This repository has been superceded

This project has moved to https://developer.mbed.org/teams/ESP8266/code/esp8266-driver/

This library works with the AT Thinker firmware.

Note

This library is currently in Beta. It is not feature complete and has some bugs, proceed with caution! Fixes and patches are welcome and appreciated!

Currently the ESP8266Interface Library has the following Abilities:

Working

  • TCP Client
  • UDP Client
  • Transparent mode (single connection of 1 type at a time)
  • Station Mode (connects to AP)

To be implemented

  • TCP Server
  • UDP Server
  • Multi Connection Mode (able to have up to 5 sockets at a time)
  • AP Mode (Make ESP Chip act like access point)
  • DNS Support (currently websites must be looked up by IP)
  • Error Recovery

Nice but not necessary

  • colorized text for ESP AT Commands in Command line (easier to differentiate from other text)
Revision:
44:3a7b6083210b
Parent:
32:cf071dc33972
Child:
45:c180905b5b79
--- a/ESP8266/ESP8266.h	Fri May 01 18:29:38 2015 +0000
+++ b/ESP8266/ESP8266.h	Wed Jun 03 18:21:19 2015 +0000
@@ -92,9 +92,17 @@
     /*
     * Legacy Start for UDP only connection in transparent mode
     * @param ip A string that contains the IP, no quotes
+    * @param id number between 0-4
     * @param port Numerical port number to connect to
+    * @param length number of characters in the message being sent
     */
-    bool startUDP(char* ip, int port);
+    bool startUDP(char* ip, int port, int id, int length);
+
+    /*
+    *Starts the ESP chip as a TCP Server
+    *@param port Numerical port of the server, default is 333
+    */
+    bool startTCPServer(int port = 333);
 
     /**
     * Close a connection
@@ -162,7 +170,7 @@
     * Send a command to the wifi module. Check if the module is in command mode. If not enter in command mode
     *
     * @param str string to be sent
-    * @param ACK string which must be acknowledge by the wifi module. If ACK == NULL, no string has to be acknoledged. (default: "NO")
+    * @param ACK string which must be acknowledge by the wifi module. If ACK == NULL, no string has to be acknowledged. (default: "NO")
     * @param res this field will contain the response from the wifi module, result of a command sent. This field is available only if ACK = "NO" AND res != NULL (default: NULL)
     *
     * @return true if successful