machbase / esp32-mqtt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Esp32-mqtt

Requirements

ESP-32 > Any ESP-32 board with Wifi

PubSubClient by Nick O’Leary from https://pubsubclient.knolleary.net/

DGT sensor library by Adafruit from https://github.com/adafruit/DHT-sensor-library

Wiring to the Host Board

wiring

Install Machbase neo

Please follow instructions from https://docs.machbase.com/neo/getting-started/

You should create table after install Machbase neo TSDB with following SQL

CREATE TAG TABLE tag (name VARCHAR(20) PRIMARY KEY, time DATETIME BASETIME, value DOUBLE SUMMARIZED) WITH ROLLUP (hour)

Things to be changed before build

  • Wifi (ssid, password)
// WiFi
const char *ssid = "MACHBASE_AP"; // Enter your Wi-Fi name
const char *password = "xxxxxxxx";  // Enter Wi-Fi password
WiFiClient wifi_connection;
  • Timzone related settings
//Time
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = 3600*9; // TZ Diff in seconds
const int daylightOffset_sec = 0;  
  • Machbase Internal MQTT Broker IP/Port
// MQTT
const char *mqtt_server = "192.168.1.131"; // Your Machbase neo server IP
const char *topic = "db/append/TAG"; // default
const int   mqtt_port = 5653; // default

About


Languages

Language:C++ 100.0%