Clone the repo
git clone https://github.com/traceyflanders/Arduino-ESP8266.git
Adjust the config.h
include header file with your preferred SERIAL_BAUD_RATE, DEBUG flag and Thingsboard or MQTT server, specifying the DNS name or IP address.
/*
* Common configs header file
*/
#define DEBUG false // Enables Serial.print() statements for debugging purposes
#define SERIAL_BAUD_RATE 115200 // Serial.begin(SERIAL_BAUD_RATE);
/*
* Copyleft credit
*/
#define SKETCH_VERSION "200108A" // YYMMDD[A-Z]
#define SKETCH_AUTHOR "Tracey Flanders" // Credit
/*
* Thingsboard Server
*/
// #define TB_SERVER "demo.thingsboard.io"
#define TB_SERVER "10.0.1.254"
#define TB_SERVER_PORT 1883
Rename the default_credentials.h
include header file to credentials.h
Make changes to the WIFI, Thingsboard API Token and MQTT credentials (optional).
/*
* Credentials header file
*/
/////////////////////////////////////////////////////////////////////////////////
/////////////////////// RENAME THIS FILE TO credentials.h ///////////////////////
/////////////////////////////////////////////////////////////////////////////////
/*
* WIFI Credentials
* Change to your wifi name and password
*/
#ifndef MY_WIFI_SSID
#define MY_WIFI_SSID "cool_wifi_name"
#endif
#ifndef MY_WIFI_PASSWORD
#define MY_WIFI_PASSWORD "super_duper_password"
#endif
/*
* Thingsboard API Token
* Change to your api token
*/
#ifndef MY_TB_TOKEN
#define MY_TB_TOKEN "123456789"
#endif
/* MQTT credentials (Optional)
* Change to your mqtt username & password
*/
#ifndef MY_MQTT_USERNAME
#define MY_MQTT_USERNAME "your_username_here"
#endif
#ifndef MY_MQTT_PASSWORD
#define MY_MQTT_PASSWORD "your_password_here"
#endif
Upload the sketch to your ESP8266. Check your Thingsboard dashboard to ensure you can see telemetry updating and/or you can control your device through a widget.