2025-12-1210
This commit is contained in:
@@ -8,25 +8,89 @@
|
|||||||
; Please visit documentation for the other options and examples
|
; Please visit documentation for the other options and examples
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[env:nodemcuv2]
|
[env]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = nodemcuv2
|
board = d1
|
||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_speed = 115200
|
board_build.filesystem = littlefs
|
||||||
monitor_port = /dev/ttyUSB0
|
monitor_port = /dev/ttyUSB0
|
||||||
upload_port = /dev/ttyUSB0
|
monitor_speed = 115200
|
||||||
monitor_filters = time
|
monitor_filters = time
|
||||||
|
upload_port = /dev/ttyUSB0
|
||||||
|
upload_speed = 115200
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
knolleary/PubSubClient @ 2.8
|
knolleary/PubSubClient @ 2.8
|
||||||
adafruit/Adafruit MCP9808 Library @ 1.1.2
|
|
||||||
adafruit/Adafruit BME280 Library @ 2.1.2
|
|
||||||
adafruit/Adafruit HTU21DF Library @ 1.0.5
|
adafruit/Adafruit HTU21DF Library @ 1.0.5
|
||||||
|
wollewald/ADS1115_WE @ 1.4.3
|
||||||
|
adafruit/Adafruit MCP9808 Library @ 2.0.0
|
||||||
|
adafruit/Adafruit BusIO @ 1.16.1
|
||||||
|
adafruit/Adafruit BME280 Library @ 2.2.4
|
||||||
|
adafruit/Adafruit Unified Sensor @ 1.1.14
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
-DHTU_Korrectur=-0.55
|
-DTEMPTEST33=1
|
||||||
-DBME_Korrectur=-0.00
|
-DNOBATT=0
|
||||||
-DKorrekturLuftdruck=0.00
|
-DMaxErrCount=40
|
||||||
-DHTUKorrekturFeuchte=0.00
|
|
||||||
-DBME_KorrekturFeuchte=0.00
|
|
||||||
-DAKKU_GREZWERT=2.950
|
|
||||||
|
[env:debug] ; Entwicklungssystem
|
||||||
|
build_flags = ${env.build_flags}
|
||||||
|
-DDEBUG=0
|
||||||
|
-DNOADS=0
|
||||||
|
-DNAME=\"WETTERSTATION2\"
|
||||||
|
-DSTASSID=\"MagentaWLAN-RGDO\"
|
||||||
|
-DSTAPSK=\"93329248424922704583\"
|
||||||
|
-DGATEWAY=\"192.168.127.1\"
|
||||||
|
-DDNS=\"192.168.127.1\"
|
||||||
|
-DKMYIP=\"192.168.127.45\"
|
||||||
|
-Dmqtt_server=\"hjkmqtt.dedyn.io\"
|
||||||
|
-Dmqtt_port=61883
|
||||||
|
-DTERROR=5
|
||||||
|
-DTLOWBATT=60
|
||||||
|
-DTINTERVAL=1
|
||||||
|
-DKorrekturLuftdruck=22.58
|
||||||
|
-DKorrekturTemperaturHTU21D=-2.3
|
||||||
|
-DMinimalSpannungAkku=2.90
|
||||||
|
|
||||||
|
[env:boris] ; Produktivsystem:
|
||||||
|
build_flags = ${env.build_flags}
|
||||||
|
-DDEBUG=0
|
||||||
|
-DEMAIL=\"koerner.c.m@gmail.com\"
|
||||||
|
-DNAME=\"WETTERSTATIONBORIS\"
|
||||||
|
-DSTASSID=\"FRITZ!Box7362SL\"
|
||||||
|
-DSTAPSK=\"BorisundEva2007\"
|
||||||
|
-DGATEWAY=\"192.168.2.1\"
|
||||||
|
-DDNS=\"192.168.2.1\"
|
||||||
|
-DKMYIP=\"192.168.2.41\"
|
||||||
|
-Dmqtt_server=\"hjkmqtt.dedyn.io\"
|
||||||
|
-Dmqtt_port=8883
|
||||||
|
-DTERROR=20
|
||||||
|
-DTLOWBATT=60
|
||||||
|
-DTINTERVAL=5
|
||||||
|
-DKorrekturLuftdruck=0.0
|
||||||
|
-DKorrekturTemperaturHTU21D=-0.0
|
||||||
|
-DMinimalSpannungAkku=2.90
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[env:test]
|
||||||
|
build_flags = ${env.build_flags}
|
||||||
|
-DDEBUG=0
|
||||||
|
-DNOADS=0
|
||||||
|
-DNAME=\"WETTERSTATION2\"
|
||||||
|
-DSTASSID=\"MagentaWLAN-RGDO\"
|
||||||
|
-DSTAPSK=\"93329248424922704583\"
|
||||||
|
-DGATEWAY=\"192.168.127.1\"
|
||||||
|
-DDNS=\"192.168.127.1\"
|
||||||
|
-DKMYIP=\"192.168.127.44\"
|
||||||
|
-Dmqtt_server=\"192.168.127.193\"
|
||||||
|
-Dmqtt_port=1883
|
||||||
|
-DTERROR=5
|
||||||
|
-DTLOWBATT=60
|
||||||
|
-DTINTERVAL=5
|
||||||
|
-DKorrekturLuftdruck=24.8
|
||||||
|
-DKorrekturTemperaturHTU21D=0.0
|
||||||
|
-DMinimalSpannungAkku=2.90
|
||||||
|
|
||||||
|
|||||||
14
src/main.cpp
14
src/main.cpp
@@ -4,7 +4,6 @@
|
|||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
|
|
||||||
#define TEST
|
#define TEST
|
||||||
#define MaxErrCount 30
|
|
||||||
|
|
||||||
#define I2C_SCL D1 // I2C BMP 180
|
#define I2C_SCL D1 // I2C BMP 180
|
||||||
#define I2C_SDA D2 // WeMOS D1 Mini D1 --> 4, D2 --> 5
|
#define I2C_SDA D2 // WeMOS D1 Mini D1 --> 4, D2 --> 5
|
||||||
@@ -41,7 +40,7 @@ const char* mqtt_user = "boris";
|
|||||||
const char* mqtt_password = "13.April13"; */
|
const char* mqtt_password = "13.April13"; */
|
||||||
|
|
||||||
|
|
||||||
const char* mqtt_server = "hjkmqtt.dedyn.io";
|
//const char* mqtt_server = "hjkmqtt.dedyn.io";
|
||||||
|
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
@@ -106,6 +105,7 @@ void setup() {
|
|||||||
//init_MCP9808();
|
//init_MCP9808();
|
||||||
//Init_BME280();
|
//Init_BME280();
|
||||||
init_HTU21();
|
init_HTU21();
|
||||||
|
read_HTU21D();
|
||||||
|
|
||||||
Serial.println(" "); Serial.println(" "); Serial.println(" ");
|
Serial.println(" "); Serial.println(" "); Serial.println(" ");
|
||||||
//read_BME_280();
|
//read_BME_280();
|
||||||
@@ -119,7 +119,7 @@ void setup() {
|
|||||||
deviceId = ESP.getChipId();
|
deviceId = ESP.getChipId();
|
||||||
sprintf(sID, "%010ld", deviceId);
|
sprintf(sID, "%010ld", deviceId);
|
||||||
Serial.print("ID: \t\t"); Serial.println(deviceId);
|
Serial.print("ID: \t\t"); Serial.println(deviceId);
|
||||||
client.setServer(mqtt_server, 61883);
|
client.setServer(mqtt_server, mqtt_port);
|
||||||
client.setCallback(callback);
|
client.setCallback(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,9 +231,13 @@ void loop() {
|
|||||||
int currentMillis = millis();
|
int currentMillis = millis();
|
||||||
if (currentMillis - previousMillis >= 10000) {
|
if (currentMillis - previousMillis >= 10000) {
|
||||||
previousMillis = currentMillis;
|
previousMillis = currentMillis;
|
||||||
|
#ifdef Akku_Messung
|
||||||
float valA00 = getBattery(korectur);
|
float valA00 = getBattery(korectur);
|
||||||
read_HTU21D();
|
#else
|
||||||
valA00 = htu21Data.Temp;
|
float valA00 = 3.35;
|
||||||
|
#endif
|
||||||
|
//read_HTU21D();
|
||||||
|
//valA00 = htu21Data.Temp;
|
||||||
dtostrf(valA00, 8, 2, msg);
|
dtostrf(valA00, 8, 2, msg);
|
||||||
sprintf(topic, "%s%ld%s", "hjk/devices/", deviceId, "/telemetry/battery" );
|
sprintf(topic, "%s%ld%s", "hjk/devices/", deviceId, "/telemetry/battery" );
|
||||||
client.publish(topic, msg, true);
|
client.publish(topic, msg, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user