diff --git a/Cmd.ino b/Cmd.ino index f22dc3e0..09c8b340 100644 --- a/Cmd.ino +++ b/Cmd.ino @@ -189,6 +189,7 @@ void pwm() { jsonWrite(optionJson, "pwm_pin" + pwm_number, pwm_pin); pinMode(pwm_pin_int, INPUT); analogWrite(pwm_pin_int, start_state.toInt()); + //analogWriteFreq(32000); jsonWrite(configJson, "pwmSet" + pwm_number, start_state); createViget (viget_name, page_name, page_number, "vigets/viget.range.json", "pwmSet" + pwm_number); @@ -355,7 +356,7 @@ void stepperSet() { if (steps.toInt() < 0) digitalWrite(pin_dir.toInt(), LOW); if (stepper_number == "1") { ts.add(STEPPER1, stepper_speed.toInt(), [&](void*) { - int steps_int = abs(jsonReadtoInt(optionJson, "steps1")); + int steps_int = abs(jsonReadtoInt(optionJson, "steps1") * 2); static int count; count++; String pin_step = selectToMarker (jsonRead(optionJson, "stepper1"), " "); @@ -367,9 +368,9 @@ void stepperSet() { } }, nullptr, true); } - if (stepper_number == "2") { + if (stepper_number == "2") { ts.add(STEPPER2, stepper_speed.toInt(), [&](void*) { - int steps_int = abs(jsonReadtoInt(optionJson, "steps2")); + int steps_int = abs(jsonReadtoInt(optionJson, "steps2") * 2); static int count; count++; String pin_step = selectToMarker (jsonRead(optionJson, "stepper2"), " "); diff --git a/data/configs/stepper.scenario.txt b/data/configs/stepper.scenario.txt index 89f9e3dd..16e7cfa6 100644 --- a/data/configs/stepper.scenario.txt +++ b/data/configs/stepper.scenario.txt @@ -1,12 +1,12 @@ button1 = 1 -stepperSet 1 200 5 +stepperSet 1 200 1 end button1 = 0 -stepperSet 1 -200 5 +stepperSet 1 -200 1 end button2 = 1 -stepperSet 2 200 5 +stepperSet 2 200 1 end button2 = 0 -stepperSet 2 -200 5 +stepperSet 2 -200 1 end \ No newline at end of file diff --git a/data/configuration.json b/data/configuration.json index 6ad2b5a7..9f6d00c7 100644 --- a/data/configuration.json +++ b/data/configuration.json @@ -1,116 +1,113 @@ { - "configs": [ - - "/config.live.json", - "/config.setup.json", - "/config.option.json" - - ], - "class":"col-sm-offset-1 col-sm-10", - "content": [ - { - "type": "h5", - "title": "{{SSDP}}", - "class":"alert-warning" - }, -{ - "type": "h4", - "title": "Device ID: {{chipID}}" - }, -{ - "type": "h4", - "title": "IP address: {{ip}}" - }, -{ - "type": "h4", - "title": "Uptime: {{uptime}}" - }, - { - "type": "hr" - }, - - { - "type":"dropdown", - "name":"help-url", - "class":"btn btn-warning btn-lg", - "style":"display:inline", - "title": { - "#":"Выбирите то, во что Вы хотите превратить ESP ", - "/relay":"1.Вкл. выкл. локального реле", - "/relay_timer":"2.Вкл. выкл. локального реле в определенное время", - "/relay_countdown":"3.Вкл. выкл. локального реле на определенный период времени", - "/relay_several":"4.Вкл. выкл. нескольких локальных реле кнопкой в приложении", - "/relay_switch":"5.Вкл. выкл. локального реле физической кнопкой (кнопка так же дублируется в приложении)", - "/relay_button_remote":"6.Вкл. выкл. нескольких удаленных реле кнопкой в приложении (нужно указать Device ID)", - "/relay_switch_remote":"7.Вкл. выкл. нескольких удаленных реле физической кнопкой (нужно указать Device ID)", - "/pwm":"8.Широтно импульсная модуляция", - "/dht11":"9.Сенсор DHT11", - "/dht22":"10.Сенсор DHT22, DHT33, DHT44, AM2302, RHT03", - "/analog":"11.Аналоговый сенсор", - "/dallas":"12.Сенсор DS18B20", - "/termostat":"13.Термостат на DS18B20 с переключением в ручной режим", - "/level":"14.Контроль уровня в баке на сенсорах: JSN-SR04T, HC-SR04, HY-SRF05 (управление насосом)", - "/moution_relay":"15.Датчик движения включающий свет", - "/moution_security":"16.Охранный датчик движения", - "/stepper":"17.Система управления шаговыми двигателями на основе драйвера A4988 (открытие закрытие штор)", - "/default":"Настройки по умолчанию" - } - }, -{ - "type": "h2", - "title": "Конфигурация устройства" - }, - { - "type":"file", - "state":"firmware.config.txt", - "style":"width:100%;height:400px", - "title": "Сохранить", - "action": "/all_modules_init", - "class":"btn btn-block btn-success" - }, - { - "type": "link", - "title": "Инструкция", - "action": "https://github.com/DmitryBorisenko33/esp8266_iot-manager_modules_firmware/wiki/Instruction", - "class": "btn btn-block btn-primary" - }, -{ - "type": "h2", - "title": "Сценарии" - }, -{ -"type": "checkbox", -"name":"scenario", -"title": "Включить сценарии", -"action": "/scenario?status=[[scenario]]", -"state": "{{scenario}}" -}, -{ - "type": "h6", - "title": "" - }, -{ - "type":"file", - "state":"firmware.scenario.txt", - "style":"width:100%;height:400px", - "title": "Сохранить и включить", - "action": "/scenario?status=1", - "class":"btn btn-block btn-success" - }, -{ - "type": "hr" - }, - { - "type": "link", - "title": "Очистить все логи", - "action": "/cleanlog", - "class": "btn btn-block btn-success" - }, - { - "type": "link", - "title": "Главная", - "action": "/page.htm?index", - "class": "btn btn-block btn-danger btn-sm" - } - ] -} + "configs": [ + "/config.live.json", + "/config.setup.json", + "/config.option.json" + ], + "class": "col-sm-offset-1 col-sm-10", + "content": [ + { + "type": "h5", + "title": "{{SSDP}}", + "class": "alert-warning" + }, + { + "type": "h4", + "title": "Device ID: {{chipID}}" + }, + { + "type": "h4", + "title": "IP address: {{ip}}" + }, + { + "type": "h4", + "title": "Uptime: {{uptime}}" + }, + { + "type": "hr" + }, + { + "type": "dropdown", + "name": "help-url", + "class": "btn btn-warning btn-lg", + "style": "display:inline", + "title": { + "#": "Выбирите то, во что Вы хотите превратить ESP ", + "/relay": "1.Вкл. выкл. локального реле", + "/relay_timer": "2.Вкл. выкл. локального реле в определенное время", + "/relay_countdown": "3.Вкл. выкл. локального реле на определенный период времени", + "/relay_several": "4.Вкл. выкл. нескольких локальных реле кнопкой в приложении", + "/relay_switch": "5.Вкл. выкл. локального реле физической кнопкой (кнопка так же дублируется в приложении)", + "/relay_button_remote": "6.Вкл. выкл. нескольких удаленных реле кнопкой в приложении (нужно указать Device ID)", + "/relay_switch_remote": "7.Вкл. выкл. нескольких удаленных реле физической кнопкой (нужно указать Device ID)", + "/pwm": "8.Широтно импульсная модуляция", + "/dht11": "9.Сенсор DHT11", + "/dht22": "10.Сенсор DHT22, DHT33, DHT44, AM2302, RHT03", + "/analog": "11.Аналоговый сенсор", + "/dallas": "12.Сенсор DS18B20", + "/termostat": "13.Термостат на DS18B20 с переключением в ручной режим", + "/level": "14.Контроль уровня в баке на сенсорах: JSN-SR04T, HC-SR04, HY-SRF05 (управление насосом)", + "/moution_relay": "15.Датчик движения включающий свет", + "/moution_security": "16.Охранный датчик движения", + "/stepper": "17.Система управления шаговыми двигателями на основе драйвера A4988 (открытие закрытие штор)", + "/default": "Настройки по умолчанию" + } + }, + { + "type": "h2", + "title": "Конфигурация устройства" + }, + { + "type": "file", + "state": "firmware.config.txt", + "style": "width:100%;height:400px", + "title": "Сохранить", + "action": "/all_modules_init", + "class": "btn btn-block btn-success" + }, + { + "type": "link", + "title": "Инструкция", + "action": "https://github.com/DmitryBorisenko33/esp8266_iot-manager_modules_firmware/wiki/Instruction", + "class": "btn btn-block btn-primary" + }, + { + "type": "h2", + "title": "Сценарии" + }, + { + "type": "checkbox", + "name": "scenario", + "title": "Включить сценарии", + "action": "/scenario?status=[[scenario]]", + "state": "{{scenario}}" + }, + { + "type": "h6", + "title": "" + }, + { + "type": "file", + "state": "firmware.scenario.txt", + "style": "width:100%;height:400px", + "title": "Сохранить и включить", + "action": "/scenario?status=1", + "class": "btn btn-block btn-success" + }, + { + "type": "hr" + }, + { + "type": "link", + "title": "Очистить все логи", + "action": "/cleanlog", + "class": "btn btn-block btn-success" + }, + { + "type": "link", + "title": "Главная", + "action": "/page.htm?index", + "class": "btn btn-block btn-danger btn-sm" + } + ] +} \ No newline at end of file diff --git a/data/css/build.css.gz b/data/css/build.css.gz index a37a1ac1..ad0b46d2 100644 Binary files a/data/css/build.css.gz and b/data/css/build.css.gz differ diff --git a/data/edit.htm b/data/edit.htm deleted file mode 100644 index 5e2f46ce..00000000 --- a/data/edit.htm +++ /dev/null @@ -1,572 +0,0 @@ - - - - ESP Editor - - - - - - -
-
-
- - - - diff --git a/data/index.htm b/data/index.htm deleted file mode 100644 index f48e3673..00000000 --- a/data/index.htm +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - -
- - -
- - - - -
- - diff --git a/data/index.htm.gz b/data/index.htm.gz index 618ee19a..dda5d5da 100644 Binary files a/data/index.htm.gz and b/data/index.htm.gz differ diff --git a/data/index.json b/data/index.json index 4e8857fb..b7a656be 100644 --- a/data/index.json +++ b/data/index.json @@ -1,101 +1,96 @@ { - "configs": [ - "/config.live.json", - "/config.setup.json" - ], - - "socket": [ - "ws://{{ip}}/ws" - ], - - "title": "Главная", - "class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6", - "content": [ - { - "type": "h5", - "title": "{{SSDP}}", - "class": "alert-warning" - }, - { - "type": "h4", - "title": "Device ID: {{chipID}}" - }, - { - "type": "h4", - "title": "IP address: {{ip}}" - }, - { - "type": "h4", - "title": "Uptime: {{uptime}}" - }, - { - "type": "h4", - "title": "Build version: {{firmware_version}}" - }, - { - "type": "h4", - "title": "SPIFFS version: 2.3+" - }, - { - "type": "hr" - }, - { - "type": "link", - "title": "Конфигурация устройства", - "action": "/page.htm?configuration", - "class": "btn btn-block btn-primary" - }, - { - "type": "hr" - }, - { - "type": "link", - "title": "Конфигурация WIFI", - "action": "/page.htm?setup", - "class": "btn btn-block btn-success" - }, - { - "type": "link", - "title": "Конфигурация MQTT", - "action": "/page.htm?mqtt", - "class": "btn btn-block btn-success" - }, - { - "type": "link", - "title": "Конфигурация push", - "action": "/page.htm?pushingbox", - "class": "btn btn-block btn-success" - }, - { - "type": "hr" - }, - { - "type":"h3", - "name":"my-block", - "style":"position:fixed;top:50%;left:50%;width:400px;margin-left:-200px;text-align:center;", - "class":"hidden" - }, - { - "type": "button", - "title":"Обновить прошивку", - "action": "/upgrade", - "response":"[[my-block]]", - "class": "btn btn-block btn-success" - }, - { - "type": "hr" - }, - { - "type": "link", - "title": "Скачать приложение IoT Manager для android", - "action": "https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager", - "class": "btn btn-block btn-warning" - }, - { - "type": "link", - "title": "Скачать приложение IoT Manager для iphone", - "action": "https://apps.apple.com/ru/app/iot-manager/id1155934877", - "class": "btn btn-block btn-warning" - } - ] + "configs": [ + "/config.live.json", + "/config.setup.json" + ], + "title": "Главная", + "class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6", + "content": [ + { + "type": "h5", + "title": "{{SSDP}}", + "class": "alert-warning" + }, + { + "type": "h4", + "title": "Device ID: {{chipID}}" + }, + { + "type": "h4", + "title": "IP address: {{ip}}" + }, + { + "type": "h4", + "title": "Uptime: {{uptime}}" + }, + { + "type": "h4", + "title": "Build version: {{firmware_version}}" + }, + { + "type": "h4", + "title": "SPIFFS version: 2.3+" + }, + { + "type": "hr" + }, + { + "type": "link", + "title": "Конфигурация устройства", + "action": "/page.htm?configuration", + "class": "btn btn-block btn-primary" + }, + { + "type": "hr" + }, + { + "type": "link", + "title": "Конфигурация WIFI", + "action": "/page.htm?setup", + "class": "btn btn-block btn-success" + }, + { + "type": "link", + "title": "Конфигурация MQTT", + "action": "/page.htm?mqtt", + "class": "btn btn-block btn-success" + }, + { + "type": "link", + "title": "Конфигурация push", + "action": "/page.htm?pushingbox", + "class": "btn btn-block btn-success" + }, + { + "type": "hr" + }, + { + "type": "h3", + "name": "my-block", + "style": "position:fixed;top:50%;left:50%;width:400px;margin-left:-200px;text-align:center;", + "class": "hidden" + }, + { + "type": "button", + "title": "Обновить прошивку", + "action": "/upgrade", + "response": "[[my-block]]", + "class": "btn btn-block btn-success" + }, + { + "type": "hr" + }, + { + "type": "link", + "title": "Скачать приложение IoT Manager для android", + "action": "https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager", + "class": "btn btn-block btn-warning" + }, + { + "type": "link", + "title": "Скачать приложение IoT Manager для iphone", + "action": "https://apps.apple.com/ru/app/iot-manager/id1155934877", + "class": "btn btn-block btn-warning" + } + ] } diff --git a/data/index.json.gz b/data/index.json.gz deleted file mode 100644 index 5f590a7f..00000000 Binary files a/data/index.json.gz and /dev/null differ diff --git a/data/js/build.chart.js.gz b/data/js/build.chart.js.gz index 8e92fd30..49d8ad0b 100644 Binary files a/data/js/build.chart.js.gz and b/data/js/build.chart.js.gz differ diff --git a/data/js/function.js.gz b/data/js/function.js.gz index 3ab843f3..0dd356e1 100644 Binary files a/data/js/function.js.gz and b/data/js/function.js.gz differ diff --git a/data/lang/lang.ru.json.gz b/data/lang/lang.ru.json.gz new file mode 100644 index 00000000..e49a5826 Binary files /dev/null and b/data/lang/lang.ru.json.gz differ diff --git a/data/robots.txt b/data/robots.txt new file mode 100644 index 00000000..13375629 --- /dev/null +++ b/data/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: * \ No newline at end of file diff --git a/main.ino b/main.ino index fceb78a5..300184a7 100644 --- a/main.ino +++ b/main.ino @@ -278,7 +278,7 @@ void getMemoryLoad(String text) { //esp32 full memory = 362868 k bytes //esp8266 full memory = 53312 k bytes -/* + void web_print (String text) { if (WiFi.status() == WL_CONNECTED) { jsonWrite(json, "test1", jsonRead(json, "test2")); @@ -292,8 +292,15 @@ void web_print (String text) { ws.textAll(json); } } +/* + { + "type": "h4", + "title": "('{{build2}}'=='{{firmware_version}}'?'NEW':'OLD')" + }, +*/ - { +/* + { "type": "hr" }, { diff --git a/mqtt.ino b/mqtt.ino index 72cacc2b..c95bb818 100644 --- a/mqtt.ino +++ b/mqtt.ino @@ -51,7 +51,7 @@ void MQTT_init() { Serial.println("[V] WiFi-ok"); if (client.connected()) { Serial.println("[V] MQTT-ok"); - //web_print("MQTT-ok"); + web_print("MQTT-ok"); } else { MQTT_Connecting(); mqtt_lost_error++; diff --git a/set.h b/set.h index b9669606..6f233976 100644 --- a/set.h +++ b/set.h @@ -1,4 +1,4 @@ -String firmware_version = "2.3+"; +String firmware_version = "2.3.1"; String new_version; //#define OTA_enable