Increase WiFi passphrase length to 63 + terminator. #13

This commit is contained in:
Robert Strouse 2023-04-04 13:00:18 -07:00
parent 9b8a952db9
commit b1b8d1be46
5 changed files with 8 additions and 14 deletions

View file

@ -40,7 +40,7 @@ class WifiSettings: BaseSettings {
WifiSettings(); WifiSettings();
// char hostname[32] = "ESPSomfyRTS"; // char hostname[32] = "ESPSomfyRTS";
char ssid[64] = ""; char ssid[64] = "";
char passphrase[32] = ""; char passphrase[64] = "";
//bool ssdpBroadcast = true; //bool ssdpBroadcast = true;
bool begin(); bool begin();
bool fromJSON(JsonObject &obj); bool fromJSON(JsonObject &obj);

View file

@ -1710,7 +1710,7 @@ void RECEIVE_ATTR Transceiver::handleReceive() {
// We need to ignore this bit. // We need to ignore this bit.
// REMOVE THIS AFTER WE DETERMINE THAT THE out-of-bounds stuff isn't a problem. If there are bits // REMOVE THIS AFTER WE DETERMINE THAT THE out-of-bounds stuff isn't a problem. If there are bits
// from the previous frame then we will capture this data here. // from the previous frame then we will capture this data here.
if(somfy_rx.pulseCount < MAX_TIMINGS) somfy_rx.pulses[somfy_rx.pulseCount++] = duration; if(somfy_rx.pulseCount < MAX_TIMINGS && somfy_rx.cpt_synchro_hw > 0) somfy_rx.pulses[somfy_rx.pulseCount++] = duration;
return; return;
} }
last_time = time; last_time = time;
@ -1740,24 +1740,18 @@ void RECEIVE_ATTR Transceiver::handleReceive() {
else { else {
// Reset and start looking for hardware sync again. // Reset and start looking for hardware sync again.
somfy_rx.cpt_synchro_hw = 0; somfy_rx.cpt_synchro_hw = 0;
//somfy_rx.pulseCount = 0;
// Try to capture the wakeup pulse. // Try to capture the wakeup pulse.
if(duration > tempo_wakeup_min && duration < tempo_wakeup_max) if(duration > tempo_wakeup_min && duration < tempo_wakeup_max)
{ {
memset(&somfy_rx.payload, 0x00, sizeof(somfy_rx.payload)); memset(&somfy_rx.payload, 0x00, sizeof(somfy_rx.payload));
//somfy_rx.pulseCount = 1;
somfy_rx.cpt_synchro_hw = 0;
somfy_rx.previous_bit = 0x00; somfy_rx.previous_bit = 0x00;
somfy_rx.waiting_half_symbol = false; somfy_rx.waiting_half_symbol = false;
somfy_rx.cpt_bits = 0; somfy_rx.cpt_bits = 0;
somfy_rx.bit_length = 56; somfy_rx.bit_length = 56;
} }
else if(duration > tempo_wakeup_silence_max) { else if((somfy_rx.pulseCount > 10 && somfy_rx.cpt_synchro_hw == 0) || duration > 150000) {
somfy_rx.pulseCount = 0; somfy_rx.pulseCount = 0;
} }
//else {
// somfy_rx.pulseCount = 0;
//}
} }
break; break;
case receiving_data: case receiving_data:

Binary file not shown.

View file

@ -905,10 +905,10 @@ void Web::begin() {
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Shade not found to pair\"}")); server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Shade not found to pair\"}"));
} }
else { else {
if(shade->bitLength == 56) //if(shade->bitLength == 56)
shade->sendCommand(somfy_commands::Prog, 7); shade->sendCommand(somfy_commands::Prog, 4);
else //else
shade->sendCommand(somfy_commands::Prog, 1); // shade->sendCommand(somfy_commands::Prog, 1);
shade->paired = true; shade->paired = true;
shade->save(); shade->save();
DynamicJsonDocument doc(512); DynamicJsonDocument doc(512);

View file

@ -880,7 +880,7 @@ class Wifi {
document.getElementById('spanNetworkChannel').innerHTML = isNaN(strength.channel) || strength.channel < 0 ? '--' : strength.channel; document.getElementById('spanNetworkChannel').innerHTML = isNaN(strength.channel) || strength.channel < 0 ? '--' : strength.channel;
let cssClass = 'waveStrength-' + ((isNaN(strength.strength) || strength > 0) ? -100 : this.calcWaveStrength(strength.strength)); let cssClass = 'waveStrength-' + ((isNaN(strength.strength) || strength > 0) ? -100 : this.calcWaveStrength(strength.strength));
let elWave = document.getElementById('divNetworkStrength').children[0]; let elWave = document.getElementById('divNetworkStrength').children[0];
if (!elWave.classList.contains(cssClass)) { if (typeof elWave !== 'undefined' && !elWave.classList.contains(cssClass)) {
elWave.classList.remove('waveStrength-0', 'waveStrength-1', 'waveStrength-2', 'waveStrength-3', 'waveStrength-4'); elWave.classList.remove('waveStrength-0', 'waveStrength-1', 'waveStrength-2', 'waveStrength-3', 'waveStrength-4');
elWave.classList.add(cssClass); elWave.classList.add(cssClass);
} }