Socket interface for ESP8266. Implements the NetworkSocketAPI. Requires device to use the Espressif Firmware.

Dependencies:   ESP8266

Dependents:   ESP8266InterfaceTests HelloESP8266Interface

Fork of ESP8266Interface by NetworkSocketAPI

Note

This library assumes your ESP8266 is running the Espressif Firmware. For instructions on how to update your ESP8266 to use the correct firmware see the Firmware Update Wiki Page.

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 implimented

  • 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:
53:8ded612adb96
Parent:
51:eb8c3577e22d
Child:
56:34829ec3a3da
--- a/ESP8266Interface.h	Thu Mar 03 17:51:31 2016 +0000
+++ b/ESP8266Interface.h	Wed Mar 09 06:11:11 2016 +0000
@@ -22,13 +22,13 @@
 
 #define ESP8266_SOCKET_COUNT 5
 
-
 /** ESP8266Interface class
  *  Implementation of the NetworkInterface for the ESP8266
  */
 class ESP8266Interface : public WiFiInterface
 {
 public:
+
     ESP8266Interface(PinName tx, PinName rx, bool debug = false);
     virtual ~ESP8266Interface();
 
@@ -48,12 +48,15 @@
     virtual void destroySocket(SocketInterface *socket);
 
 private:
+
     ESP8266 _esp;
     bool _ids[ESP8266_SOCKET_COUNT];
     
     // Implementation of the SocketInterface for the ESP8266
-    struct ESP8266Socket : public SocketInterface
+    class ESP8266Socket : public SocketInterface
     {
+    public:
+    
         // ESP8266 specific details
         ESP8266 *_esp;
         ns_protocol_t _proto;
@@ -71,5 +74,4 @@
     };
 };
 
-
 #endif