diff --git a/ConfigSettings.h b/ConfigSettings.h index e7a4a89..61267d2 100644 --- a/ConfigSettings.h +++ b/ConfigSettings.h @@ -3,7 +3,7 @@ #ifndef configsettings_h #define configsettings_h -#define FW_VERSION "v1.4.3" +#define FW_VERSION "v1.4.4" enum DeviceStatus { DS_OK = 0, DS_ERROR = 1, diff --git a/Somfy.cpp b/Somfy.cpp index e3328c8..90c26e3 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -25,7 +25,7 @@ uint8_t rxmode = 0; // Indicates whether the radio is in receive mode. Just to #endif #define SETMY_REPEATS 15 -#define TILT_REPEATS 7 +#define TILT_REPEATS 15 int sort_asc(const void *cmp1, const void *cmp2) { int a = *((uint8_t *)cmp1); @@ -137,12 +137,14 @@ void somfy_frame_t::decodeFrame(byte* frame) { case somfy_commands::Prog: case somfy_commands::SunFlag: case somfy_commands::Flag: - case somfy_commands::StepUp: case somfy_commands::UnknownC: case somfy_commands::UnknownD: case somfy_commands::UnknownE: case somfy_commands::UnknownF: + break; + case somfy_commands::StepUp: case somfy_commands::StepDown: + // These must be 80 bit commands break; default: this->valid = false; @@ -1812,8 +1814,11 @@ void Transceiver::emitFrame(somfy_frame_t *frame, somfy_rx_t *rx) { evt.appendMessage(buf); snprintf(buf, sizeof(buf), "\"bits\":%d,", rx->bit_length); evt.appendMessage(buf); + snprintf(buf, sizeof(buf), "\"valid\":%s,", frame->valid ? "true" : "false"); + evt.appendMessage(buf); snprintf(buf, sizeof(buf), "\"sync\":%d,\"pulses\":[", frame->hwsync); evt.appendMessage(buf); + if(rx) { for(uint16_t i = 0; i < rx->pulseCount; i++) { snprintf(buf, sizeof(buf), "%s%d", i != 0 ? "," : "", rx->pulses[i]); @@ -1969,6 +1974,7 @@ void transceiver_config_t::save() { pref.putFloat("rxBandwidth", this->rxBandwidth); // float pref.putBool("enabled", this->enabled); pref.putBool("radioInit", true); + pref.putChar("txPower", this->txPower); /* pref.putBool("internalCCMode", this->internalCCMode); @@ -2061,6 +2067,10 @@ void transceiver_config_t::apply() { if(!radioInit) return; Serial.print("Applying radio settings "); Serial.printf("Setting Data Pins RX:%u TX:%u\n", this->RXPin, this->TXPin); + //if(this->TXPin != this->RXPin) + // pinMode(this->TXPin, OUTPUT); + //pinMode(this->RXPin, INPUT); + // Essentially these call only preform the two functions above. if(this->TXPin == this->RXPin) ELECHOUSE_cc1101.setGDO0(this->TXPin); // This pin may be shared. else diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index 2e2454c..1270612 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index 4bff626..babfd37 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ diff --git a/Web.cpp b/Web.cpp index 51befde..e8a732f 100644 --- a/Web.cpp +++ b/Web.cpp @@ -905,7 +905,10 @@ void Web::begin() { server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Shade not found to pair\"}")); } else { - shade->sendCommand(somfy_commands::Prog, 7); + if(shade->bitLength == 56) + shade->sendCommand(somfy_commands::Prog, 7); + else + shade->sendCommand(somfy_commands::Prog, 1); shade->paired = true; shade->save(); DynamicJsonDocument doc(512); @@ -951,7 +954,10 @@ void Web::begin() { server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Shade not found to unpair\"}")); } else { - shade->sendCommand(somfy_commands::Prog, 7); + if(shade->bitLength == 56) + shade->sendCommand(somfy_commands::Prog, 7); + else + shade->sendCommand(somfy_commands::Prog, 1); shade->paired = false; shade->save(); DynamicJsonDocument doc(512); diff --git a/data/appversion b/data/appversion index 3c80e4f..e1df5de 100644 --- a/data/appversion +++ b/data/appversion @@ -1 +1 @@ -1.4.3 \ No newline at end of file +1.4.4 \ No newline at end of file diff --git a/data/index.html b/data/index.html index 6f449aa..05dcb2b 100644 --- a/data/index.html +++ b/data/index.html @@ -3,10 +3,10 @@
- - + + - +