pzygmunt wrote:Wrzuć cały kod jaki podstawiasz.
Chodzi mi o tą sekcję
Code: Select all
ets_snprintf(buffer,
bufflen,
"<h1>%s</h1>GUID: %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X<br>MAC: %02X:%02X:%02X:%02X:%02X:%02X<br>LAST STATE: %s<br><br><form method=\"post\">WiFi SSID: <input type=\"text\" name=\"sid\" value=\"%s\"><br>WiFi Password: <input type=\"text\" name=\"wpw\" value=\"\"><br><br>Server: <input type=\"text\" name=\"svr\" value=\"%s\"><br>Location ID:<input type=\"number\" name=\"lid\" value=\"%i\"><br>Location password:<input type=\"text\" name=\"pwd\" value=\"\"><br><br>Sensor1 type:<select name=\"bt1\"><option value=\"0\" %s>button</option><option value=\"1\" %s>switch</option></select><br>Sensor2 type:<select name=\"bt2\"><option value=\"0\" %s>button</option><option value=\"1\" %s>switch</option></select>Sensor3 type:<select name=\"bt3\"><option value=\"0\" %s>NC</option><option value=\"1\" %s>NO</option></select><br>Sensor4 type:<select name=\"bt4\"><option value=\"0\" %s>NC</option><option value=\"1\" %s>NO</option></select><br><br><br><input type=\"submit\" value=\"Save\"></form>%s",
dev_name,
(unsigned char)supla_esp_cfg.GUID[0],
(unsigned char)supla_esp_cfg.GUID[1],
(unsigned char)supla_esp_cfg.GUID[2],
(unsigned char)supla_esp_cfg.GUID[3],
(unsigned char)supla_esp_cfg.GUID[4],
(unsigned char)supla_esp_cfg.GUID[5],
(unsigned char)supla_esp_cfg.GUID[6],
(unsigned char)supla_esp_cfg.GUID[7],
(unsigned char)supla_esp_cfg.GUID[8],
(unsigned char)supla_esp_cfg.GUID[9],
(unsigned char)supla_esp_cfg.GUID[10],
(unsigned char)supla_esp_cfg.GUID[11],
(unsigned char)supla_esp_cfg.GUID[12],
(unsigned char)supla_esp_cfg.GUID[13],
(unsigned char)supla_esp_cfg.GUID[14],
(unsigned char)supla_esp_cfg.GUID[15],
(unsigned char)mac[0],
(unsigned char)mac[1],
(unsigned char)mac[2],
(unsigned char)mac[3],
(unsigned char)mac[4],
(unsigned char)mac[5],
supla_esp_devconn_laststate(),
supla_esp_cfg.WIFI_SSID,
supla_esp_cfg.Server,
supla_esp_cfg.LocationID,
// supla_esp_cfg.CfgButtonType == BTN_TYPE_BUTTON ? "selected" : "",
// supla_esp_cfg.CfgButtonType == BTN_TYPE_SWITCH ? "selected" : "",
supla_esp_cfg.Button1Type == BTN_TYPE_BUTTON ? "selected" : "",
supla_esp_cfg.Button1Type == BTN_TYPE_SWITCH ? "selected" : "",
supla_esp_cfg.Button2Type == BTN_TYPE_BUTTON ? "selected" : "",
supla_esp_cfg.Button2Type == BTN_TYPE_SWITCH ? "selected" : "",
supla_esp_cfg.Button3Type == BTN_TYPE_NO ? "selected" : "",
supla_esp_cfg.Button3Type == BTN_TYPE_NC ? "selected" : "",
supla_esp_cfg.Button4Type == BTN_TYPE_NO ? "selected" : "",
supla_esp_cfg.Button4Type == BTN_TYPE_NC ? "selected" : "",
data_saved == 1 ? "Data saved!" : "");
Nie wyświetla mi do końca wszystkich elementów, a najważniejsze to brak przycisku "Save"

Sensor1 i Sensor2 działa prawidłowo, ale dodanie Sensor3 i Sensor4 powoduje , że strona nie ładuje się cała. Dodam jeszcze, że gdy usunę "obsługę" Sensor1 i Sensor2 to Sensor3 i Sensor4 działa prawidłowo.
Strona wygląda teraz tak
html.jpg
Kod HTML jaki jest przesyłany do przeglądarki wygląda tak
Code: Select all
<html><body bgcolor=#00D151><h1>SUPLA-inCan</h1>GUID: 503A546FFDD3DB906AF4A6DAB0464937<br>MAC: A0:20:A6:0A:FA:BF<br>LAST STATE: WiFi - Connecting...<br><br><form method="post">WiFi SSID: <input type="text" name="sid" value=""><br>WiFi Password: <input type="text" name="wpw" value=""><br><br>Server: <input type="text" name="svr" value=""><br>Location ID:<input type="number" name="lid" value="0"><br>Location password:<input type="text" name="pwd" value=""><br><br>Sensor1 type:<select name="bt1"><option value="0" >button</option><option value="1" selected>switch</option></select><br>Sensor2 type:<select name="bt2"><option value="0" >button</option><option value="1" selected>switch</option></select><br>Sensor3 type:<select name="bt3"><option value="0" >NO</option><option value="1" selected>NC</option></select><br>Sensor4 type:<select name="bt4"><option value="0" >NO</option><op
You do not have the required permissions to view the files attached to this post.