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)
Branch:
api-changes
Revision:
46:6b1bd1268074
Parent:
45:538e5ce2f0d3
Child:
47:60a4b49e8b83
--- a/ESP8266Interface.cpp	Thu Feb 25 03:32:37 2016 -0600
+++ b/ESP8266Interface.cpp	Thu Feb 25 03:34:36 2016 -0600
@@ -83,10 +83,8 @@
         return NS_ERROR_NO_CONNECTION;
     }
 
-    _ip_address = _esp.getIPAddress();
-    _mac_address = _esp.getMACAddress();
-    if (!_ip_address || !_mac_address) {
-        return NS_ERROR_NO_ADDRESS;
+    if (!_esp.getIPAddress()) {
+        return NS_ERROR_DHCP_FAILURE;
     }
 
     return 0;
@@ -105,12 +103,12 @@
 
 const char *ESP8266Interface::getIPAddress()
 {
-    return _ip_address;
+    return _esp.getIPAddress();
 }
 
 const char *ESP8266Interface::getMACAddress()
 {
-    return _mac_address;
+    return _esp.getMACAddress();
 }
 
 SocketInterface *ESP8266Interface::createSocket(socket_protocol_t proto)