diff --git a/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin b/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin index 26d265d..eee6f0e 100644 Binary files a/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin and b/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin differ diff --git a/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino b/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino index 5f4dee4..7e4cfd9 100644 --- a/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino +++ b/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino @@ -63,7 +63,7 @@ char nextionBaud[7] = "115200"; //////////////////////////////////////////////////////////////////////////////////////////////////// -const float haspVersion = 1.04; // Current HASP software release version +const float haspVersion = 1.04; // Current HASPone software release version const uint16_t mqttMaxPacketSize = 2048; // Size of buffer for incoming MQTT message byte nextionReturnBuffer[128]; // Byte array to pass around data coming from the panel uint8_t nextionReturnIndex = 0; // Index for nextionReturnBuffer @@ -174,7 +174,7 @@ String lcdFirmwareUrl = "https://raw.githubusercontent.com/HASwitchPlate/HASPone void setup() { // System setup debugPrint(String(F("\n\n================================================================================\n"))); - debugPrintln(String(F("SYSTEM: Starting HASwitchPlate v")) + String(haspVersion)); + debugPrintln(String(F("SYSTEM: Starting HASPone v")) + String(haspVersion)); debugPrintln(String(F("SYSTEM: Last reset reason: ")) + String(ESP.getResetInfo())); debugPrintln(String(F("SYSTEM: heapFree: ")) + String(ESP.getFreeHeap()) + String(F(" heapMaxFreeBlockSize: ")) + String(ESP.getMaxFreeBlockSize())); debugPrintCrash(); @@ -1118,7 +1118,7 @@ void nextionProcessInput() } if (rebootOnp0b1 && (nextionPage == "0") && (nextionButtonID == "1")) { - debugPrintln(String(F("HMI IN: p[0].b[1] pressed during HASP configuration, rebooting."))); + debugPrintln(String(F("HMI IN: p[0].b[1] pressed during HASPone configuration, rebooting."))); espReset(); } } @@ -1715,7 +1715,7 @@ bool nextionConnect() } } - // Query backlight status. This should always succeed under simulation or non-HASP HMI + // Query backlight status. This should always succeed under simulation or non-HASPone HMI lcdBacklightQueryFlag = true; debugPrintln(F("HMI: Querying LCD backlight status")); Serial1.write(nextionSuffix, sizeof(nextionSuffix)); @@ -1737,7 +1737,7 @@ bool nextionConnect() // This check depends on the HMI having been designed with a version number in the object // defined in lcdVersionQuery. It's OK if this fails, it just means the HMI project is - // not utilizing the version capability that the HASP project makes use of. + // not utilizing the version capability that the HASPone project makes use of. lcdVersionQueryFlag = true; debugPrintln(F("HMI: Querying LCD firmware version number")); nextionSendCmd("get " + lcdVersionQuery); @@ -1747,7 +1747,7 @@ bool nextionConnect() } if (lcdVersionQueryFlag) { // Our flag is still set, meaning we never got a response. This should only happen if - // there's a problem. Non-HASP projects should pass this check with lcdVersion = 0 + // there's a problem. Non-HASPone projects should pass this check with lcdVersion = 0 debugPrintln(F("HMI: LCD version query timed out")); lcdVersionQueryFlag = false; return false; @@ -1882,7 +1882,7 @@ void espWifiConnect() { // We gave it a shot, still couldn't connect, so let WiFiManager run to make one last // connection attempt and then flip to AP mode to collect credentials from the user. - WiFiManagerParameter custom_haspNodeHeader("
HASP Node"); + WiFiManagerParameter custom_haspNodeHeader("
HASPone Node"); WiFiManagerParameter custom_haspNode("haspNode", "
Node Name (required: lowercase letters, numbers, and _ only)", haspNode, 15, " maxlength=15 required pattern='[a-z0-9_]*'"); WiFiManagerParameter custom_groupName("groupName", "Group Name (required)", groupName, 15, " maxlength=15 required"); WiFiManagerParameter custom_mqttHeader("

