Compare commits
2 Commits
b79b6c3671
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
224b4f9ab0
|
|||
|
505ff1ac98
|
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
CO2 sensor that collects and sends its data via MQTT to a server. The board of the sensor is the Wemos D1 mini ESP32 and the sensor is a SCD41.
|
CO2 sensor that collects and sends its data via MQTT to a server. The board of the sensor is the Wemos D1 mini ESP32 and the sensor is a SCD41.
|
||||||
|
|
||||||
|
|
||||||
|
#+ATTR_HTML: :width 40%
|
||||||
|
[[./board.jpg]]
|
||||||
|
|
||||||
** Pinout of the board
|
** Pinout of the board
|
||||||
|
|
||||||
#+ATTR_HTML: :width 40%
|
#+ATTR_HTML: :width 40%
|
||||||
@@ -9,7 +13,7 @@ CO2 sensor that collects and sends its data via MQTT to a server. The board of t
|
|||||||
|
|
||||||
** Dependencies
|
** Dependencies
|
||||||
- [[https://github.com/Sensirion/arduino-i2c-scd4x][Sensirion I²C SCD4X Arduino Library]]
|
- [[https://github.com/Sensirion/arduino-i2c-scd4x][Sensirion I²C SCD4X Arduino Library]]
|
||||||
- [[https://github.com/knolleary/pubsubclient][PubSubClient]]
|
- [[https://github.com/marvinroger/async-mqtt-client][Async MQTT client]]
|
||||||
- [[https://github.com/bblanchon/ArduinoJson][ArduinoJSON]]
|
- [[https://github.com/bblanchon/ArduinoJson][ArduinoJSON]]
|
||||||
** Configuration
|
** Configuration
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,7 @@ void wlan_connection_handler(WiFiEvent_t event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_mqtt_connection(bool session) {
|
void on_mqtt_connection(bool session) { Serial.println("MQTT connected"); };
|
||||||
Serial.println("MQTT connected");
|
|
||||||
mqtt_client.subscribe(config->topic, 2);
|
|
||||||
};
|
|
||||||
|
|
||||||
void on_mqtt_disconnection(AsyncMqttClientDisconnectReason reason) {
|
void on_mqtt_disconnection(AsyncMqttClientDisconnectReason reason) {
|
||||||
Serial.println("MQTT disconnected");
|
Serial.println("MQTT disconnected");
|
||||||
|
|||||||
Reference in New Issue
Block a user