Skip to content

Arvand IOT - Temperature and humidity sensor

License

Notifications You must be signed in to change notification settings

Arvand-IOT/TH-Sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeMCU Sensor

It's Arduino code for NodeMCU ESP8266 client. We have two branches:

  1. main : MQTT
  2. prom : Prometheus metrics

How-to

  1. Create your env file from env.cpp.example :

    #include <Arduino.h>
    #include "env.h"
    
    String wifi_ssid = "your wifi ssid";
    String wifi_password = "your wifi password";
    const char* mqtt_server = "your mqtt server address ( without port number )";
  2. Set your sensor's id in NodeMCU-Sensor.ino :

    String sensor_id = "4";
  3. Upload project to your device

Result

The temperature and humidity values will read every 30 seconds ( You can change the interval ) and publish to MQTT server if there are significant changes in them.

result

result2