Höhere Präzision, Devicename geändert
This commit is contained in:
parent
ed9c2d766c
commit
e880885b7e
|
@ -13,9 +13,9 @@
|
|||
#include <DallasTemperature.h>
|
||||
|
||||
const char* ssid = "CTDO-IoT";
|
||||
const char* password = "";
|
||||
const char* password = "12345678";
|
||||
|
||||
#define DEVICENAME "haus/bad"
|
||||
#define DEVICENAME "dummy/dummy"
|
||||
#define TOPIC DEVICENAME"/temperature"
|
||||
#define TOPICVOLTAGE DEVICENAME"/voltage"
|
||||
#define ONLINETOPIC DEVICENAME"/online"
|
||||
|
@ -74,7 +74,7 @@ void onMqttPublish(uint16_t packetId) {
|
|||
void onMqttConnect(bool sessionPresent) {
|
||||
char buf[7];
|
||||
packetId1Pub = mqttClient.publish(TOPIC, 1, true, ftoa(tempC, buf, 2));
|
||||
packetId2Pub = mqttClient.publish(TOPICVOLTAGE, 1, true, ftoa(voltage, buf, 2));
|
||||
packetId2Pub = mqttClient.publish(TOPICVOLTAGE, 1, true, ftoa(voltage, buf, 5));
|
||||
}
|
||||
|
||||
void setup() {
|
||||
|
@ -145,6 +145,7 @@ Serial.println("Connecting to WIFI");
|
|||
|
||||
void initiateDeepSleep()
|
||||
{
|
||||
Serial.println("initDeepSleep");
|
||||
ESP.deepSleep(sleepTimeS * 1000000);
|
||||
delay(100);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue