mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
Bugfixes
Right-aligned device values in device table Added periodic MQTT connection check Fixed issue with the AP WPA Key configuration
This commit is contained in:
@@ -352,6 +352,21 @@ void MQTTConnect()
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Check connection MQTT message broker
|
||||
\*********************************************************************************************/
|
||||
void MQTTCheck()
|
||||
{
|
||||
if ((Settings.Protocol == PROTOCOL_DOMOTICZ_MQTT) || (Settings.Protocol == PROTOCOL_OPENHAB_MQTT) || (Settings.Protocol == PROTOCOL_PIDOME_MQTT))
|
||||
if (!MQTTclient.connected())
|
||||
{
|
||||
MQTTclient.disconnect();
|
||||
delay(1000);
|
||||
MQTTConnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Parse incoming MQTT message
|
||||
\*********************************************************************************************/
|
||||
|
||||
+3
-2
@@ -79,7 +79,7 @@
|
||||
#define ESP_PROJECT_PID 2015050101L
|
||||
#define ESP_EASY
|
||||
#define VERSION 9
|
||||
#define BUILD 23
|
||||
#define BUILD 24
|
||||
#define REBOOT_ON_MAX_CONNECTION_FAILURES 30
|
||||
|
||||
#define PROTOCOL_DOMOTICZ_HTTP 1
|
||||
@@ -168,7 +168,7 @@ struct SettingsStruct
|
||||
byte Controller_IP[4];
|
||||
unsigned int ControllerPort;
|
||||
byte IP_Octet;
|
||||
char WifiAPKey[64];
|
||||
char _obsolete[64];
|
||||
unsigned long Delay;
|
||||
int8_t Pin_i2c_sda;
|
||||
int8_t Pin_i2c_scl;
|
||||
@@ -384,6 +384,7 @@ void loop()
|
||||
syslog(str);
|
||||
sendSysInfoUDP(1);
|
||||
refreshNodeList();
|
||||
MQTTCheck();
|
||||
}
|
||||
|
||||
// Perform regular checks, 10 times/sec
|
||||
|
||||
+10
-4
@@ -57,6 +57,9 @@ void addMenu(String& str)
|
||||
str += F(".button-link:hover,.button-menu:hover {background:#369;}");
|
||||
str += F("th {background-color:#55bbff;}");
|
||||
str += F("table {background-color:#ddeeff;}");
|
||||
str += F(".div_l {float: left;}");
|
||||
str += F(".div_r {float: right;}");
|
||||
str += F(".div_br {clear: both;}");
|
||||
str += F("</style>");
|
||||
}
|
||||
str += F("</head>");
|
||||
@@ -259,7 +262,7 @@ void handle_config() {
|
||||
strcpy(SecuritySettings.WifiKey, tmpString);
|
||||
apkey.toCharArray(tmpString, 64);
|
||||
urlDecode(tmpString);
|
||||
strcpy(Settings.WifiAPKey, tmpString);
|
||||
strcpy(SecuritySettings.WifiAPKey, tmpString);
|
||||
controllerip.toCharArray(tmpString, 26);
|
||||
str2ip(tmpString, Settings.Controller_IP);
|
||||
Settings.ControllerPort = controllerport.toInt();
|
||||
@@ -621,10 +624,13 @@ void handle_devices() {
|
||||
if ((Settings.TaskDeviceNumber[x] != 0) and (varNr < Device[DeviceIndex].ValueCount))
|
||||
{
|
||||
if (varNr > 0)
|
||||
reply += F("<BR>");
|
||||
reply += F("<div class=\"div_br\"></div>");
|
||||
reply += F("<div class=\"div_l\">");
|
||||
reply += ExtraTaskSettings.TaskDeviceValueNames[varNr];
|
||||
reply += ":";
|
||||
reply += ":</div>";
|
||||
reply += F("<div class=\"div_r\">");
|
||||
reply += UserVar[x * VARS_PER_TASK + varNr];
|
||||
reply += "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1170,7 +1176,7 @@ void handle_wifiscanner() {
|
||||
|
||||
String reply = "";
|
||||
addMenu(reply);
|
||||
reply += F("<table><TH>Access Points:<TD>RSSI");
|
||||
reply += F("<table><TH>Access Points:<TH>RSSI");
|
||||
|
||||
int n = WiFi.scanNetworks();
|
||||
if (n == 0)
|
||||
|
||||
@@ -9,7 +9,7 @@ void WifiAPconfig()
|
||||
strcpy(ap_ssid, "ESP_");
|
||||
sprintf_P(ap_ssid, PSTR("%s%u"), ap_ssid, Settings.Unit);
|
||||
// setup ssid for AP Mode when needed
|
||||
WiFi.softAP(ap_ssid, Settings.WifiAPKey);
|
||||
WiFi.softAP(ap_ssid, SecuritySettings.WifiAPKey);
|
||||
// We start in STA mode
|
||||
WiFi.mode(WIFI_STA);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ void WifiAPMode(boolean state)
|
||||
ap_ssid[0] = 0;
|
||||
strcpy(ap_ssid, "ESP_");
|
||||
sprintf_P(ap_ssid, PSTR("%s%u"), ap_ssid, Settings.Unit);
|
||||
WiFi.softAP(ap_ssid, Settings.WifiAPKey);
|
||||
WiFi.softAP(ap_ssid, SecuritySettings.WifiAPKey);
|
||||
WiFi.mode(WIFI_AP_STA);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
// R24 27-09-2015
|
||||
// Right-aligned device values in device table
|
||||
// Added periodic MQTT connection check
|
||||
// Fixed issue with the AP WPA Key configuration
|
||||
|
||||
// R23 26-09-2015
|
||||
// Fix device table layout for some browsers
|
||||
// Added link to stylesheet "esp.css" located on SPIFFS
|
||||
|
||||
Reference in New Issue
Block a user