A library for writing modern websockets applications with Arduino (ESP8266 and ESP32)

arduino-library-badge Build Status

Arduino Websockets

A library for writing modern websockets applications with Arduino (see prerequisites for supported platforms). This project is based on my project TinyWebsockets.

The library provides simple and easy interface for websockets work (Client and Server). See the basic-usage guide and the examples.

Please check out the TinyWebsockets Wiki for many more details!

Getting Started

This section should help you get started with the library. If you have any questions feel free to open an issue.

Prerequisites

Currently (version 0.5.*) the library only works with ESP8266, ESP32 and Teensy 4.1.

Installing

You can install the library from the Arduino IDE or using a release ZIP file from the Github release page. Detailed instructions can be found here.

Basic Usage

Client

Creating a client and connecting to a server:

WebsocketsClient client;
client.connect("ws://your-server-ip:port/uri");

Sending a message:

client.send("Hello Server!");

Waiting for messages:

client.onMessage([](WebsocketsMessage msg){
    Serial.println("Got Message: " + msg.data());
});

In order to keep receiving messages, you should:

void loop() {
    client.poll();
}

Server

Creating a server and listening for connections:

WebsocketsServer server;
server.listen(8080);

Accepting connections:

WebsocketsClient client = server.accept();
// handle client as described before :)

Full Examples

Client

#include <ArduinoWebsockets.h>
#include <ESP8266WiFi.h>

const char* ssid = "ssid"; //Enter SSID
const char* password = "password"; //Enter Password
const char* websockets_server = "www.myserver.com:8080"; //server adress and port

using namespace websockets;

void onMessageCallback(WebsocketsMessage message) {
    Serial.print("Got Message: ");
    Serial.println(message.data());
}

void onEventsCallback(WebsocketsEvent event, String data) {
    if(event == WebsocketsEvent::ConnectionOpened) {
        Serial.println("Connnection Opened");
    } else if(event == WebsocketsEvent::ConnectionClosed) {
        Serial.println("Connnection Closed");
    } else if(event == WebsocketsEvent::GotPing) {
        Serial.println("Got a Ping!");
    } else if(event == WebsocketsEvent::GotPong) {
        Serial.println("Got a Pong!");
    }
}

WebsocketsClient client;
void setup() {
    Serial.begin(115200);
    // Connect to wifi
    WiFi.begin(ssid, password);

    // Wait some time to connect to wifi
    for(int i = 0; i < 10 && WiFi.status() != WL_CONNECTED; i++) {
        Serial.print(".");
        delay(1000);
    }

    // Setup Callbacks
    client.onMessage(onMessageCallback);
    client.onEvent(onEventsCallback);
    
    // Connect to server
    client.connect(websockets_server);

    // Send a message
    client.send("Hi Server!");
    // Send a ping
    client.ping();
}

void loop() {
    client.poll();
}

Note: for ESP32 you only need to change to code that connects to WiFi (replace #include <ESP8266WiFi.h> with #include <WiFi.h>), everything else stays the same.

Server

#include <ArduinoWebsockets.h>
#include <ESP8266WiFi.h>

const char* ssid = "ssid"; //Enter SSID
const char* password = "password"; //Enter Password

using namespace websockets;

WebsocketsServer server;
void setup() {
  Serial.begin(115200);
  // Connect to wifi
  WiFi.begin(ssid, password);

  // Wait some time to connect to wifi
  for(int i = 0; i < 15 && WiFi.status() != WL_CONNECTED; i++) {
      Serial.print(".");
      delay(1000);
  }
  
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());   //You can get IP address assigned to ESP

  server.listen(80);
  Serial.print("Is server live? ");
  Serial.println(server.available());
}

void loop() {
  auto client = server.accept();
  if(client.available()) {
    auto msg = client.readBlocking();

    // log
    Serial.print("Got Message: ");
    Serial.println(msg.data());

    // return echo
    client.send("Echo: " + msg.data());

    // close the connection
    client.close();
  }
  
  delay(1000);
}

Note: for ESP32 you only need to change to code that connects to WiFi (replace #include <ESP8266WiFi.h> with #include <WiFi.h>), everything else stays the same.

Binary Data

For binary data it is recommended to use msg.rawData() which returns a std::string, or msg.c_str() which returns a const char*. The reason is that msg.data() returns an Arduino String, which is great for Serial printing and very basic memory handling but bad for most binary usages.

See issue #32 for further information.

SSL and WSS Support

No matter what board you are using, in order to use WSS (websockets over SSL) you need to use

client.connect("wss://your-secured-server-ip:port/uri");

The next sections describe board-specific code for using WSS with the library.

ESP8266

With the esp8266 there are multiple ways for using WSS. By default, ArduinoWebsockets does not validate the certificate chain. This can be set explicitly using:

client.setInsecure();

You can also use a SSL Fingerprint to validate the SSL connection, for example:

const char ssl_fingerprint[] PROGMEM = "D5 07 4D 79 B2 D2 53 D7 74 E6 1B 46 C5 86 4E FE AD 00 F1 98";

client.setFingerprint(ssl_fingerprint);

or you could use the setKnownKey() method to specify the public key of a certificate in order to validate the server you are connecting to.

PublicKey *publicKey = new PublicKey(public_key);
client.setKnownKey(publicKey);

or you can specify the Certificate Authority (CA) using setTrustAnchors method, as follows:

X509List *serverTrustedCA = new X509List(ca_cert);
client.setTrustAnchors(serverTrustedCA);

For client-side certificate validation, you can use RSA or EC certificates, using the method setClientRSACert or setClientECCert .

ESP32

With the esp32 you could either provide the full certificate, or provide no certificate. An example for setting CA Certificate:

const char ssl_ca_cert[] PROGMEM = \
    "-----BEGIN CERTIFICATE-----\n" \
    "MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/\n" \
    "MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \
    "DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow\n" \
    "SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT\n" \
    "GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC\n" \
    "AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF\n" \
    "q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8\n" \
    "SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\n" \
    "Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA\n" \
    "a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj\n" \
    "/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T\n" \
    "AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG\n" \
    "CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv\n" \
    "bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k\n" \
    "c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw\n" \
    "VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC\n" \
    "ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz\n" \
    "MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu\n" \
    "Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF\n" \
    "AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo\n" \
    "uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/\n" \
    "wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu\n" \
    "X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG\n" \
    "PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6\n" \
    "KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\n" \
    "-----END CERTIFICATE-----\n";

client.setCACert(ssl_ca_cert);

TEENSY 4.1

Currently WSS is not implemented.

Contributing

Contributions are welcomed! Please open issues if you have troubles while using the library or any queshtions on how to get started. Pull requests are welcomed, please open an issue first.

Contributors

Thanks for everyone who reported a bug, suggested a feature and contributed to the development of this library.

arnoson
⭐️ arnoson

ramdor
⭐️ ramdor

xgarb
⭐️ xgarb

matsujirushi
matsujirushi

bastienvans
bastienvans

johneakin
johneakin

lalten
lalten

adelin-mcbsoft
⭐️ adelin-mcbsoft

Jonty
⭐️ Jonty

Nufflee
Nufflee

mmcArg
mmcArg

JohnInWI
JohnInWI

logdog2709
logdog2709

elC0mpa
elC0mpa

oofnik
⭐️ oofnik

zastrixarundell
⭐️ zastrixarundell

elielmarcos
elielmarcos

Change Log

  • 14/02/2019 (v0.1.1) - Initial commits and support for ESP32 and ESP8266 Websocket Clients.
  • 16/02/2019 (v0.1.2) - Added support for events (Pings, Pongs) and more internal improvements (events handling according to RFC-6455)
  • 20/02/2019 (v0.1.3) - Users now dont have to specify TCP client types (ESP8266/ESP32) they are selected automatically.
  • 21/02/2019 (v0.1.5) - Bug Fixes. Client now exposes a single string connect interface.
  • 24/02/2019 (v0.2.0) - User-facing interface is now done with Arduino's String class. Merged more changes (mainly optimizations) from TinyWebsockets.
  • 25/02/2019 (v0.2.1) - A tiny patch. Fixed missing user-facing strings for client interface.
  • 07/03/2019 (v0.3.0) - A version update. Now supports a websockets server, better support for fragmented messages and streams. bug fixes and more optimized networking implementations.
  • 08/03/2019 (v0.3.1) - Small patch. Merged changes from TinyWebsockets - interface changes to callbacks (partial callbacks without WebsocketsClient& as first parameter).
  • 12/03/2019 (v0.3.2) - Fixed a bug with behaviour of WebsokcetsClient (copy c'tor and assignment operator). Added close codes from TinyWebsockets. Thank you @ramdor
  • 13/03/2019 (v0.3.3) - Fixed a bug in the esp8266 networking impl. Thank you @ramdor
  • 14/03/2019 (v0.3.4) - changed underling tcp impl for esp8266 and esp32 to use setNoDelay(true) instead of sync communication. This makes communication faster and more relaiable than default. Thank you @ramdor for pointing out these methods.
  • 06/04/2019 (v0.3.5) - added very basic support for WSS in esp8266 (no support for fingerprint/ca or any kind of chain validation).
  • 22/04/2019 (v0.4.0) - Added WSS support for both esp8266 and esp32. E328266 can use client.setInsecure() (does not validate certificate chain) or client.setFingerprint(fingerprint) in order to use WSS. With ESP32 there is client.setCACert(certificate) that can be used. (Usage is same as the built in WiFiClientSecure).
  • 18/05/2019 (v0.4.1) - Patch! Addressed an error with some servers. The bugs where first noted in issue #9. Bug was that some servers will drop connections that don't use masking, and TinyWebsockets does not use masking by default. TinyWebsockets changed that and this library merged the changes.
  • 24/05/2019 (v0.4.2) - Patch! Adressed masking issues - server to client messages would get masked but RFC forbbids it. (changes merged from TinyWebsockets)
  • 07/06/2019 (v0.4.3) - Patch! Fixed a bug on some clients (mainly FireFox websokcets impl). Thank you @xgarb (related issue)
  • 09/06/2019 (v0.4.4) - Patch! Fixed an issue with close event callback not called in some cases (sudden disconnect, for example). Thank you @adelin-mcbsoft for pointing out the issue (related issue)
  • 14/06/2019 (v0.4.5) - Patch! Fixed a memory leak and an unnecessary use of heap memory in case of masking messages. This was discoverd thanks to issue #16. Thank you xgarb!
  • 13/07/2019 (v0.4.6) - Very small update. Changed readme to document esp32's secured client behvior (As discussed in issue #18). Also esp32's version of WebsocketsClient now has a setInsecure method. Thank you adelin-mcbsoft!
  • 25/07/2019 (v0.4.7) - Bugfix. Fixed issues with receving large messages (unchecked reads) which was pointed out in in issue #21). Thank you Jonty!
  • 26/07/2019 (v0.4.8) - Feature. Added an addHeader method as suggested in issue #22). Thank you mmcArg!
  • 01/08/2019 (v0.4.9) - Patch - Bugfix. Worked around a bug where connecting to unavailable endpoints would not return false (this is a bug with the WiFiClient library itself). Added some missing keywords. Thank you Nufflee for pointing out the issue!
  • 10/08/2019 (v0.4.10) - Patch - Bugfix. Fixed a bug (and general in-stability) caused from unchecked and unsafe read operations on sockets. Also improved memory usage and management. Thank you Jonty for openning and helping with the issue!
  • 14/09/2019 (v0.4.11) - Bugfixes - masking settings used to not get copied when using assignment between WebsocketClient instances. Also handshake validation is now case insensitive. Thank you logdog2709 for pointing out the issue.
  • 12/10/2019 (v0.4.12) - Patch - Messages are now sent as a single TCP buffer instead of separate messages. Thank you elC0mpa for posting the issue.
  • 19/10/2019 (v0.4.13) - Patch - added yield calls in order to prevent software-watchdog resets on esp8266 (on long messages). Thank you elC0mpa for documenting and helping with the issue.
  • 22/11/2019 (v0.4.14) - Added rawData and c_str as acccessors in WebsocketsMessage so now the raw data can be acccessed which should solve issue #32 and not break any existing sketch.
  • 24/02/20 (v0.4.15) - Added Origin and User-Agent headers to requests sent by the library, this seems to be required by some servers. Thank you imesut for pointing out the issue.
  • 21/04/20 (v0.4.16) - Merged pull request by @oofnik which added 2 way SSL auth for ESP32 and ES8266. Thank you very oofnik for the contribuation.
  • 25/04/20 (v0.4.17) - Merged pull request by Luka Bodroža (@zastrixarundell) which fixed issue #69 - default headers (like Origin, Host) are now customizable via the addHeader method. Thank you zastrixarundell for the contribution.
  • 23/07/20 (v0.4.18) - Merged pull request by Adelin U (@adelin-mcbsoft) which fixed issue #84 - SSL bug-fixing, implemented public-key certificate validation & EC Certificates for client-side. Thank you Adelin!
  • 28/11/20 (v0.5.0) - Support for Teensy 4.1 added by the awesome @arnoson. Supporting plaintext client/server communication and providing new and useful examples. Thank you arnoson!
  • 10/05/21 (v0.5.1) - Fingerprints and Certificates in the examples were updated by @Khoi Hoang . Thank you Khoi!
  • 29/07/21 (v0.5.2) - Merged PR by ONLYstcm which added a (configurable) timeout for connections. Thank you ONLYstcm.
  • 06/08/21 (v0.5.3) - Merged PR by ln-12 which added a connectSecure method to support WSS connection with the classic interface (host, port, path). Thank you!
Owner
Gil Maimon
Professional Copy-Paster & Hobbist Programmer. I enjoy C++, Python and everything in between. I also maintain some Arduino libraries for personal and public use
Gil Maimon
Comments
  • ESP8266 crashes when is receiving data from websocketserver

    ESP8266 crashes when is receiving data from websocketserver

    Describe the bug I am using your library to receive a JSON file from a websocketserver. When it receive the file, it starts printing hexadecimal numbers and after two seconds aproximately the esp8266 restarts.

    To Reproduce Version : 0.4.11 Board : NODEMCU Only using this library

    Expected behavior I expect to receive the json file, wich is received as a string, and later i want to print it By using serial library

    Additional context I supposed that this problem was related to the receive buffer size, so I execute the same code, but receiving a short json file and it worked as expected, so I think the problem is not related to code.

  • How to keep receiving messages in server

    How to keep receiving messages in server

    #include <WiFi.h>
    #include <ArduinoWebsockets.h>
    
    const char* ssid = "SSID";
    const char* password = "PASS";
    
    using namespace websockets;
    WebsocketsServer server;
    
    void setup() {
      Serial.begin(115200);
    
      IPAddress apIP(192, 168, 0, 1);   //Static IP for wifi gateway
      WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); //set Static IP gateway on NodeMCU
      WiFi.softAP(ssid, password); //turn on Hotspot
    
      server.listen(80);
    }
    
    void loop() {
      auto client = server.accept();
      if(client.available()) {
        auto msg = client.readBlocking();
    
        // log
        Serial.print("Got Message: ");
        Serial.println(msg.data());
    
        // return echo
        client.send("Echo: " + msg.data());
    
        // close the connection
        client.close();
      } 
    }
    

    This is my code and I want to listen multiple message from a Single client, but when I receive a message then It stops receiving messages and client.available() returning 0 after that, I have tried putting client.poll(); in loop but It's not working.

  • WSS Not working for some sites.

    WSS Not working for some sites.

    Using your example, I can connect to wss://echo.websocket.org but not wss://ws-feed.pro.coinbase.com, nor wss://api.bitfinex.com/ws/2.

    I've tried with fingerprint and with client.setInsecure(), no luck.

    Some logs:

    14:19:08.149 -> connect ws... 14:19:08.149 -> [hostByName] request IP for: api.bitfinex.com 14:19:08.184 -> pm open,type:2 0 14:19:08.184 -> [hostByName] Host: api.bitfinex.com IP: 104.16.171.181 14:19:08.252 -> :ref 1 14:19:08.287 -> BSSL:_connectSSL: start connection 14:19:08.321 -> :wr 221 0 14:19:08.321 -> :wrc 221 221 0 14:19:08.356 -> :ack 221 14:19:08.391 -> :rn 536 ....................................... 14:19:09.598 -> :rdi 32, 32 14:19:09.598 -> :c0 32, 43 14:19:09.632 -> BSSL:Connected! 14:19:09.632 -> :wr 180 0 14:19:09.632 -> :wrc 180 180 0 14:19:09.737 -> :ack 180 14:19:09.737 -> BSSL:read: failed 14:19:09.737 -> BSSL:read: failed 14:19:09.771 -> BSSL:read: failed 14:19:09.805 -> BSSL:read: failed 14:19:09.805 -> BSSL:read: failed 14:19:09.839 -> BSSL:read: failed 14:19:09.839 -> BSSL:read: failed 14:19:09.874 -> BSSL:read: failed 14:19:09.874 -> BSSL:read: failed 14:19:09.908 -> BSSL:read: failed 14:19:09.908 -> BSSL:read: failed 14:19:09.943 -> BSSL:read: failed 14:19:09.977 -> BSSL:read: failed 14:19:09.977 -> BSSL:read: failed 14:19:10.011 -> BSSL:read: failed 14:19:10.011 -> BSSL:read: failed 14:19:10.046 -> :rn 536 14:19:10.046 -> :rch 536, 173 14:19:10.080 -> :rch 709, 125

    If I try connecting to the unsecured ones (ws://api.bitfinex.com/ws/2)

    14:23:46.080 -> connect ws... 14:23:46.080 -> [hostByName] request IP for: api.bitfinex.com 14:23:46.115 -> pm open,type:2 0 14:23:46.149 -> [hostByName] Host: api.bitfinex.com IP: 104.16.175.181 14:23:46.183 -> :ref 1 14:23:46.218 -> :wr 159 0 14:23:46.218 -> :wrc 159 159 0 14:23:46.288 -> :ack 159 14:23:46.288 -> :rn 288 14:23:46.288 -> :wr 2 0 14:23:46.288 -> :wrc 2 2 0 14:23:46.323 -> :wr 2 0 14:23:46.323 -> :wrc 2 2 0 14:23:46.358 -> :ack 2 14:23:46.358 -> :rch 288, 332 14:23:46.358 -> :rcl 14:23:46.358 -> :abort 14:23:46.392 -> Connnection Closed

    Any ideas?

    Thanks a lot

  • webSockets client and server on same ESP ?

    webSockets client and server on same ESP ?

    Hello Gil

    This looks like an awesome alternative to other libraries, and I'm quite excited to try it ;-)

    I just need to know the following please :

    1. I need to have the server and client on the same ESP. is this possible and if so could you kindly explain how or provide an example ? Please see attached pic for reference.

    2. I would like to enable to disable the connection(client and/or server) when desired/required, independently of eachother. For example (pseudo code) : client enable do something client disable and same as above for server

    3. Are you able to call (and control - disable/enable) client and/or server from anywhere other than the main loop ?

    Really looking forward to your reply

    Kind regards

    Den

    websockets client and server in one

  • Using client.send() outside the loop (FireFox client incompatibility)

    Using client.send() outside the loop (FireFox client incompatibility)

    Hi. This might be more of a programming question again but...

    Something like this works:

    void delete_all_faces() {
      delete_face_all_in_flash_with_name(&st_face_list);
    }
    void handle_message(WebsocketsMessage msg) {
      if (msg.data() == "delete_all") {
        delete_all_faces();
        g_state = DELETE_ALL;
      }
    }
    void loop() {
       auto client = socket_server.accept();
       client.onMessage(handle_message);
       while (client.available()) {
          client.poll();
          switch (g_state) {
             case DELETE_ALL:
             client.send("All Faces Deleted");
             break;
             case ...
          }
       }
    }
    

    But I would prefer to send the message from the delete_all_faces function something like this...

    void delete_all_faces() {
      delete_face_all_in_flash_with_name(&st_face_list);
      client.send("All Faces Deleted");
    }
    void handle_message(WebsocketsMessage msg) {
      if (msg.data() == "delete_all") {
        delete_all_faces();
      }
    }
    void loop() {
      auto client = socket_server.accept();
      client.onMessage(handle_message);
      while (client.available()) {
        ...
      }
    }
    

    Is it possible to make 'client' accessible outside the loop?

  • Library does not handle server/network failure (disconnect basically).

    Library does not handle server/network failure (disconnect basically).

    Hi,

    I'm using the code from the Client Example for an SSL server. Most of it works as expected, however - if I shutdown the WebSocket server I'm connected to or even disconnect the network, no event is being triggered. Surprisingly, even if i call client.available() it returns true, even though the server is shut down or there's no network connection to it...

    I'm using an ESP-WROOM-32 board if and an NGinx WebSocket server. The socket server works without any issue with any browser client (tested EDGE, Firefox, Chrome) and these browsers successfully report a server disconnect or so.

    As told, code is the one from the client example:

    #include <ArduinoWebsockets.h>
    #include <WiFi.h>
    
    const char* ssid = "WiFi Name"; //Enter SSID
    const char* password = "WiFi Password"; //Enter Password
    const char* websockets_server = "wss://url.com:443/ws/"; //server adress and port
    
    using namespace websockets;
    
    void onMessageCallback(WebsocketsMessage message) {
        Serial.print("Got Message: ");
        Serial.println(message.data());
    }
    
    void onEventsCallback(WebsocketsEvent event, String data) {
        if(event == WebsocketsEvent::ConnectionOpened) {
            Serial.println("Connnection Opened");
        } else if(event == WebsocketsEvent::ConnectionClosed) {
            Serial.println("Connnection Closed");
        } else if(event == WebsocketsEvent::GotPing) {
            Serial.println("Got a Ping!");
        } else if(event == WebsocketsEvent::GotPong) {
            Serial.println("Got a Pong!");
        }
    
        Serial.println("Event triggered...");
    }
    
    WebsocketsClient client;
    void setup() {
        Serial.begin(115200);
        // Connect to wifi
        WiFi.begin(ssid, password);
    
        // Wait some time to connect to wifi
        for(int i = 0; i < 10 && WiFi.status() != WL_CONNECTED; i++) {
            Serial.println(".");
            delay(1000);
        }
    
        Serial.println("Connected to WiFi... probably.");
    
        // Setup Callbacks
        client.onMessage(onMessageCallback);
        client.onEvent(onEventsCallback);
        
        // Connect to server
        client.connect(websockets_server);
    
        // Send a message
        client.send("This is a nice little message sent from ESP32.");
    }
    
    void loop() {
      if (client.available()) {
        client.poll();
      } else {
        Serial.println("OOPS!! Client Disconnected...");
        delay(5000);
      }
    }
    

    If there's any detail I can help you with to debug this issue, just let me know. All the best, A.

  • websocket and client on same server - possible bug

    websocket and client on same server - possible bug

    Hi Gil

    Hope all's well with you.

    As you may recall I have been testing your websockets on the ESP8266 and the tests have been good so far. I'm hoping you could possibly identify/clarify some strange anomalies. I am running both client and server on the same ESP8266.

    Please refer to this image: websockets client and server in one A is a client (web browser) and needs to stay connected all the time until A decides it wants to disconnect B is the ESP running both client and server. When B receives a certain message , B fires up the websocket client portion and as w ebsocket client establishes a connection with C (C is running as a websockets server) The above happen successfully (YAY ;-)) BUT after B closes the connection (client disconnect) with C , the connection of A to B is lost. :-( I have tried to set B not to close the connection to C ( no disconnect) but the same behavior occurs between A and B. So I end up having to refresh the browser at A which re-establishes the connection from A to B.

    Could you possibly shed some light as to how or where I could check and fix this ?

    I'm not sure if this your software that may be causing the following : Sometimes base on the problem in point 1. above , I am unable to re-establish a browser and/or websocket connection from A to B . Its seems like B just stops servicing browser and/or websocket requests and sometimes a ping even though the serial console is still responding quite fine. Any thoughts ?

    Kind regards Den

  • client.send() does not mask the messages

    client.send() does not mask the messages

    Hi Gil,

    Me again. I want to bring to your attention the following situation:

    Messages that go through client.send() are sent in plain-text, unmasked (see more about websocket masking). However, it seems that the library understands and successfully decodes the received masked messages.

    How I tested:

    1. When you use the HTML5 send() method to send a message, the messages are automatically masked by the browser and sent to the server.
    2. At the server, the messages come masked, and the server decodes it. In PHP, I'm using the following function to unmask:
    /**
         * @method  unmask
         * @param   $text   string
         * @return  string
         * @desc    Unmask incoming framed message
         */
        private function unmaskReceivedData($text) {
            $length = ord($text[1]) & 127;
    
            if($length == 126) {
                $masks = substr($text, 4, 4);
                $data = substr($text, 8);
            } elseif($length == 127) {
                $masks = substr($text, 10, 4);
                $data = substr($text, 14);
            } else {
                $masks = substr($text, 2, 4);
                $data = substr($text, 6);
            }
    
            $text = '';
            for ($i = 0; $i < strlen($data); ++$i) {
                $text .= $data[$i] ^ $masks[$i%4];
            }
            return $text;
        }
    

    AFAIK, this method is being written according to the RFC standards. From there, on my server I decode (unmask) the message, process it, then mask it again to broadcast to all the connected clients.

    For masking I'm using the following code:

        private function maskSentData($text)  {
            $b1 = 0x80 | (0x1 & 0x0f);
            $length = strlen($text);
    
            $header = '';
    
            if($length <= 125)
                $header = pack('CC', $b1, $length);
            elseif($length > 125 && $length < 65536)
                $header = pack('CCn', $b1, 126, $length);
            elseif($length >= 65536)
                $header = pack('CCNN', $b1, 127, $length);
            return $header . $text;
        }
    

    When I broadcast it, the browser and the ESP32 receive it successfully.

    However, when I try to send a message through libraries client.send(text) method, all the messages received on the server are plain, not masked in any way (and of course, the servers unmask method fails).

    Just a note to this: Something might had happen recently (through an update or so) because few weeks ago (when we had issue #14 ), this bug didn't happen (though I cannot identify where the change could come from...).

    You know the library as better as anyone, so I'm pretty sure you can shed some light here.

    If you need any more info from me, just let me know. Hope it helps,

    Thanks, Best, A.

  • get messages from the server

    get messages from the server

    Hi, I have some troubles with getting msg from the server. From ESP8266 to server is not problem, but whem the server send a msg to ESP it didn't catch. My server is nodejs + websocket version 7.2.1. here is the part of the code .... const WebSocket = require('ws'); const s = new WebSocket.Server({ server }); s.on('connection',function(ws,req){ const ip = req.connection.remoteAddress; console.log("new client connected with ip: ", ip);

        /******* when server receives messsage from client trigger function with argument message *****/
        ws.on('message',function(message){
        console.log("Received: "+message); // up to here, all is working!!
    
        ws.send('Hello from the server'); // this line is not working
    

    ESP8266 code ....

    bool connected = client.connect(websockets_server_host, port, "/"); if(connected) { Serial.println("Connected!!"); client.send("hello server"); // this is print on the server console..ok!! }else{ Serial.println("Not connected"); } // up to here all is working !!!

    client.onMessage([&](WebsocketsMessage message) { Serial.print("Got Message: "); Serial.println(message.data()); }); //not working, nothing is printed.

    What i am doing wrong? Thanks

  • Not connecting to WSS Server

    Not connecting to WSS Server

    Hi, I'm trying to connect to a WSS server using a custom library I built for the ESP32 module. I followed the instructions in the readme, but I can't seem to get it to connect or troubleshoot the errors. I may need some guidance here as I'm not that experienced.

    I am using the Arduino websocket server 0.4.17 The WebsocketServer URL is "wss://ws.finnhub.io?token=xxxxxxxxx" (you'll have to generate a free token on the website at finnhub.io).

    The Websocket client was declared in the library class called Stock

    private:
        unsigned long _baudRate;
    
    public:
        WebsocketsClient client;
    
    public:
        int responseCode;
    
    

    The object is instantiated, the pins are initialized and the client attempts to connect to the WSS server after the WiFi connects successfully.

    String serverPath = apiUrl + token;
    
    Stock TSLA(OUTPUT26, OUTPUT27, baud, onMessageCallback, onEventsCallback, serverPath);
    
    void setup() {
      //Call init function to initialise the pins in order to allow time for the hardware to settle to a stable state before being used.
        TSLA.init();
      WiFi.begin(ssid, password);
      Serial.println("Connecting");
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
      Serial.println("");
      Serial.print("Connected to WiFi network with IP Address: ");
      Serial.println(WiFi.localIP());
        TSLA.client.connect(serverPath);
    }
    

    I think this is suppose to check for updates from the server...

    void loop() {
      //Send an HTTP POST request every 10 minutes
      if ((millis() - lastTime) > timerDelay) {
        //Check WiFi connection status
        if (WiFi.status() == WL_CONNECTED) {
          Serial.print(TSLA.client.available());
          Serial.print(TSLA.connected);
            TSLA.client.poll();
        }
        else {
          Serial.println("WiFi Disconnected");
        }
        lastTime = millis();
      }
    }
    

    The issue is that TSLA.client.available returns 0 and TSLA.client.connected also has a value of 0

  • Websocketclient disconnected from websocketserver

    Websocketclient disconnected from websocketserver

    Describe the bug Websocketclient is disconnected from websocketserver after client get a ping from server

    To Reproduce Library : 0.4.11 Board : NodeMCU Steps to reproduce the behavior.

    Expected behavior I just hope the client doesn't disconnect from server

    Additional context When this first happens, I thought it was because of a bug of the library, but i realized that the websocketserver makes a ping to the client when it receives a connection, so I decided to supress this behavior. After doing this, the websocketclient worked as expected, but i have no idea of what am i doing wrong. I suppose that i should modify the code when the client receives a Ping, something like answer with a pong, but i am not sure

  • Hieromon/AutoConnect & WebSockets Client on ESP8266 - Can't Establish wss

    Hieromon/AutoConnect & WebSockets Client on ESP8266 - Can't Establish wss

    Describe the bug I'm trying to integrate the AutoConnect library with ArduinoWebsockets. When I attempt to use the AutoConnect library in conjunction with ArduinoWebsockets, the ESP8266 can never set up an initial connection to wss://. I have tried this both with client.setInsecure() as well as with client.setFingerprint(). If I remove the AutoConnect library from the build and do a manual hard-coding of WifiCredentials and use that to establish a connection, I am able to establish a wss:// connection successfully.

    To Reproduce Steps to reproduce the behavior. This should include:

    Expected behavior I would expect the wss:// connection work work irrespective of if AutoConnect is used or not to setup the initial Wifi connection.

    I have tested this on an ESP32 board (lolin_d32), and it works fine (although client.setInsecure() does not work with this library and esp32, but that is a bug report for another time).

    Code

    /*
      Secured Esp8266 Websockets Client
      This sketch:
            1. Connects to a WiFi network
            2. Connects to a Websockets server (using WSS)
            3. Sends the websockets server a message ("Hello Server")
            4. Sends the websocket server a "ping"
            5. Prints all incoming messages while the connection is open
        NOTE:
        The sketch dosen't check or indicate about errors while connecting to 
        WiFi or to the websockets server. For full example you might want 
        to try the example named "Esp8266-Client" (And use the ssl methods).
      Hardware:
            For this sketch you only need an ESP8266 board.
      Created 15/02/2019
      By Gil Maimon
      https://github.com/gilmaimon/ArduinoWebsockets
    */
    
    #include <ArduinoWebsockets.h>
    #ifdef ESP32
      #include <WiFi.h>
    #endif
    #ifdef ESP8266
      #include <ESP8266WiFi.h>
      #include <ESP8266WebServer.h>
    #endif
    #include <ArduinoJson.h>
    #include <AutoConnect.h>
    
    
    const char* websockets_connection_string = "wss://<placeholder AWS API Gateway websocket>"; //Enter server adress
    // other examples to test with
    //const char* websockets_server_host = "wss://echo.websocket.org/";
    //const char* url_path = "/api/"; // this is the URI separate form host
    
    
    AutoConnect portal;
    AutoConnectConfig  config;
    bool acEnable;
    
    // CA Cert Test
    #ifdef ESP32
    const char aws_ssl_ca_cert[] PROGMEM = \
    "-----BEGIN CERTIFICATE-----\n" \
    "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \
    "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \
    "b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n" \
    "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n" \
    "b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n" \
    "ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n" \
    "9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n" \
    "IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n" \
    "VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" \
    "93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n" \
    "jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" \
    "AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n" \
    "A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n" \
    "U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n" \
    "N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n" \
    "o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n" \
    "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \
    "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \
    "-----END CERTIFICATE-----\n";
    #endif 
    
    #ifdef ESP8266
    const char ssl_fingerprint[] PROGMEM = "DA 04 49 CB 7A 77 FC 8D 6E 3B F7 65 1F 12 B9 E8 EC BF 28 2A";
    #endif
    
    
    
    using namespace websockets;
    WebsocketsClient client;
    
    // global for our JSON doc
    StaticJsonDocument<200> doc;
    
    void onMessageCallback(WebsocketsMessage message) {
        Serial.print("Got Message: ");
        Serial.println(message.data());
    }
    
    void onEventsCallback(WebsocketsEvent event, String data) {
        if(event == WebsocketsEvent::ConnectionOpened) {
            Serial.println("Connnection Opened");
            char client_msg[200];
            serializeJson(doc,client_msg);
            Serial.println(client_msg);
            client.send(client_msg);
        } else if(event == WebsocketsEvent::ConnectionClosed) {
            Serial.println("Connnection Closed");
        } else if(event == WebsocketsEvent::GotPing) {
            Serial.println("Got a Ping!");
        } else if(event == WebsocketsEvent::GotPong) {
            Serial.println("Got a Pong!");
        }
    }
    
    
    void setup() {
        Serial.begin(115200);
        //Autoconnect stuff
        config.portalTimeout = 30000;  // It will time out in 30 seconds
        portal.config(config);
        acEnable = portal.begin();
    
    
      if (acEnable) {
    
        Serial.println("Setting Up JSON");
        // Get some Chip ID per hw action
        #ifdef ESP8266
          char hwbuf[8];
          ltoa(ESP.getChipId(),hwbuf,8);
          client.setFingerprint(ssl_fingerprint);
        
        #endif
    
        #ifdef ESP32
        char hwbuf[8];
        uint32_t efuse;
        efuse = (uint32_t)ESP.getEfuseMac();
        ltoa(efuse,hwbuf,8);
        
        //hwbufs = String((uint32_t)ESP.getEfuseMac(), HEX);
        client.setCACert(aws_ssl_ca_cert);
        //client.setInsecure();
    
        #endif
    
    
        Serial.println("Hardware number");
        Serial.println(hwbuf);
        doc["hwid"] = hwbuf; //String(ESP.getChipId()).c_str();
        doc["user_email"] = "[email protected]";
        JsonArray recp = doc.createNestedArray("recp");
        // in prod, this will need to be captured at the wifi portal level
        recp.add("friend1");
        // in produ this will need to be captured at the wifi portal level
        doc["sender"] = "pzzachip";
    
    
        // run callback when messages are received
        client.onMessage(onMessageCallback);
        
        // run callback when events are occuring
        client.onEvent(onEventsCallback);
    
        // Before connecting, set the ssl fingerprint of the server
        //client.setFingerprint(echo_org_ssl_fingerprint);
    
        // Connect to server
        Serial.println("attempting websocket connection");
        client.connect(websockets_connection_string);
      }
    
    }
    
    void loop() {
        if (WiFi.status() == WL_CONNECTED) {
    
          client.poll();
        }
    
        if(acEnable){
          portal.handleClient();
        }
    
    
    }
    

    Additional context Add any other context about the problem here.

  • How to get a reference of the web socket client that dispatched the msg callback

    How to get a reference of the web socket client that dispatched the msg callback

    Is your feature request related to a problem? Please describe. Hello guys,

    I was wondering if there is a way of identifying which instance of the websocket client is populating the message callback method, I would like to create these web socket client instances dynamically, so they might change over the time.

    Describe the solution you'd like The message or event callback methods should also include a reference to the instance client that fired those callbacks

    Describe alternatives you've considered Creating an array/vector pairing both the instance of the callback method and the client instance

  • esp32 to wss python server

    esp32 to wss python server

    Hello I am trying to connect a esp32 wrover client to a wss server I created in python https://github.com/jdevers1/ssl and copied and pasted the example for secure esp32 client and filled the certificate with the according certificate generated by the wss (the cert.pem file) and can't seem to connect to the server. Is this possible ?

  • ESP32-Server Not Working Properly receives one msg and gets disconnected

    ESP32-Server Not Working Properly receives one msg and gets disconnected

    /**************************************************************************************************************************** image

    ESP32-Server.ino For ESP32.

    /* Minimal Esp32 Websockets Server

    This sketch: 1. Connects to a WiFi network 2. Starts a websocket server on port 80 3. Waits for connections 4. Once a client connects, it wait for a message from the client 5. Sends an "echo" message to the client 6. closes the connection and goes back to step 3

    Hardware: For this sketch you only need an ESP32 board.

    Created 15/02/2019 By Gil Maimon https://github.com/gilmaimon/ArduinoWebsockets */

    #include <ArduinoWebsockets.h> #include <WiFi.h>

    const char* ssid = "only"; //Enter SSID const char* password = "ashu1234"; //Enter Password

    using namespace websockets;

    WebsocketsServer server; void setup() { Serial.begin(115200); // Connect to wifi WiFi.begin(ssid, password);

    // Wait some time to connect to wifi for(int i = 0; i < 15 && WiFi.status() != WL_CONNECTED; i++) { Serial.print("."); delay(1000); }

    Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); //You can get IP address assigned to ESP

    server.listen(80); Serial.print("Is server live? "); Serial.println(server.available()); }

    void loop() { WebsocketsClient client = server.accept(); if(client.available()) { WebsocketsMessage msg = client.readBlocking();

    // log
    Serial.print("Got Message: ");
    Serial.println(msg.data());
    
    // return echo
    

    // client.send("Echo: " + msg.data());

    // close the connection
    

    // client.close(); }

    delay(1000); } 161898290-8091c2db-0d2f-423b-bfe1-b2fda9996ee7

    any help will be great for us. thank you in advance

  • Websocket Client Became Slower and Unstable After Upgrading ESP32 from 1.0.4 to 1.0.6

    Websocket Client Became Slower and Unstable After Upgrading ESP32 from 1.0.4 to 1.0.6

    Describe the bug Websocket client receiving binary data is slow (slower than before) and randomly goes into a cycle of closing and opening the socket, thus rendering communication impossible, and is unable to recover.

    To Reproduce Steps to reproduce the behavior. This should include:

    • The library version you are using: 0.5.3
    • The board you are using: ESP32 (ESP-WROOM-32)
    • Information about other components in the system (do you use third party client/server software?): I use a Python Tornado websocket server.
    1. Start Tornado server (which just sends images from the webcam in real time).
    2. Initialize wifi and connect to websocket server from ESP32.
    3. Receive data stream and render on LED matrix (although that is turned off currently to isolate websocket).

    Expected behavior I am not sending huge amounts of data, so I expect the websocket to be fast and stable.

    Code Here is the relevant ESP32 code. Most of it is just to create a milliseconds timestamp (using the ezTime library) to compare to the one I send from the Tornado server. The websocket loop task is running with priority 2, whereas every other task is priority 1.

    uint64_t recreate_timestamp_from_bytes(const char * t) {
      uint64_t value = 
        static_cast<uint64_t>(t[0]) |
        static_cast<uint64_t>(t[1]) << 8 |
        static_cast<uint64_t>(t[2]) << 16 |
        static_cast<uint64_t>(t[3]) << 24 |
        static_cast<uint64_t>(t[4]) << 32 |
        static_cast<uint64_t>(t[5]) << 40 |
        static_cast<uint64_t>(t[6]) << 48 |
        static_cast<uint64_t>(t[7]) << 56;
    
      return value;
    }
    
    void onMessageCallback(WebsocketsMessage message) {
       static uint32_t counter = 0;
       Serial.print("Got Message (");
       Serial.print(counter++, DEC);
       Serial.print("): ");
       const char* payload = message.c_str();
       uint64_t timestamp_ws = recreate_timestamp_from_bytes(payload + 12288);
       uint64_t my_ms = ms(TIME_NOW);
       uint64_t my_now = now();
       uint64_t timestamp = my_now*1000 + my_ms;
       Serial.println((int64_t)timestamp-(int64_t)timestamp_ws, DEC);
    
    void websocket_loop_task(void * parameters) {
      while (1) {
        if (socket_open) {
          websocket_client.poll();
        }
        vTaskDelay(2);
      }
    }
    

    Additional context I am building a real time video stream from my computer's webcam to an LED matrix. I am sending images (12288 bytes) from the Tornado websocket server to the ESP32 client, which then renders the image on my LED matrix. I first ran this in the Arduino IDE and it ran flawlessly (i.e. I was receiving images at ~33 frames/sec with no latency and completely stable). Then, I ported the code to VS Code (Platformio) and it became slow (i.e. larger and larger delay as time goes on) and unstable. The only difference in environments was that my Arduino IDE was running an old version of the esp32 board (1.0.4). When I updated that version (without changing any code), I started encountering the same issues (slow and unstable). Worse yet, reverting back to 1.0.4 did not fix the issue.

    At this point, to test, I am just sending images with an appended timestamp from the Tornado server at ~33 fps. I am not rendering anything on the LED matrix, just to isolate the websockets. When I throttle the sending rate to around 20 fps, there is not a delay on the websockets, but they still crash randomly and are unable to recover without resetting the ESP32.

Arduino, esp32 and esp8266 library for ABB (ex PowerOne) Aurora Inverter, implement a full methods to retrieve data from the Inverter via RS-485
Arduino, esp32 and esp8266 library for ABB (ex PowerOne) Aurora Inverter, implement a full methods to retrieve data from the Inverter via RS-485

ABB Aurora protocol You can refer the complete documentation on my site ABB Aurora PV inverter library for Arduino, esp8266 and esp32 I create this li

Nov 22, 2022
Library for ESP32 and ESP8266 to work with the Fernando K app

App Fernando K This library is meant to work with the Fernando K app https://play.google.com/store/apps/details?id=com.appfernandok https://apps.apple

Aug 5, 2020
Simple web interface builder for esp8266 and ESP32
Simple web interface builder for esp8266 and ESP32

GyverPortal Простой конструктор веб интерфейса для esp8266 и ESP32 Простой конструктор - делаем страницы без знаний HTML и CSS Библиотека является обё

Jan 8, 2023
Arduino library for sending email and SMS from nothing but the ESP8266!
Arduino library for sending email and SMS from nothing but the ESP8266!

Did you know your ESP8266 could send Email and SMS without any special hardware or paid services like Twilio? With AlertMe, your ESP8266 project can:

Feb 24, 2022
This Arduino IDE for ArduCAM ESP8266 UNO Board with Integrated ArduCAM Library and Examples
This Arduino IDE for ArduCAM ESP8266 UNO Board with Integrated ArduCAM Library and Examples

ArduCAM_ESP8266_UNO Please use josn board manager script from http://www.arducam.com/downloads/ESP8266_UNO/package_ArduCAM_index.json to download ESP8

Jan 7, 2023
Anto client library for ESP8266-Arduino

Anto client library for ESP8266-Arduino ESP8266-AntoIO provides common and easy way to connect your ESP8266 to Anto.io IoT platform service. Stable ve

Dec 1, 2021
Arduino Arduino library for the CloudStorage server project. The library provides easy access to server-stored values and operations.

Arduino-CloudStorage Arduino/ESP8266 library that allows you to easly store and retreive data from a remote (cloud) storage in a key/value fashion. Cl

Jan 30, 2022
Open Sound Control(OSC) Library for Arduino - modern IDE's (1.6.2 and above)

for Arduino firmware 1.0rc-1 tested Arduino Ethernet http://www.arduino.cc/en/Main/ArduinoBoardEthernet Installation ArdOSC folder into .. Mac ~/Do

Feb 14, 2021
Arduino polyphonic synthesizer project (not a Moog) for ESP32 - STM32 - Teensy and more
Arduino polyphonic synthesizer project (not a Moog) for ESP32 - STM32 - Teensy and more

ml_synth_basic_example Arduino polyphonic synthesizer project (not a Moog) for ESP32 - STM32 - Teensy and more link to the video My intention was to m

Dec 7, 2022
A library to simplify the process of getting and storing data to Antares IoT Platform through HTTP on ESP8266.
A library to simplify the process of getting and storing data to Antares IoT Platform through HTTP on ESP8266.

Antares ESP8266 HTTP This is the documentation for Antares ESP8266 library. This library is meant to simplify the process of retrieving and deploying

Jul 2, 2021
A library to simplify the process of subscribing and publishing data to Antares IoT Platform through MQTT on ESP8266.
A library to simplify the process of subscribing and publishing data to Antares IoT Platform through MQTT on ESP8266.

Antares ESP8266 MQTT A Library to simplify the process of MQTT publication and subscription to Antares IoT Platform using ESP8266. This library works

Mar 9, 2022
Library for auto Light Emitting Diode (LED) control based on the timer function of the ESP8266

Library for auto Light Emitting Diode (LED) control based on the timer function of the ESP8266. The purpose is to have LED running for their own without the need to to such things like blinking on your own.

Jan 18, 2022
Arduino library for making an IHC in or output module using an Arduino

Introduction This is an Arduino library for making an IHC in or output module using an Arduino. (IHC controller is a home automation controller made b

Mar 26, 2020
ArduinoIoTCloud library is the central element of the firmware enabling certain Arduino boards to connect to the Arduino IoT Cloud

ArduinoIoTCloud What? The ArduinoIoTCloud library is the central element of the firmware enabling certain Arduino boards to connect to the Arduino IoT

Dec 16, 2022
ESP8266 examples and toolchain setup

README These apps accomplish the following: -- ESP8266-EVB-blinkLED : Blink by green LED on ESP8266-EVB -- arduino_style : -- esphttpd : Advanced web-

Oct 22, 2022
Connecting an ESP8266 to a Google Calendar service to turn an useless "On Air" sign into a smart meeting indicator
Connecting an ESP8266 to a Google Calendar service to turn an useless

ESP8266-GoogleCalendar Intro I had an useless "On Air" sign hanging around my home, and I thought it would be cool to connect it to my Google Calendar

Jan 20, 2022
ESP8266 MQTT Sharp-fu-y30 air purifier controller
ESP8266 MQTT Sharp-fu-y30 air purifier controller

ESP8266 MQTT Sharp-fu-y30 air purifier controller Disclaimer Note: if you decide to do those changes to your air purifier, you take all the responsibi

Dec 6, 2022
ESP32-S2 and CC1101S 433Mhz usb stick to record and send car gates/garages data keys and open stuff
ESP32-S2 and CC1101S 433Mhz usb stick to record and send car gates/garages data keys and open stuff

HackZeGarage ESP32-S2 and CC1101S 433Mhz usb stick to record and send car gates/garages data keys and open stuff **HackZeGarage @sulfuroid / Dr CADIC

Mar 16, 2022
An ESP32 CAN 2.0B library

CAN Library for ESP32 ACAN_ESP32 library description ACAN_ESP32 is a driver for the CAN module built into the ESP32 microcontroller. The driver suppor

Dec 9, 2022