Höhere Präzision, Devicename geändert

This commit is contained in:
starcalc 2019-03-17 18:12:25 +01:00
parent ed9c2d766c
commit e880885b7e
1 changed files with 4 additions and 3 deletions

View File

@ -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);
}