From 5020816b890348ce62c428013166b9828908f731 Mon Sep 17 00:00:00 2001 From: biver Date: Mon, 6 Jun 2022 14:33:29 +0300 Subject: [PATCH] =?UTF-8?q?=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data_svelte/items.json | 174 ++++++++++++------------- platformio.ini | 9 +- src/modules/API.cpp | 6 +- src/modules/exec/SDcard/platformio.ini | 2 +- 4 files changed, 91 insertions(+), 100 deletions(-) diff --git a/data_svelte/items.json b/data_svelte/items.json index 59e3103b..093af846 100644 --- a/data_svelte/items.json +++ b/data_svelte/items.json @@ -92,36 +92,22 @@ "pin": 2 }, { - "name": "7. Camera OV2640 (ESPcam)", + "name": "7. Сервопривод", "num": 7, - "type": "Reading", - "subtype": "EspCam", - "id": "EspCam", - "widget": "", - "page": "", - "descr": "", - "int": 60, - "useLed": 0, - "ticker": 0, - "webTicker": 0 - }, - { - "name": "8. Сервопривод", - "num": 8, "type": "Writing", "subtype": "IoTServo", "id": "servo", "widget": "range", "page": "servo", "descr": "угол", - "int": 0, + "int": 1, "pin": 12, "apin": -1, "amap": "0, 4096, 0, 180" }, { - "name": "9. MP3 плеер", - "num": 9, + "name": "8. MP3 плеер", + "num": 8, "type": "Reading", "subtype": "Mp3", "id": "mp3", @@ -133,19 +119,8 @@ "volume": 20 }, { - "name": "10. SD карта", - "num": 10, - "type": "Writing", - "subtype": "SDcard", - "id": "sd", - "widget": "", - "page": "", - "descr": "", - "int": 60 - }, - { - "name": "11. Таймер", - "num": 11, + "name": "9. Таймер", + "num": 9, "type": "Writing", "subtype": "Timer", "id": "timer", @@ -162,8 +137,8 @@ "header": "Сенсоры" }, { - "name": "12. Датчик напряжения ADS1115", - "num": 12, + "name": "10. Датчик напряжения ADS1115", + "num": 10, "type": "Reading", "subtype": "Ads1115", "id": "Ads3", @@ -179,8 +154,8 @@ "int": 10 }, { - "name": "13. Cенсор температуры AHT20", - "num": 13, + "name": "11. Cенсор температуры AHT20", + "num": 11, "type": "Reading", "subtype": "Aht20t", "id": "Temp20", @@ -192,8 +167,8 @@ "round": 1 }, { - "name": "14. Cенсор влажности AHT20", - "num": 14, + "name": "12. Cенсор влажности AHT20", + "num": 12, "type": "Reading", "subtype": "Aht20h", "id": "Hum20", @@ -205,8 +180,8 @@ "round": 1 }, { - "name": "15. Аналоговый сенсор", - "num": 15, + "name": "13. Аналоговый сенсор", + "num": 13, "type": "Reading", "subtype": "AnalogAdc", "id": "t", @@ -222,8 +197,8 @@ "avgSteps": 1 }, { - "name": "16. Cенсор температуры Bme280", - "num": 16, + "name": "14. Cенсор температуры Bme280", + "num": 14, "type": "Reading", "subtype": "Bme280t", "id": "tmp3", @@ -235,8 +210,8 @@ "round": 1 }, { - "name": "17. Cенсор давления Bme280", - "num": 17, + "name": "15. Cенсор давления Bme280", + "num": 15, "type": "Reading", "subtype": "Bme280p", "id": "Press3", @@ -248,8 +223,8 @@ "round": 1 }, { - "name": "18. Cенсор влажности Bme280", - "num": 18, + "name": "16. Cенсор влажности Bme280", + "num": 16, "type": "Reading", "subtype": "Bme280h", "id": "Hum3", @@ -261,8 +236,8 @@ "round": 1 }, { - "name": "19. Cенсор температуры Bmp280", - "num": 19, + "name": "17. Cенсор температуры Bmp280", + "num": 17, "type": "Reading", "subtype": "Bmp280t", "id": "tmp3", @@ -274,8 +249,8 @@ "round": 1 }, { - "name": "20. Cенсор давления Bmp280", - "num": 20, + "name": "18. Cенсор давления Bmp280", + "num": 18, "type": "Reading", "subtype": "Bmp280p", "id": "Press3", @@ -287,8 +262,8 @@ "round": 1 }, { - "name": "21. Cенсор температуры dht11", - "num": 21, + "name": "19. Cенсор температуры dht11", + "num": 19, "type": "Reading", "subtype": "Dht1122t", "id": "tmp3", @@ -300,8 +275,8 @@ "senstype": "dht11" }, { - "name": "22. Cенсор влажности dht11", - "num": 22, + "name": "20. Cенсор влажности dht11", + "num": 20, "type": "Reading", "subtype": "Dht1122h", "id": "Hum3", @@ -313,8 +288,8 @@ "senstype": "dht11" }, { - "name": "23. Cенсор температуры ds18b20", - "num": 23, + "name": "21. Cенсор температуры ds18b20", + "num": 21, "type": "Reading", "subtype": "Ds18b20", "id": "dstmp", @@ -328,8 +303,8 @@ "round": 1 }, { - "name": "24. Датчик тока", - "num": 24, + "name": "22. Датчик тока", + "num": 22, "type": "Reading", "subtype": "I", "id": "current", @@ -343,8 +318,8 @@ "multiply": 1 }, { - "name": "25. Датчик напряжения", - "num": 25, + "name": "23. Датчик напряжения", + "num": 23, "type": "Reading", "subtype": "U", "id": "voltage", @@ -358,8 +333,8 @@ "multiply": 1 }, { - "name": "26. Cенсор температуры GY21", - "num": 26, + "name": "24. Cенсор температуры GY21", + "num": 24, "type": "Reading", "subtype": "GY21t", "id": "tmp4", @@ -370,8 +345,8 @@ "int": 15 }, { - "name": "27. Cенсор влажности GY21", - "num": 27, + "name": "25. Cенсор влажности GY21", + "num": 25, "type": "Reading", "subtype": "GY21h", "id": "Hum4", @@ -382,8 +357,8 @@ "int": 15 }, { - "name": "28. Cенсор температуры HDC1080", - "num": 28, + "name": "26. Cенсор температуры HDC1080", + "num": 26, "type": "Reading", "subtype": "Hdc1080t", "id": "Temp1080", @@ -395,8 +370,8 @@ "round": 1 }, { - "name": "29. Cенсор влажности HDC1080", - "num": 29, + "name": "27. Cенсор влажности HDC1080", + "num": 27, "type": "Reading", "subtype": "Hdc1080h", "id": "Hum1080", @@ -408,8 +383,21 @@ "round": 1 }, { - "name": "30. Cенсор температуры MAX6675", - "num": 30, + "name": "28. Считыватель Wiegand", + "num": 28, + "type": "Reading", + "subtype": "IoTWiegand", + "id": "wg", + "widget": "anydataTmp", + "page": "Сенсоры", + "descr": "Считыватель", + "int": 0, + "pinD0": 13, + "pinD1": 12 + }, + { + "name": "29. Cенсор температуры MAX6675", + "num": 29, "type": "Reading", "subtype": "Max6675t", "id": "maxtmp", @@ -422,8 +410,8 @@ "CLK": 14 }, { - "name": "31. Датчик CO2 MHZ-19 UART", - "num": 31, + "name": "30. Датчик CO2 MHZ-19 UART", + "num": 30, "type": "Reading", "subtype": "Mhz19uart", "id": "co2uart", @@ -441,8 +429,8 @@ "ABC": 1 }, { - "name": "32. Датчик CO2 MHZ-19 PWM", - "num": 32, + "name": "31. Датчик CO2 MHZ-19 PWM", + "num": 31, "type": "Reading", "subtype": "Mhz19pwm", "id": "co2pwm", @@ -456,8 +444,8 @@ "int": 300 }, { - "name": "33. Cенсор температуры от MHZ-19 UART", - "num": 33, + "name": "32. Cенсор температуры от MHZ-19 UART", + "num": 32, "type": "Reading", "subtype": "Mhz19temp", "id": "Mhz19temp", @@ -473,8 +461,8 @@ "int": 30 }, { - "name": "34. Рабочий диапазон от MHZ-19 UART", - "num": 34, + "name": "33. Рабочий диапазон от MHZ-19 UART", + "num": 33, "type": "Reading", "subtype": "Mhz19range", "id": "Mhz19range", @@ -491,8 +479,8 @@ "int": 30 }, { - "name": "35. Автокалибровка от MHZ-19 UART", - "num": 35, + "name": "34. Автокалибровка от MHZ-19 UART", + "num": 34, "type": "Reading", "subtype": "Mhz19ABC", "id": "Mhz19ABC", @@ -506,8 +494,8 @@ "int": 30 }, { - "name": "36. Датчик пыли SDS011 PM25", - "num": 36, + "name": "35. Датчик пыли SDS011 PM25", + "num": 35, "type": "Reading", "subtype": "Sds011_25", "id": "pmuart25", @@ -524,8 +512,8 @@ "period": 300 }, { - "name": "37. Датчик пыли SDS011 PM10", - "num": 37, + "name": "36. Датчик пыли SDS011 PM10", + "num": 36, "type": "Reading", "subtype": "Sds011_10", "id": "pmuart10", @@ -542,8 +530,8 @@ "period": 300 }, { - "name": "38. Cенсор температуры Sht20", - "num": 38, + "name": "37. Cенсор температуры Sht20", + "num": 37, "type": "Reading", "subtype": "Sht20t", "id": "tmp2", @@ -554,8 +542,8 @@ "round": 1 }, { - "name": "39. Cенсор влажности Sht20", - "num": 39, + "name": "38. Cенсор влажности Sht20", + "num": 38, "type": "Reading", "subtype": "Sht20h", "id": "Hum2", @@ -566,8 +554,8 @@ "round": 1 }, { - "name": "40. Сонар HC-SR04", - "num": 40, + "name": "39. Сонар HC-SR04", + "num": 39, "type": "Reading", "subtype": "Sonar", "id": "sonar", @@ -582,8 +570,8 @@ "header": "Экраны" }, { - "name": "41. LCD экран 2004", - "num": 41, + "name": "40. LCD экран 2004", + "num": 40, "type": "Reading", "subtype": "Lcd2004", "id": "Lcd", @@ -597,8 +585,8 @@ "id2show": "id датчика" }, { - "name": "42. LCD экран 1602", - "num": 42, + "name": "41. LCD экран 1602", + "num": 41, "type": "Reading", "subtype": "Lcd2004", "id": "Lcd", diff --git a/platformio.ini b/platformio.ini index f0ffb147..712726b3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -34,7 +34,7 @@ build_src_filter = +<*> exclude = 1 [platformio] -default_envs = esp32_4mb +default_envs = esp8266_4mb data_dir = data_svelte [common_env_data] @@ -56,17 +56,19 @@ lib_deps = openenergymonitor/EmonLib@1.1.0 https://github.com/JonasGMorsch/GY-21.git ClosedCube HDC1080 + https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino adafruit/MAX6675 library Nova Fitness Sds dust sensors library@1.5.1 robtillaart/SHT2x@^0.1.1 marcoschwartz/LiquidCrystal_I2C@^1.1.4 build_src_filter = + - + - - [env:esp32_4mb_fromitems] lib_deps = adafruit/Adafruit MCP23017 Arduino Library@^2.0.2 - espressif/esp32-camera @ ^2.0.0 https://github.com/RoboticsBrno/ServoESP32 dfrobot/DFRobotDFPlayerMini @ ^1.0.5 adafruit/Adafruit ADS1X15 @ ^2.3.0 @@ -78,10 +80,13 @@ lib_deps = openenergymonitor/EmonLib@1.1.0 https://github.com/JonasGMorsch/GY-21.git ClosedCube HDC1080 + https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino adafruit/MAX6675 library Nova Fitness Sds dust sensors library@1.5.1 robtillaart/SHT2x@^0.1.1 marcoschwartz/LiquidCrystal_I2C@^1.1.4 build_src_filter = + - + - - diff --git a/src/modules/API.cpp b/src/modules/API.cpp index a2a88be6..3bd61345 100644 --- a/src/modules/API.cpp +++ b/src/modules/API.cpp @@ -6,10 +6,8 @@ void* getAPI_SysExt(String subtype, String params); void* getAPI_Variable(String subtype, String params); void* getAPI_ButtonIn(String subtype, String params); void* getAPI_ButtonOut(String subtype, String params); -void* getAPI_EspCam(String subtype, String params); void* getAPI_IoTServo(String subtype, String params); void* getAPI_Mp3(String subtype, String params); -void* getAPI_SDcard(String subtype, String params); void* getAPI_Timer(String subtype, String params); void* getAPI_Ads1115(String subtype, String params); void* getAPI_Aht20(String subtype, String params); @@ -21,6 +19,7 @@ void* getAPI_Ds18b20(String subtype, String params); void* getAPI_Emon(String subtype, String params); void* getAPI_GY21(String subtype, String params); void* getAPI_Hdc1080(String subtype, String params); +void* getAPI_IoTWiegand(String subtype, String params); void* getAPI_Max6675(String subtype, String params); void* getAPI_Mhz19(String subtype, String params); void* getAPI_Sds011(String subtype, String params); @@ -36,10 +35,8 @@ if ((tmpAPI = getAPI_SysExt(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Variable(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_ButtonIn(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_ButtonOut(subtype, params)) != nullptr) return tmpAPI; -if ((tmpAPI = getAPI_EspCam(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_IoTServo(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Mp3(subtype, params)) != nullptr) return tmpAPI; -if ((tmpAPI = getAPI_SDcard(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Timer(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Ads1115(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Aht20(subtype, params)) != nullptr) return tmpAPI; @@ -51,6 +48,7 @@ if ((tmpAPI = getAPI_Ds18b20(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Emon(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_GY21(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Hdc1080(subtype, params)) != nullptr) return tmpAPI; +if ((tmpAPI = getAPI_IoTWiegand(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Max6675(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Mhz19(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Sds011(subtype, params)) != nullptr) return tmpAPI; diff --git a/src/modules/exec/SDcard/platformio.ini b/src/modules/exec/SDcard/platformio.ini index b5526c25..918c9a4f 100644 --- a/src/modules/exec/SDcard/platformio.ini +++ b/src/modules/exec/SDcard/platformio.ini @@ -6,4 +6,4 @@ lib_deps = [iotm] - exclude = false + exclude = true