From 5888931870c6a2c8f6e560eecedc59e9d6510f1a Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sat, 24 Jul 2021 12:18:58 +0300 Subject: [PATCH] http API with CORS (interim) --- build-flags/build_flags_due | 1 + build-flags/build_flags_esp32-wifi | 6 +- build-flags/build_flags_mega2560slim-5100 | 5 +- compiled/esp32-wifi/uploadCFG.sh | 4 +- compiled/esp32-wifi/uploadOTA.sh | 2 +- lighthub/config.cpp | 35 +- lighthub/config.h | 4 + lighthub/discovery.json | 11 + lighthub/error!.txt | 369 ++++++++++++++++++++++ lighthub/flashstream.h | 44 ++- lighthub/item.cpp | 8 +- lighthub/itemCmd.cpp | 12 +- lighthub/main.cpp | 333 ++++++++----------- lighthub/main.h | 1 + 14 files changed, 596 insertions(+), 239 deletions(-) create mode 100644 lighthub/discovery.json create mode 100644 lighthub/error!.txt diff --git a/build-flags/build_flags_due b/build-flags/build_flags_due index e519ba9..e06c4cf 100644 --- a/build-flags/build_flags_due +++ b/build-flags/build_flags_due @@ -10,4 +10,5 @@ -DARDUINO_OTA_MDNS_DISABLE -DMDNS_ENABLE -DMCP23017 +-DCORS=\"http://lazyhome.ru\" diff --git a/build-flags/build_flags_esp32-wifi b/build-flags/build_flags_esp32-wifi index 6042312..bf5603d 100644 --- a/build-flags/build_flags_esp32-wifi +++ b/build-flags/build_flags_esp32-wifi @@ -9,8 +9,8 @@ -DSYSLOG_ENABLE # - udp errors -DOTA --DARDUINO_OTA_MDNS_DISABLE --DMDNS_ENABLE +#-DARDUINO_OTA_MDNS_DISABLE +#-DMDNS_ENABLE - ArduinoMDNS didnt working -DMCP23017 -DMODBUS_TX_PIN=13 @@ -41,3 +41,5 @@ #-DAUTOCONNECT_RECONNECT_WAITTIME=60 +-DFS_STORAGE +-DFS_PREPARE \ No newline at end of file diff --git a/build-flags/build_flags_mega2560slim-5100 b/build-flags/build_flags_mega2560slim-5100 index 8e8049e..4dc23ff 100644 --- a/build-flags/build_flags_mega2560slim-5100 +++ b/build-flags/build_flags_mega2560slim-5100 @@ -14,4 +14,7 @@ -DSYSLOG_ENABLE -DPID_DISABLE -DWiz5100 --DMOTOR_DISABLE \ No newline at end of file +-DMOTOR_DISABLE +-DOTA +-DARDUINO_OTA_MDNS_DISABLE +#-DMDNS_ENABLE \ No newline at end of file diff --git a/compiled/esp32-wifi/uploadCFG.sh b/compiled/esp32-wifi/uploadCFG.sh index 5d6dcd3..47f10be 100755 --- a/compiled/esp32-wifi/uploadCFG.sh +++ b/compiled/esp32-wifi/uploadCFG.sh @@ -1,2 +1,2 @@ -~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino -c data data.bin -../tools/mac/arduinoOTA -v -address 192.168.88.60 -port 65280 -username arduino -password password -sketch data.bin -upload /data -b \ No newline at end of file +~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino -s 20480 -c data data.bin +../tools/mac/arduinoOTA -v -address 192.168.88.50 -port 65280 -username arduino -password password -sketch data.bin -upload /data -b \ No newline at end of file diff --git a/compiled/esp32-wifi/uploadOTA.sh b/compiled/esp32-wifi/uploadOTA.sh index a07136c..8101074 100755 --- a/compiled/esp32-wifi/uploadOTA.sh +++ b/compiled/esp32-wifi/uploadOTA.sh @@ -1 +1 @@ -../tools/mac/arduinoOTA -v -address 192.168.88.60 -port 65280 -username arduino -password password -sketch firmware.bin -upload /sketch -b \ No newline at end of file +../tools/mac/arduinoOTA -v -address 192.168.88.50 -port 65280 -username arduino -password password -sketch firmware.bin -upload /sketch -b \ No newline at end of file diff --git a/lighthub/config.cpp b/lighthub/config.cpp index b0978e4..1f3c017 100644 --- a/lighthub/config.cpp +++ b/lighthub/config.cpp @@ -49,7 +49,7 @@ bool systemConfig::isValidSysConf() { if (!stream) return false; stream->seek(offsetof(systemConfigData,signature)); - for (int i=0;iread()!=EEPROM_signature[i]) { return false; @@ -74,6 +74,7 @@ bool systemConfig::isValidSysConf() bool systemConfig::getMQTTpwd(char * buffer, uint16_t bufLen) { + return 0; } @@ -81,6 +82,18 @@ bool systemConfig::isValidSysConf() { } + + + bool systemConfig::getOTApwd(char * buffer, uint16_t bufLen) + { + return 0; + + } + + bool systemConfig::setOTApwd(char * pwd) + { + + } bool systemConfig::setMAC(macAddress mac) { @@ -94,61 +107,71 @@ bool systemConfig::isValidSysConf() bool systemConfig::getServer(char* url) { - + return 0; } bool systemConfig::getIP(IPAddress& ip) { + return 0; } bool systemConfig::getMask(IPAddress& mask) { + return 0; } bool systemConfig::getDNS(IPAddress& dns) { + return 0; } bool systemConfig::getGW(IPAddress& gw) { + return 0; + } bool systemConfig::setIP(IPAddress& ip) { + return 0; } bool systemConfig::setMask(IPAddress& mask) { + return 0; } bool systemConfig::setDNS(IPAddress& dns) { + return 0; } bool systemConfig::setGW(IPAddress& gw) { + return 0; } void systemConfig::clear() { - - return; - if (!stream) return ; stream->seek(0); for (unsigned int i = 0; i < stream->getSize(); i++) { - mac[i] = stream->write(255); + stream->write(0); } + stream->seek(offsetof(systemConfigData,signature)); + for (unsigned int i=0;iwrite(EEPROM_signature[i])); + stream->flush(); } bool systemConfig::getSaveSuccedConfig() diff --git a/lighthub/config.h b/lighthub/config.h index 1736f57..57f6afc 100644 --- a/lighthub/config.h +++ b/lighthub/config.h @@ -65,6 +65,10 @@ class systemConfig { bool getMQTTpwd(char * buffer, uint16_t bufLen); bool setMQTTpwd(char * pwd = NULL); + + bool getOTApwd(char * buffer, uint16_t bufLen); + bool setOTApwd(char * pwd = NULL); + bool setMAC(macAddress mac); bool setServer(char* url); bool getServer(char* url); diff --git a/lighthub/discovery.json b/lighthub/discovery.json new file mode 100644 index 0000000..1146c2e --- /dev/null +++ b/lighthub/discovery.json @@ -0,0 +1,11 @@ +{ + "name": "Спальня LED_", + "command_topic": "myhome/in/bedr/cmd", + "state_topic": "myhome/s_out/bedr/cmd", + "hs_command_topic": "myhome/in/bedr/set", + "hs_state_topic": "myhome/s_out/bedr/set", + "hs_value_template": "{%set a=value.split(',')%} {% if a[1] -%} {{a[0]+','+a[1]}} {%- endif %}", + "brightness_scale": 100, + "brightness_command_topic": "myhome/in/bedr/set", + "brightness_state_topic": "myhome/s_out/bedr/set", + "brightness_value_template": "{{ value.split(',')[2] }}" } \ No newline at end of file diff --git a/lighthub/error!.txt b/lighthub/error!.txt new file mode 100644 index 0000000..fe8ede0 --- /dev/null +++ b/lighthub/error!.txt @@ -0,0 +1,369 @@ +help + +Lazyhome.ru LightHub controller 473256d_2021-05-16 C++ version:201103L + +(+)WATCHDOG +Config server:lazyhome.ru +Firmware MAC Address CUSTOM_FIRMWARE_MAC +(+)FreeRam printing +(+)DS2482-100 +(+)Wiznet5x00 +(+)DMX +(+)ADAFRUIT LED +(+)MODBUS +(+)OWIRE +(+)DHT +(+)COUNTER +(-)HARDRESET, using soft +(-)RESTART_LAN_ON_MQTT_ERRORS +(+)CCS811 & HDC1080 +(+)AC HAIER +(+)MOTOR CTR +(+)SPI LED +(+)OTA +(+)ARTNET +(+)MCP23017 +(+)PID +(+)SYSLOG +Reading 128 bits unique identifier +ID: 51203120383830503130313232313035 +Current LAN config(ip,dns,gw,subnet):192.168.11.172, 192.168.11.1, 255.255.255.0, +Use these commands: 'help' - this text +'mac de:ad:be:ef:fe:00' set and store MAC-address in EEPROM +'ip [ip[,dns[,gw[,subnet]]]]' - set static IP +'save' - save config in NVRAM +'get' [config addr]' - get config from pre-configured URL and store addr +'load' - load config from NVRAM +'pwd' - define MQTT password +'kill' - test watchdog +'clear' - clear EEPROM +'reboot' - reboot controller +>> + + +thermostat inactive Set:33.00 Cur:0.00 cmd:2 Expired + +RAM=41128 thermostat inactive Set:33.00 Cur:0.00 cmd:2 Expired + +RAM=41128 load +Loading Config from EEPROM +No stored config + +>> +thermostat inactive Set:33.00 Cur:0.00 cmd:2 Expired + +RAM=41128 get + Default config server used: lazyhome.ru +Config URI: http://lazyhome.ru/cnf/de-71-d1-a2-92-96.config.json +HTTP Status code: 200 +GET Response: { +"mqtt":["edem3","192.168.88.2"], +"syslog":["192.168.88.2"], + "dmx":[3,80], + "topics":{"root":"edem"}, +"items": + { + "lightall":[7,[ + "lampbedr3", + "lampcab31", + "lampcab32", + "lampsauna3", + "lampbath33", + "lampktc3", + "lampwc3", + "lamp4", + "lampext4", + "lamphall3", + "lampstw3", + "fasadeast", + "bra31", + "lampgst3", + "lampkln3", + "lampbalk3", + "fasadsouth", + "bra32"]], + "gr_hall3":[7,["lamphall3","lampstw3","lampwc3"]], + "gr_gost3":[7,["lampgst3","lampktc3"]], + "gr_kab3":[7,["lampcab31","lampcab32"]], + "relays":[7,["pout0","thermostat","pout2","pout3","pout4","pout5","pout6"]], + "uouts":[7,["unprot0","unprot1","unprot2","unprot3","unprot4","unprot5","unprot6","unprot7"]], + + "mb1":[44,[1,0,3,100]], + "mb2":[44,[1,1,3,100]], + "mb3":[44,[1,2,3,100]], + "mb4":[44,[1,3,3,100]], + "mba":[44,[96,0,0]], + + "lampbedr3":[0,3], + "lampcab31":[0,9], + "lampcab32":[0,4], + + "lampsauna3":[0,11], + "lampbath3":[0,5], + "lampwc3":[0,2], + + "lampktc3":[0,7], + "lamp4":[0,8], + "lamphall3":[0,1], + + "lampext4":[0,10], + "lampstw3":[0,6], + "fasadeast":[0,12], + + "lampgst3":[0,13], + "bra31":[0,14], + "bra32":[0,15], + + "lampbalk3":[0,16], + "fasadsouth":[0,17], + "lampkln3":[0,18], + "lampbar3":[0,21], + + "ledbedr3":[1,22], + "ledcab31":[1,26], + "ledcab32":[1,30], + "ledkab":[7,["ledcab31","ledcab32"]], + "ledsauna31":[1,34], + "ledsauna32":[1,38], + "ledsauna":[7,["ledsauna31","ledsauna32"]], + "led4":[1,42], + + "ledktc31":[1,48], + "ledktc31w":[0,52], + "ledktc32":[1,53], + "ledktc32w":[0,57], + "ledgst31":[1,58], + "ledgst31w":[0,62], + "ledgst32":[1,63], + "ledgst32w":[0,67], + "ledktc3w":[7,["ledktc31w","ledktc32w","ledgst31w","ledgst32w"]], + "ledktc3":[7,["ledktc31","ledktc32","ledgst31","ledgst32"]], + + "fanbath3":[0,68], + "fanwc3":[0,69], + + "pout0":[6,22], + "thermostat":[5,23,33], + "pout2":[6,24], + "water3":[6,25], + "pout4":[3,9], + "pout5":[3,8], + "pout6":[3,11], + "pout7":[6,12], + + + "pwm0" :[3,4], + "pwm1" :[3,5], + "pwm2" :[3,6], + "pwm3" :[3,7], + "pwm10":[3,10], + + + "unprot0":[6,33], + "unprot1":[6,32], + "unprot2":[6,31], + "unprot3":[6,30], + "unprot4":[6,29], + "unprot5":[6,28], + "unprot6":[6,27], + "unprot7":[6,26] + }, + +"in": + [ {"#":42,"emit":"power3","item":"fanwc3"}, + {"#":44,"emit":"in1"}, + {"#":46,"emit":"in2"}, + {"#":49,"emit":"in3"}, + {"#":43,"emit":"in4"}, + {"#":45,"emit":"in5"}, + {"#":47,"emit":"in6"}, + {"#":48,"emit":"in7"}, + {"#":34,"emit":"in8"}, + {"#":36,"emit":"in9"}, + + {"#":38,"T":0, + "click":{"item":"gr_hall3","icmd":"80"}, + "dclick":{"item":"lampbedr3","icmd":"ON"}, + "tclick":{"item":"lightall","icmd":"REST"}, + "rpcmd":{"item":"gr_hall3","icmd":"%+2"} + }, + {"#":40,"T":0, + "click":{"item":"gr_hall3","icmd":"OFF"}, + "dclick":{"item":"lampbedr3","icmd":"OFF"}, + "tclick":{"item":"lightall","icmd":"HALT"}, + "rpcmd":{"item":"gr_hall3","icmd":"%-2"} + }, + {"#":35,"T":0, + "click":{"item":"gr_gost3","icmd":"ON"}, + "dclick":{"item":"gr_kab3","icmd":"ON"}, + "tclick":{"item":"lampbath3","icmd":"ON"}, + "rpcmd":{"item":"gr_gost3","icmd":"%+2"} + }, + {"#":37,"T":0, + "click":{"item":"gr_gost3","icmd":"OFF"}, + "dclick":{"item":"gr_kab3","icmd":"OFF"}, + "tclick":{"item":"lampbath3","icmd":"OFF"}, + "rpcmd":{"item":"gr_gost3","icmd":"%-2"} + }, + + {"#":39,"emit":"in14"}, + {"#":41,"emit":"in15"}, + + {"#":54,"T":0,"act": + [ + { + "map":[128,640], + "click":{"item":"gr_gost3","icmd":"ON"}, + "dclick":{"item":"gr_kab3","icmd":"ON"}, + "tclick":{"item":"lampbath3","icmd":"ON"}, + "rpcmd":{"item":"gr_gost3","icmd":"%+2"} + }, + { + "map":[641,1024], + "click":{"item":"gr_gost3","icmd":"OFF"}, + "dclick":{"item":"gr_kab3","icmd":"OFF"}, + "tclick":{"item":"lampbath3","icmd":"OFF"}, + "rpcmd":{"item":"gr_gost3","icmd":"%-2"} + } + ]}, + {"#":55,"T":66,"emit":"a01","map":[0,1024,0,1024,10]}, + + {"#":56,"T":66,"emit":"a02","map":[0,1024,0,1024,10]}, + {"#":57,"T":66,"emit":"a03","map":[0,1024,0,1024,10]}, + + {"#":58,"T":66,"emit":"a04","map":[0,1024,0,1024,10]}, + {"#":59,"T":66,"emit":"a05","map":[0,1024,0,1024,10]}, + + {"#":60,"T":0,"act": + [ + { + "map":[128,640], + "click":{"item":"gr_hall3","icmd":"50"}, + "dclick":{"item":"lampbedr3","icmd":"ON"}, + "tclick":{"item":"lightall","icmd":"REST"}, + "rpcmd":{"item":"gr_hall3","icmd":"%+2"} + }, + { + "map":[641,1024], + "click":{"item":"gr_hall3","icmd":"OFF"}, + "dclick":{"item":"lampbedr3","icmd":"OFF"}, + "tclick":{"item":"lightall","icmd":"HALT"}, + "rpcmd":{"item":"gr_hall3","icmd":"%-2"} + } + ]}, + {"#":61,"T":0,"act": + [ + { + "map":[128,640], + "click":{"item":"gr_gost3","icmd":"ON"}, + "dclick":{"item":"gr_kab3","icmd":"ON"}, + "tclick":{"item":"lampbath3","icmd":"ON"}, + "rpcmd":{"item":"gr_gost3","icmd":"%+2"} + }, + { + "map":[641,1024], + "click":{"item":"gr_gost3","icmd":"OFF"}, + "dclick":{"item":"gr_kab3","icmd":"OFF"}, + "tclick":{"item":"lampbath3","icmd":"OFF"}, + "rpcmd":{"item":"gr_gost3","icmd":"%-2"} + } + ]}, + + {"#":62,"T":66,"emit":"a08","map":[0,1024,0,1024,10]}, + {"#":63,"T":66,"emit":"a09","map":[0,1024,0,1024,10]}, + + {"#":64,"T":66,"emit":"a10","map":[0,1024,0,1024,10]}, + {"#":65,"T":66,"emit":"a11","map":[0,1024,0,1024,10]}, + {"#":66,"T":0,"emit":"leak31","item":"water3","scmd":"OFF","rcmd":"ON"}, + {"#":67,"T":2,"emit":"leak32","item":"water3","scmd":"OFF","rcmd":"ON"}, + {"#":68,"T":0,"emit":"leak33","item":"water3","scmd":"OFF","rcmd":"ON"}, + {"#":69,"T":0,"emit":"a15"} + ], + +"in2": + { "42":{"emit":"power3","item":"fanwc3"}, + "44":{"emit":"in1"}, + "46":{"emit":"in2"}, + "49":{"emit":"in3"}, + "43":{"emit":"in4"}, + "45":{"emit":"in5"}, + "47":{"emit":"in6"}, + "48":{"emit":"in7"}, + "34":{"emit":"in8"}, + "36":{"emit":"in9"}, + + "38":{"T":0, + "click":{"item":"gr_hall3","icmd":"ON"}, + "dclick":{"item":"lampbedr3","icmd":"ON"}, + "tclick":{"item":"lightall","icmd":"REST"}, + "rpcmd":{"item":"gr_hall3","icmd":"%+2"} + }, + "40":{"T":0, + "click":{"item":"gr_hall3","icmd":"OFF"}, + "dclick":{"item":"lampbedr3","icmd":"OFF"}, + "tclick":{"item":"lightall","icmd":"HALT"}, + "rpcmd":{"item":"gr_hall3","icmd":"%-2"} + }, + "35":{"T":0, + "click":{"item":"gr_gost3","icmd":"ON"}, + "dclick":{"item":"lampwc3","icmd":"ON"}, + "tclick":{"item":"lampbath3","icmd":"ON"}, + "rpcmd":{"item":"gr_gost3","icmd":"%+2"} + }, + "37":{"T":0, + "click":{"item":"gr_gost3","icmd":"OFF"}, + "dclick":{"item":"lampwc3","icmd":"OFF"}, + "tclick":{"item":"lampbath3","icmd":"OFF"}, + "rpcmd":{"item":"gr_gost3","icmd":"%-2"} + }, + + "39":{"emit":"in14"}, + "41":{"emit":"in15"}, + + "54":{"addr":54,"T":0,"act": + [ + { + "map":[128,640], + "click":{"item":"gr_gost3","icmd":"ON"}, + "dclick":{"item":"lampwc3","icmd":"ON"}, + "tclick":{"item":"lampbath3","icmd":"ON"}, + "rpcmd":{"item":"gr_gost3","icmd":"%+2"} + }, + { + "map":[641,1024], + "click":{"item":"gr_gost3","icmd":"OFF"}, + "dclick":{"item":"lampwc3","icmd":"OFF"}, + "tclick":{"item":"lampbath3","icmd":"OFF"}, + "rpcmd":{"item":"gr_gost3","icmd":"%-2"} + } + ]}, + "55":{"T":66,"emit":"a01","map":[0,1024,0,1024,10]}, + + "56":{"T":66,"emit":"a02","map":[0,1024,0,1024,10]}, + "57":{"T":66,"emit":"a03","map":[0,1024,0,1024,10]}, + + "58":{"T":66,"emit":"a04","map":[0,1024,0,1024,10]}, + "59":{"T":66,"emit":"a05","map":[0,1024,0,1024,10]}, + + "60":{"T":66,"emit":"a06","map":[0,1024,0,1024,10]}, + "61":{"T":66,"emit":"a07","map":[0,1024,0,1024,10]}, + + "62":{"T":66,"emit":"a08","map":[0,1024,0,1024,10]}, + "63":{"T":66,"emit":"a09","map":[0,1024,0,1024,10]}, + + "64":{"T":66,"emit":"a10","map":[0,1024,0,1024,10]}, + "65":{"T":66,"emit":"a11","map":[0,1024,0,1024,10]}, + "66":{"T":0,"emit":"leak31","item":"water3","scmd":"OFF","rcmd":"ON"}, + "67":{"T":2,"emit":"leak32","item":"water3","scmd":"OFF","rcmd":"ON"}, + "68":{"T":0,"emit":"leak33","item":"water3","scmd":"OFF","rcmd":"ON"} + } +} +Free:29320 +Unlocking config ... + + Default config server used: lazyhome.ru +Config URI: http://lazyhome.ru/cnf/de-71-d1-a2-92-96.config.json +HTTP Status code>>> +Lazyhome.ru LightHub controller 473256d_2021-05-16 C++ version:201103L + +(+)WATCHDOG \ No newline at end of file diff --git a/lighthub/flashstream.h b/lighthub/flashstream.h index b1c7897..1be6f8b 100644 --- a/lighthub/flashstream.h +++ b/lighthub/flashstream.h @@ -4,7 +4,7 @@ #include -#if defined(ESP32) +#if defined(FS_STORAGE) #include #include #endif @@ -13,7 +13,11 @@ #include #endif -#if defined(ARDUINO_ARCH_ESP8266) +#if defined(ESP32) && !defined(FS_STORAGE) +#include +#endif + +#if defined(ARDUINO_ARCH_ESP8266) #include #endif @@ -39,6 +43,7 @@ extern NRFFlashStorage EEPROM; class seekableStream : public Stream { +protected: unsigned int streamSize; public: seekableStream(unsigned int size):Stream(),streamSize(size) {}; @@ -46,18 +51,22 @@ unsigned int getSize() {return streamSize;} virtual unsigned int seek(unsigned int _pos = 0) = 0; }; -#if defined(ESP32) +#if defined(FS_STORAGE) class flashStream : public seekableStream { private: File fs; public: -flashStream(String _filename):seekableStream(65535) {fs = SPIFFS.open(_filename, "r+");} - virtual int available() { return 1; }; +flashStream(String _filename):seekableStream(65535) + { + fs = SPIFFS.open(_filename, "a+"); + if (!fs) SPIFFS.open(_filename, "w+"); + } + virtual int available() { return fs.available(); }; virtual int read() {return fs.read();}; virtual int peek() { return fs.peek();}; virtual unsigned int seek(unsigned int _pos = 0){return fs.seek(_pos,SeekSet);}; - virtual void flush() {}; + virtual void flush() {return fs.flush();}; virtual size_t write(uint8_t ch) {return fs.write(ch);}; void putEOF(){write (255);}; virtual ~flashStream () {if (fs) fs.close();} ; @@ -71,29 +80,36 @@ class flashStream : public seekableStream protected: unsigned int pos; unsigned int startPos; -unsigned int size; + public: flashStream(unsigned int _startPos=0, unsigned int _size=4096 ):seekableStream(_size) { - pos = _startPos; startPos = _startPos; size = _size; + pos = _startPos; startPos = _startPos; #if defined(ESP8266) size_t len = EEPROM.length(); if (len) EEPROM.commit(); - EEPROM.begin(len+size); //Re-init + EEPROM.begin(len+streamSize); //Re-init #endif }; virtual unsigned int seek(unsigned int _pos = 0) - { pos=min(startPos+_pos, startPos+size); + { pos=min(startPos+_pos, startPos+streamSize); debugSerial<Ctrl(st, subItem); + st.saveItem(this); + setCmd(st.getCmd()); + SendStatus(SEND_COMMAND); + break; default: //another command if (cmd.isCommand()) st.Cmd(cmd.getCmd()); //debugSerial<<"DEF!"<getVal(); cmd.itemArgType= subtype; if (includeCommand) cmd.cmdCode=item->getCmd(); - debugSerial<itemVal->type) @@ -931,14 +931,14 @@ bool itemCmd::loadItem(Item * item, bool includeCommand) case aJson_Int: Int((int32_t)item->itemVal->valueint); - debugSerial<itemVal->valueint); - debugSerial<1)) { // mqttClient.publish(topic, ""); cmd_parse((char *)payload); - return; + return;// -4; } if (subItem = strchr(itemName, '/')) { *subItem = 0; subItem++; - if (*subItem=='$') return; //Skipping homie stuff - - // debugSerial<type == aJson_String) return element->valuestring; } #ifdef OTA - // #if (defined(ARDUINO_ARCH_ESP32) || defined(ESP8266)) void setupOTA(void) { - ArduinoOTA.begin(Ethernet.localIP(), "Lighthub", "password", InternalStorage, sysConfStream, JSONStream); ArduinoOTA.setCustomHandler(httpHandler); infoSerial<