2024-09-27 Wlan geändert

This commit is contained in:
hans-jurgen 2024-09-27 13:17:27 +02:00
parent 226a697fea
commit 5124141762

View File

@ -59,9 +59,9 @@ char topicWert[20];
char msg[20];
#ifdef TEST
const char* ssid = "St.-Peters-Gasse";
const char* password = "1952994784599317";
IPAddress ip( 192, 168, 127, 213 );
const char* ssid = "MagentaWLAN-RGDO";
const char* password = "93329248424922704583";
IPAddress ip( 192, 168, 127, 242 );
IPAddress gateway( 192, 168, 127, 1 );
IPAddress subnet( 255, 255, 255, 0 );
IPAddress dns(192, 168, 127, 1); // DNS-Server
@ -89,7 +89,7 @@ void reconnect() {
Serial.println("connected");
// blink.detach();
digitalWrite(LED_BUILTIN, HIGH);
sprintf(topic, "%s%d%s", "hjk/devices/", deviceId, "/telemetry/ID" );
sprintf(topic, "%s%ld%s", "hjk/devices/", deviceId, "/telemetry/ID" );
client.publish(topic, sID);
} else {
ErrLoop ++;
@ -198,7 +198,7 @@ void setup() {
#endif
digitalWrite(BUILTIN_LED, HIGH);
deviceId = ESP.getChipId();
sprintf(sID, "%010d", deviceId);
sprintf(sID, "%010ld", deviceId);
Serial.print("ID: \t\t"); Serial.println(deviceId);
client.setServer(mqtt_server, 1883);
}
@ -264,7 +264,7 @@ void loop(){
}
pixels.show();
itoa(CO2Wert, msg, 10);
sprintf(topic, "%s%d%s", "hjk/devices/", deviceId, "/telemetry/co2" );
sprintf(topic, "%s%ld%s", "hjk/devices/", deviceId, "/telemetry/co2" );
client.publish(topic, msg, true);
delay(500);
endTime = millis();