summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-01-14 17:09:57 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-01-14 17:09:57 +0100
commit15b98db542ae51d8cfe5847d689527c6ca4b3cdb (patch)
tree7900e38de8d119bcf74aed5b1410920651ddc407
parent613853d147bcb187b7d1b8de534b3ba9bfd6c7d2 (diff)
Minor documentation improvementsmain
-rw-r--r--README.md14
-rw-r--r--init.lua3
2 files changed, 9 insertions, 8 deletions
diff --git a/README.md b/README.md
index 9984a08..14b4628 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# ESP8266 Lua/NodeMCU module for SDS011 PM sensors
+# ESP8266 Lua/NodeMCU module for Nova SDS011 PM sensors
This repository contains an ESP8266 NodeMCU Lua module (`sds011.lua`) as well
MQTT / HomeAssistant / InfluxDB integration example (`init.lua`) for **SDS011**
-particulate matter (PM2.5 and PM10) sensors.
+particulate matter (PM2.5 and PM10) sensors connected via UART.
## Dependencies
@@ -19,7 +19,6 @@ following modules.
* node
* softuart
* tmr
-* uart
* wifi
## Setup
@@ -106,8 +105,7 @@ If desired, **sds011.lua** can be used to configure the SDS011 sensor.
To use it, you need to create a **config.lua** file with WiFI and MQTT settings:
```lua
-station_cfg.ssid = "..."
-station_cfg.pwd = "..."
+station_cfg = {ssid = "...", pwd = "..."}
mqtt_host = "..."
```
@@ -119,5 +117,9 @@ influx_url = "..."
influx_attr = "..."
```
-Readings will be published as `sds011[influx_attr] pm2_5_ugm3=...,pm10_ugm3=...`
+Readings will be published as `sds011[influx_attr] pm2_5_ugm3=%d.%01d,pm10_ugm3=%d.%01d`.
So, unless `influx_attr = ''`, it must start with a comma, e.g. `influx_attr = ',device=' .. device_id`.
+
+## Images
+
+![](https://finalrewind.org/projects/esp8266-nodemcu-sds011/media/preview.png)
diff --git a/init.lua b/init.lua
index 68c8e3c..4708feb 100644
--- a/init.lua
+++ b/init.lua
@@ -1,4 +1,3 @@
-station_cfg = {}
publishing_mqtt = false
publishing_http = false
@@ -10,7 +9,7 @@ mqttclient = mqtt.Client(device_id, 120)
dofile("config.lua")
-print("ESP8266 " .. chip_id)
+print("SDS011 " .. chip_id)
ledpin = 4
gpio.mode(ledpin, gpio.OUTPUT)