diff --git a/.drone.yml b/.drone.yml index 7c238b1..8fe9ac6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,9 +15,6 @@ steps: - pio run -e pro-mini - echo -n 'reset' > /dev/ttyUSB0; sleep 1s; avrdude -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:.pio/build/pro-mini/firmware.hex:i -v - service ser2net start - when: - target: - - production trigger: branch: diff --git a/gateway/src/gateway.cpp b/gateway/src/gateway.cpp index d819824..b291c5a 100644 --- a/gateway/src/gateway.cpp +++ b/gateway/src/gateway.cpp @@ -128,6 +128,9 @@ void runJsonCommand(String cmd) { mySwitch.send(rcSwitch["value"]); // Serial.println((const char*)rcSwitch["value"]); } + char output[256]; + serializeJson(jsonDoc, output); + Serial.println(output); blink(); } else { Serial.println(err.c_str()); @@ -148,8 +151,6 @@ void readCommand() { if (cmd.endsWith(",")) { cmd = cmd.substring(0, cmd.lastIndexOf(',')); } - cmd = "[" + cmd + "]"; - Serial.println(cmd); - runJsonCommand(cmd); + runJsonCommand("[" + cmd + "]"); } }