2024-09-2800
This commit is contained in:
parent
1ff02fcd43
commit
6f21fe7252
|
@ -12,9 +12,10 @@
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = d1
|
board = d1
|
||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_port = COM6
|
monitor_port = /dev/ttyUSB0
|
||||||
monitor_speed = 74800
|
monitor_speed = 74800
|
||||||
monitor_filters = time
|
monitor_filters = time
|
||||||
|
upload_port = /dev/ttyUSB0
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
lib_deps =
|
lib_deps =
|
||||||
knolleary/PubSubClient @ 2.8
|
knolleary/PubSubClient @ 2.8
|
||||||
|
@ -35,12 +36,12 @@ build_flags =
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
-DDEBUG=0
|
-DDEBUG=0
|
||||||
-DNOADS=1
|
-DNOADS=1
|
||||||
-DNAME=\"WETTERSTATIONEPPINGEN\"
|
-DNAME=\"WETTERSTATIONEPPINGEN2\"
|
||||||
-DSTASSID=\"St.-Peters-Gasse-Post\"
|
-DSTASSID=\"MagentaWLAN-RGDO\"
|
||||||
-DSTAPSK=\"1952994784599318\"
|
-DSTAPSK=\"93329248424922704583\"
|
||||||
-DGATEWAY=\"192.168.127.1\"
|
-DGATEWAY=\"192.168.127.1\"
|
||||||
-DDNS=\"192.168.127.1\"
|
-DDNS=\"192.168.127.1\"
|
||||||
-DKMYIP=\"192.168.127.48\"
|
-DKMYIP=\"192.168.127.45\"
|
||||||
-Dmqtt_server=\"hjkmqtt.dedyn.io\"
|
-Dmqtt_server=\"hjkmqtt.dedyn.io\"
|
||||||
-Dmqtt_port=61883
|
-Dmqtt_port=61883
|
||||||
-DTERROR=5
|
-DTERROR=5
|
||||||
|
|
14
src/main.cpp
14
src/main.cpp
|
@ -25,7 +25,7 @@ void pulse_pin(uint8_t pin);
|
||||||
WiFiClientSecure espClient;
|
WiFiClientSecure espClient;
|
||||||
PubSubClient client(espClient);
|
PubSubClient client(espClient);
|
||||||
|
|
||||||
#include<mess_htu21.h>
|
//#include<mess_htu21.h>
|
||||||
|
|
||||||
#include <mess_BMP280.h>
|
#include <mess_BMP280.h>
|
||||||
|
|
||||||
|
@ -109,14 +109,14 @@ void setup() {
|
||||||
//digitalWrite(BUILTIN_LED, HIGH);
|
//digitalWrite(BUILTIN_LED, HIGH);
|
||||||
//Serial.print("STATUS (Systemmeldung): "); Serial.println(SystemStatus);
|
//Serial.print("STATUS (Systemmeldung): "); Serial.println(SystemStatus);
|
||||||
#if (MQTT == 0)
|
#if (MQTT == 0)
|
||||||
init_HTU21();
|
//init_HTU21();
|
||||||
Init_BMP280();
|
//Init_BMP280();
|
||||||
initADS();
|
initADS();
|
||||||
init_MCP9808();
|
init_MCP9808();
|
||||||
#endif
|
#endif
|
||||||
//AKKU = getBattery(korectur); // ca. 170 ms
|
//AKKU = getBattery(korectur); // ca. 170 ms
|
||||||
// ca. 280 ms
|
// ca. 280 ms
|
||||||
read_HTU21D();
|
//read_HTU21D();
|
||||||
read_BMP_280();
|
read_BMP_280();
|
||||||
//MessungADS();
|
//MessungADS();
|
||||||
setup_wifi(); // ca. 4,5 s
|
setup_wifi(); // ca. 4,5 s
|
||||||
|
@ -131,7 +131,7 @@ void setup() {
|
||||||
Serial.print("ID: \t\t"); Serial.println(deviceId);
|
Serial.print("ID: \t\t"); Serial.println(deviceId);
|
||||||
|
|
||||||
// ca. 5 s
|
// ca. 5 s
|
||||||
espClient.setFingerprint(mqtt_fprint);
|
//espClient.setFingerprint(mqtt_fprint);
|
||||||
client.setServer(mqtt_server, mqtt_port);
|
client.setServer(mqtt_server, mqtt_port);
|
||||||
client.setCallback(callback);
|
client.setCallback(callback);
|
||||||
//----------
|
//----------
|
||||||
|
@ -147,7 +147,7 @@ void loop() {
|
||||||
int currentMillis = millis();
|
int currentMillis = millis();
|
||||||
if (currentMillis - previousMillis >= 10000) {
|
if (currentMillis - previousMillis >= 10000) {
|
||||||
previousMillis = currentMillis;
|
previousMillis = currentMillis;
|
||||||
read_HTU21D();
|
//read_HTU21D();
|
||||||
read_BMP_280();
|
read_BMP_280();
|
||||||
valTemp = getTemperature_MCP9808();
|
valTemp = getTemperature_MCP9808();
|
||||||
#if(NOADS== 1)
|
#if(NOADS== 1)
|
||||||
|
@ -158,7 +158,7 @@ void loop() {
|
||||||
client.publish(topic, ADSData.Solar, true);
|
client.publish(topic, ADSData.Solar, true);
|
||||||
#endif
|
#endif
|
||||||
#if(MQTT == 0)
|
#if(MQTT == 0)
|
||||||
M2M_HTU21D(hostname.c_str());
|
//M2M_HTU21D(hostname.c_str());
|
||||||
M2M_BMP280(hostname.c_str());
|
M2M_BMP280(hostname.c_str());
|
||||||
M2M_Temperatur_MCP9808(hostname.c_str());
|
M2M_Temperatur_MCP9808(hostname.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user