From d910d0b94580f436e3506c0c6f4539e877be934e Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 4 Dec 2021 18:46:17 +0100 Subject: [PATCH 1/6] More documentation --- Readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index c0d492a..f3afe06 100644 --- a/Readme.md +++ b/Readme.md @@ -55,4 +55,6 @@ The following pins are used: * some wire # Sources -* [https://github.com/amkuipers/witty Witty pinout] \ No newline at end of file +For the Witty board +* [https://github.com/amkuipers/witty Witty pinout] +* [https://arduino.ua/products_pictures/large_AOC361-5.jpg Schematics] From afff1275daacda4b44429f852206866550839b6b Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 4 Dec 2021 23:09:07 +0100 Subject: [PATCH 2/6] Documentation --- Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index f3afe06..fd347ad 100644 --- a/Readme.md +++ b/Readme.md @@ -39,10 +39,10 @@ VCC | GND ``` The following pins are used: -* GPIO4 PM1006 particle sensor +* GPIO4 PM1006 particle sensor PIN REST on Vindriktning board * GPIO2 WS2812 stripe out of three LEDs, replacing the orignal LEDs at front * GPIO15 Red LED (optional) -* GPIO12 Green LED (optional) +* GPIO12 Green LED (optional) Used as 3.3V Supply for the I2C sensor * GPIO13 Blue LED (optional) * GPIO13 VCC of I2C (3.3 V) * GPIO14 I2C clock From 1e15d85d6f306abb2193ada2c7aa00d8bce05672 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 4 Dec 2021 23:09:54 +0100 Subject: [PATCH 3/6] Set LED to RED, if no configuration is available --- src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 34f0faf..3ac5b73 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,10 +33,10 @@ ******************************************************************************/ #define GPIO_WS2812 D4 /**< GPIO2 */ -#define SENSOR_PM1006_RX D2 /**< GPIO4 */ +#define SENSOR_PM1006_RX D2 /**< GPIO4 */ #define SENSOR_PM1006_TX -1 /**< Unused */ #define WITTY_RGB_R D8 /**< GPIO15 */ -#define WITTY_RGB_G D6 /**< GPIO12 */ +#define WITTY_RGB_G D6 /**< GPIO12 Used as 3.3V Power supply for the I2C Sensor */ #define WITTY_RGB_B D7 /**< GPIO13 */ #define PM1006_BIT_RATE 9600 #define PM1006_MQTT_UPDATE 5000 /**< Check the sensor every 10 seconds; New measurement is done every 20seconds by the sensor */ @@ -418,6 +418,8 @@ void setup() strip.show(); digitalWrite(WITTY_RGB_B, HIGH); } else { + digitalWrite(WITTY_RGB_R, HIGH); + digitalWrite(WITTY_RGB_G, LOW); strip.fill(strip.Color(128,0,0)); for (int i=0;i < (PIXEL_COUNT / 2); i++) { strip.setPixelColor(0, strip.Color(0,0,128)); From c39ebc8e544ecf72d61d8dcd7ecd5b1b0c1054d6 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 4 Dec 2021 23:24:30 +0100 Subject: [PATCH 4/6] Serial debugging enabled --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 3ac5b73..600955e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -242,7 +242,9 @@ void bmpPublishValues() { gasNode.setProperty(NODE_GAS).send(String((bmx.gas_resistance / 1000.0))); humidityNode.setProperty(NODE_HUMIDITY).send(String(bmx.humidity)); #endif - + log(MQTT_LEVEL_DEBUG, String("Temp" + String(bmx.readTemperature()) + "\tPressure:" + + String(bmx.readPressure() / 100.0F) + "\t Altitude:"+ + String(bmx.readAltitude(SEALEVELPRESSURE_HPA))), MQTT_LOG_I2READ); if ( (rgbTemp.get()) && (!mSomethingReceived) ) { if (bmx.readTemperature() < TEMPBORDER) { strip.setPixelColor(0, strip.Color(0,0,255)); @@ -466,4 +468,5 @@ void log(int level, String message, int statusCode) Homie.getMqttClient().publish(logTopic, 2, false, buffer.c_str()); delete logTopic; } + Homie.getLogger() << (level) << "@" << (statusCode) << " " << (message) << endl; } From b2db51d9a986d6615e2a8172e3dd2d7f03489d43 Mon Sep 17 00:00:00 2001 From: Ollo Date: Mon, 6 Dec 2021 20:18:23 +0100 Subject: [PATCH 5/6] Spelling improved --- Readme.md | 2 +- host/Readme.md | 2 +- host/spelling.sh | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 0a4693f..358ebbf 100644 --- a/Readme.md +++ b/Readme.md @@ -40,7 +40,7 @@ VCC | GND The following pins are used: * GPIO4 PM1006 particle sensor PIN REST on Vindriktning board -* GPIO2 WS2812 stripe out of three LEDs, replacing the orignal LEDs at front +* GPIO2 WS2812 stripe out of three LEDs, replacing the original LEDs at front * GPIO15 Red LED (optional) * GPIO12 Green LED (optional) Used as 3.3V Supply for the I2C sensor * GPIO13 Blue LED (optional) diff --git a/host/Readme.md b/host/Readme.md index 5303e87..e94a0ac 100644 --- a/host/Readme.md +++ b/host/Readme.md @@ -27,7 +27,7 @@ usage: ota_updater.py [-h] -l BROKER_HOST -p BROKER_PORT [-u BROKER_USERNAME] [-d BROKER_PASSWORD] [-t BASE_TOPIC] -i DEVICE_ID firmware -ota firmware update scirpt for ESP8226 implemenation of the Homie mqtt IoT +ota firmware update script for ESP8226 implementation of the Homie mqtt IoT convention. positional arguments: diff --git a/host/spelling.sh b/host/spelling.sh index ec98d73..fa2ecfd 100755 --- a/host/spelling.sh +++ b/host/spelling.sh @@ -7,5 +7,6 @@ if [ $? -ne 0 ]; then fi codespell -w ../src/* codespell -w ../include/* -codespell ../Readme.md +codespell -w ../*.md +codespell -w *.md exit 0 From 1c35094cfa3382bd61f4fe4d4846b6192b96838e Mon Sep 17 00:00:00 2001 From: Ollo Date: Mon, 6 Dec 2021 20:28:34 +0100 Subject: [PATCH 6/6] Wait until power is stable for BME680 --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 600955e..f4b8323 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -391,6 +391,10 @@ void setup() if (i2cEnable.get()) { strip.fill(strip.Color(0,128,0)); strip.show(); +#ifdef BME680 + printf("Wait 1 second...\r\n"); + delay(1000); +#endif /* Extracted from library's example */ mFailedI2Cinitialization = !bmx.begin(); if (!mFailedI2Cinitialization) {