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:
57:2ad35ade7a83
Parent:
56:34829ec3a3da
--- a/ESP8266Interface.h	Thu Apr 21 06:11:08 2016 -0500
+++ b/ESP8266Interface.h	Tue May 10 14:31:58 2016 -0500
@@ -23,15 +23,15 @@
 #define ESP8266_SOCKET_COUNT 5
 
 /** ESP8266Interface class
- *  Implementation of the NetworkStack for LWIP
+ *  Implementation of the NetworkStack for the ESP8266
  */
 class ESP8266Interface : public NetworkStack, public WiFiInterface
 {
 public:
     /** ESP8266Interface lifetime
-     * @param tx TX pin
-     * @param rx RX pin
-     * @param debug Enable debugging
+     * @param tx        TX pin
+     * @param rx        RX pin
+     * @param debug     Enable debugging
      */
     ESP8266Interface(PinName tx, PinName rx, bool debug = false);
 
@@ -137,7 +137,7 @@
      *  @param address      The remote SocketAddress
      *  @param data         The packet to be sent
      *  @param size         The length of the packet to be sent
-     *  @return the         number of written bytes on success, negative on failure
+     *  @return             The number of written bytes on success, negative on failure
      *  @note This call is not-blocking, if this call would block, must
      *        immediately return NSAPI_ERROR_WOULD_WAIT
      */
@@ -150,7 +150,7 @@
      *                      If a packet is too long to fit in the supplied buffer,
      *                      excess bytes are discarded
      *  @param size         The length of the buffer
-     *  @return the         number of received bytes on success, negative on failure
+     *  @return             The number of received bytes on success, negative on failure
      *  @note This call is not-blocking, if this call would block, must
      *        immediately return NSAPI_ERROR_WOULD_WAIT
      */
@@ -163,7 +163,7 @@
      *  @note Callback may be called in an interrupt context.
      */
     virtual void socket_attach(void *handle, void (*callback)(void *), void *data);
-
+    
 private:
     ESP8266 _esp;
     bool _ids[ESP8266_SOCKET_COUNT];