Skip to content
Snippets Groups Projects
Commit 9343adbf authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Set page 1 as default

parent a2e3f3cb
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ byte packetBuffer[48]; // buffer to hold incoming and o
//
// initialize variables
//
int page = 0;
int page = 1;
String command;
String doubleQuote = "\"\"";
......@@ -64,7 +64,7 @@ void setup() {
printNextionCommand("dims=" + String(0)); // set initial startup backlight value of the Nextion display to 0
printNextionCommand("dim=" + String(0)); // also set the current backlight value to 0
printNextionCommand("page 0");
printNextionCommand("page 1");
delay(startupDelay);
......@@ -97,13 +97,13 @@ void loop() {
else if (page == 1) {
if (weatherForecastLoop == 0) {
page = 0;
//page = 0;
#if !defined (DEBUG_NO_PAGE_FADE)
displayFadeOut(displayDimValue, dimPageDelay);
#endif
printNextionCommand("page 0");
//printNextionCommand("page 0");
#if !defined (DEBUG_NO_PAGE_FADE)
displayFadeIn(0, displayDimValue, dimPageDelay);
......@@ -251,11 +251,8 @@ void reconnectMqtt() {
while (!mqttClient.connected()) {
if (mqttClient.connect(frontendId.c_str(), mqttUser, mqttPass)) {
Serial.println("MQTT Connected");
//mqttClient.subscribe(mqttTopic);
mqttClient.subscribe("/wetterstation/frontend/7363421/weather");
Serial.print("MQTT Subscribe to: ");
Serial.println(mqttTopic);
mqttClient.publish(mqttTopicBackend, settings.c_str());
mqttClient.subscribe(("/wetterstation/frontend/" + frontendId + "/weather").c_str());
mqttClient.publish("/wetterstation/backend/settings", settings.c_str());
}
else {
#ifdef DEBUG
......@@ -270,7 +267,6 @@ void reconnectMqtt() {
void getWeatherDataMqtt(char* topic, byte* payload, unsigned int length) {
#ifdef DEBUG
Serial.println("getWeatherDataMqtt...");
Serial.println("From mqttTopic: " + String(mqttTopic));
Serial.println("From topic: " + String(topic));
#endif
// Parsing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment