some changes

This commit is contained in:
Dmitry Borisenko
2020-06-04 01:08:08 +02:00
parent 3135e5658f
commit e79be004b9
12 changed files with 112 additions and 17 deletions

View File

@@ -3,8 +3,8 @@
"chipID": "",
"ssidAP": "WiFi2",
"passwordAP": "",
"ssid": "VOLODYA",
"password": "BELCHENKO",
"ssid": "rise",
"password": "hostel3333",
"timezone": 2,
"ntp": "pool.ntp.org",
"mqttServer": "91.204.228.124",

Binary file not shown.

Binary file not shown.

View File

@@ -9,7 +9,7 @@
{
"type": "h5",
"title": "{{name}}",
"class": "alert-warning"
"class": "alert-default"
},
{
"type": "h4",

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,20 @@
{
"SetDevConf": "Конфигурация устройства",
"SetDevPreset": "Выберите из выпадающего списка подходящий пресет кофигураций",
"SetDevPreset": "Выберите из списка подходящий пресет кофигурации",
"ButSave":"Сохранить",
"ButMainPage":"Главная",
"SetUDPList": "Список других устройств в сети:",
"SetUDPWarn1": "После нажатия на кнопку 'Переформировать список устройств' ждите примерно минуту, а затем обновите страницу и список появится вновь"
"SetUDPWarn1": "После нажатия на кнопку 'Переформировать список устройств' ждите примерно минуту, а затем обновите страницу и список появится вновь",
"SetUDPUpdateList":"Переформировать список устройств",
"SetUDPUpdatePage":"Обновить страницу",
"SetUDPNameOfDev":"Имя этого устройства:",
"SetUDPDateExchange":"Включить обмен данными между устройствами",
"SetUDPWarn2":"Если обмен данными включен, то устройства будут обмениваться широковещательными пакетами udp для формирования списка устройств и для осуществления посылки настроек mqtt. Данный обмен создает дополнительную нагрузку на wifi сеть."
}

View File

@@ -1,6 +1,5 @@
{
"configs": [
"/config.live.json",
"/config.setup.json",
"/config.option.json",
"/lang/lang.ru.json"
@@ -10,7 +9,7 @@
{
"type": "h5",
"title": "{{name}}",
"class": "alert-warning"
"class": "alert-default"
},
{
"type": "h4",

View File

@@ -1,6 +1,5 @@
{
"configs": [
"/config.live.json",
"/config.setup.json",
"/lang/lang.ru.json"
],
@@ -10,7 +9,7 @@
{
"type": "h5",
"title": "{{name}}",
"class": "alert-warning"
"class": "alert-default"
},
{
"type": "h3",
@@ -35,13 +34,13 @@
},
{
"type": "link",
"title": "Переформировать список устройств",
"title": "{{SetUDPUpdateList}}",
"action": "set?updatelist",
"class": "btn btn-block btn-default"
},
{
"type": "link",
"title": "Обновить страницу",
"title": "{{SetUDPUpdatePage}}",
"action": "set?updatepage",
"class": "btn btn-block btn-default"
},
@@ -55,18 +54,18 @@
},
{
"type": "h3",
"title": "Имя этого устройства:"
"title": "{{SetUDPNameOfDev}}"
},
{
"type": "input",
"title": "Имя устройства",
"title": "{{SetUDPNameOfDev}}",
"name": "dev_name",
"state": "{{name}}",
"pattern": "[A-Za-z0-9]{6,12}"
},
{
"type": "button",
"title": "Сохранить",
"title": "{{ButSave}}",
"action": "name?arg=[[dev_name]]",
"class": "btn btn-block btn-default"
},
@@ -76,16 +75,20 @@
{
"type": "checkbox",
"name": "udponoff",
"title": "Включить обмен данными между устройствами",
"title": "{{SetUDPDateExchange}}",
"action": "/set?udponoff=[[udponoff]]",
"state": "{{udponoff}}"
},
{
"type": "text",
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #808080; border-radius: 3px; background-color: #E6E6FA; padding: 10px;'>{{SetUDPWarn2}}</p></font></div>"
},
{
"type": "hr"
},
{
"type": "link",
"title": "Главная",
"title": "{{ButMainPage}}",
"action": "/",
"class": "btn btn-block btn-default"
}

View File

@@ -26,7 +26,7 @@ void setup() {
Web_server_init();
Serial.println("[V] Web_server_init");
//--------------------------------------------------------------
//web_init();
web_init();
Serial.println("[V] web_init");
//--------------------------------------------------------------
Time_Init();

View File

@@ -89,6 +89,85 @@ uint16_t hexStringToUint16(String hex) {
return tmp;
}
}
String u16toStr(uint16_t u16Input)
{
char tmp[16];
sprintf(tmp, "0x%.4X", u16Input);
return tmp;
}
String u8toStr(uint8_t u8Input)
{
char tmp[8];
sprintf(tmp, "0x%.2X", u8Input);
return tmp;
}
String u64toStr(uint64_t input)
{
String result = "";//
uint8_t base = 16; //hex 10 dec
do {
char c = input % base; input /= base;
if (c < 10) {
c += '0';
} else {
c += 'A' - 10;
}
result = c + result;
} while (input);
switch (result.length()) {
case 1: {
result = "000000000000000" + result;
} break;
case 2: {
result = "00000000000000" + result;
} break;
case 3: {
result = "0000000000000" + result;
} break;
case 4: {
result = "000000000000" + result;
} break;
case 5: {
result = "00000000000" + result;
} break;
case 6: {
result = "0000000000" + result;
} break;
case 7: {
result = "000000000" + result;
} break;
case 8: {
result = "00000000" + result;
} break;
case 9: {
result = "0000000" + result;
} break;
case 10: {
result = "000000" + result;
} break;
case 11: {
result = "00000" + result;
} break;
case 12: {
result = "0000" + result;
} break;
case 13: {
result = "000" + result;
} break;
case 14: {
result = "00" + result;
} break;
case 15: {
result = "0" + result;
} break;
}
return result;
}
//==============================================================================================================
//=============================================CONFIG===========================================================
void saveConfig () {

Binary file not shown.