MQTT"); @@ -2024,7 +2024,7 @@ void espWifiConfigCallback(WiFiManager *myWiFiManager) nextionSendCmd("page 0"); } nextionSetAttr("p[0].b[1].font", "6"); - nextionSetAttr("p[0].b[1].txt", "\" HASP WiFi Setup\\r AP: " + String(wifiConfigAP) + "\\rPassword: " + String(wifiConfigPass) + "\\r\\r\\r\\r\\r\\r\\r http://192.168.4.1\""); + nextionSetAttr("p[0].b[1].txt", "\" HASPone Setup\\r AP: " + String(wifiConfigAP) + "\\rPassword: " + String(wifiConfigPass) + "\\r\\r\\r\\r\\r\\r\\r http://192.168.4.1\""); nextionSendCmd("vis 3,1"); } @@ -2039,14 +2039,14 @@ void espSetupOta() ArduinoOTA.onStart([]() { debugPrintln(F("ESP OTA: update start")); - nextionSetAttr("p[0].b[1].txt", "\"\\rHASP update:\\r\\r\\r \""); + nextionSetAttr("p[0].b[1].txt", "\"\\rHASPone update:\\r\\r\\r \""); nextionSendCmd("page 0"); nextionSendCmd("vis 4,1"); }); ArduinoOTA.onEnd([]() { debugPrintln(F("ESP OTA: update complete")); - nextionSetAttr("p[0].b[1].txt", "\"\\rHASP update:\\r\\r Complete!\\rRestarting.\""); + nextionSetAttr("p[0].b[1].txt", "\"\\rHASPone update:\\r\\r Complete!\\rRestarting.\""); nextionSendCmd("vis 4,1"); delay(1000); espReset(); @@ -2067,7 +2067,7 @@ void espSetupOta() else if (error == OTA_END_ERROR) debugPrintln(F("ESP OTA: ERROR - End Failed")); nextionSendCmd("vis 4,0"); - nextionSetAttr("p[0].b[1].txt", "\"HASP update:\\r FAILED\\rerror: " + String(error) + "\""); + nextionSetAttr("p[0].b[1].txt", "\"HASPone update:\\r FAILED\\rerror: " + String(error) + "\""); delay(1000); nextionSendCmd("page " + String(nextionActivePage)); }); @@ -2079,7 +2079,7 @@ void espSetupOta() void espStartOta(const String &espOtaUrl) { // Update ESP firmware from HTTP/HTTPS URL - nextionSetAttr("p[0].b[1].txt", "\"\\rHASP update:\\r\\r\\r \""); + nextionSetAttr("p[0].b[1].txt", "\"\\rHASPone update:\\r\\r\\r \""); nextionSendCmd("page 0"); nextionSendCmd("vis 4,1"); @@ -2107,18 +2107,18 @@ void espStartOta(const String &espOtaUrl) case HTTP_UPDATE_FAILED: debugPrintln(String(F("ESPFW: HTTP_UPDATE_FAILED error ")) + String(ESPhttpUpdate.getLastError()) + " " + ESPhttpUpdate.getLastErrorString()); nextionSendCmd("vis 4,0"); - nextionSetAttr("p[0].b[1].txt", "\"HASP update:\\r FAILED\\rerror: " + ESPhttpUpdate.getLastErrorString() + "\""); + nextionSetAttr("p[0].b[1].txt", "\"HASPone update:\\r FAILED\\rerror: " + ESPhttpUpdate.getLastErrorString() + "\""); break; case HTTP_UPDATE_NO_UPDATES: debugPrintln(F("ESPFW: HTTP_UPDATE_NO_UPDATES")); nextionSendCmd("vis 4,0"); - nextionSetAttr("p[0].b[1].txt", "\"HASP update:\\rNo update\""); + nextionSetAttr("p[0].b[1].txt", "\"HASPone update:\\rNo update\""); break; case HTTP_UPDATE_OK: debugPrintln(F("ESPFW: HTTP_UPDATE_OK")); - nextionSetAttr("p[0].b[1].txt", "\"\\rHASP update:\\r\\r Complete!\\rRestarting.\""); + nextionSetAttr("p[0].b[1].txt", "\"\\rHASPone update:\\r\\r Complete!\\rRestarting.\""); nextionSendCmd("vis 4,1"); delay(1000); espReset(); @@ -2130,7 +2130,7 @@ void espStartOta(const String &espOtaUrl) //////////////////////////////////////////////////////////////////////////////////////////////////// void espReset() { - debugPrintln(F("RESET: HASP reset")); + debugPrintln(F("RESET: HASPone reset")); if (mqttClient.connected()) { mqttClient.publish(mqttStateJSONTopic, String(F("{\"event_type\":\"hasp_device\",\"event\":\"offline\"}"))); @@ -2463,7 +2463,7 @@ void webHandleRoot() webServer.sendContent(F("WiFi SSID (required)
WiFi Password (required)")); - webServer.sendContent(F("

HASP Node Name (required. lowercase letters, numbers, and _ only)
Group Name (required)")); - webServer.sendContent(F("

HASP Admin Username (optional)
HASP Admin Password (optional)
HASPone Admin Password (optional)

")); // Big menu of possible serial speeds if ((lcdVersion != 1) && (lcdVersion != 2)) - { // HASP lcdVersion 1 and 2 have `bauds=115200` in the pre-init script of page 0. Don't show this option if either of those two versions are running. + { // HASPone lcdVersion 1 and 2 have `bauds=115200` in the pre-init script of page 0. Don't show this option if either of those two versions are running. webServer.sendContent(F("LCD Serial Speed: ")); } @@ -2646,14 +2646,14 @@ void webHandleRoot() { webServer.sendContent(mqttClientId); } - webServer.sendContent(F("
HASP Version: ")); + webServer.sendContent(F("
HASPone FW Version: ")); webServer.sendContent(String(haspVersion)); webServer.sendContent(F("
LCD Model: ")); if (nextionModel != "") { webServer.sendContent(nextionModel); } - webServer.sendContent(F("
LCD Version: ")); + webServer.sendContent(F("
LCD FW Version: ")); webServer.sendContent(String(lcdVersion)); webServer.sendContent(F("
LCD Active Page: ")); webServer.sendContent(String(nextionActivePage)); @@ -2983,7 +2983,7 @@ void webHandleFirmware() webServer.sendContent(F("
")); if (updateEspAvailable) { - webServer.sendContent(F("HASP ESP8266 update available!")); + webServer.sendContent(F("HASPone ESP8266 update available!")); } webServer.sendContent(F("
Update ESP8266 from URL")); webServer.sendContent(F("
")); if (updateLcdAvailable) { - webServer.sendContent(F("HASP LCD update available!")); + webServer.sendContent(F("HASPone LCD update available!")); } webServer.sendContent(F("
Update Nextion LCD from URL http only")); webServer.sendContent(F("