ESP8266 code

Since the sketch has also some extra classes for the WebSocket connection, here the essential part of the .ino file will just be shown. For the entire project, please see the following GitHub address:

https://github.com/bcatalin/esp8266-book/tree/master/Chapter7.

Necessary included files are:

#include "Wire.h" 
#include <Adafruit_Sensor.h> 
#include <Adafruit_ADXL345_U.h> 
#include <FS.h>                    
#include <ESP8266WiFi.h>          
#include "SocketIOClient.h" 
#include <DNSServer.h> 
#include <ESP8266WebServer.h> 
#include <WiFiManager.h>           
#include <ArduinoJson.h>           
#include <Wire.h> 
#include <ESP8266HTTPClient.h> 
#include <ESP8266httpUpdate.h> 
#include <SPI.h> 

Instantiate an accel object and create a unique identification as a parameter for the class ...

Get ESP8266 Home Automation Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.