- This button resets the access point settings.
- The ESP will restart and start the "WiFi Configuration Manager".
- Connect to it's access point and configure your WiFi (just like the first configuration).
-
-
-
-
-
-
-
-
-
-
+
+
Reset WiFi Config:
+
+ This button resets the access point settings.
+ The ESP will restart and start the "WiFi Configuration Manager".
+ Connect to it's access point and configure your WiFi (just like the first configuration).
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.cpp b/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.cpp
index a47c1bf6..d9ee3a2c 100644
--- a/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.cpp
+++ b/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.cpp
@@ -1,17 +1,14 @@
#include "BWC_8266_4w.h"
void CIO::begin() {
- //Setup serial to CIO and DSP here according to my PCB
+ //Setup serial to CIO and DSP here according to chosen PCB.
/*
- CIO_RX = D3
- CIO_TX = D2
- DSP_TX = D6
- DSP_RX = D7
Devices are sending on their TX lines, so we read that with RX pins on the ESP
+ Hence the "backwards" parameters
*/
- cio_serial.begin(9600, SWSERIAL_8N1, D2, D3, false, 63);
+ cio_serial.begin(9600, SWSERIAL_8N1, CIO_TX, CIO_RX, false, 63);
cio_serial.setTimeout(20);
- dsp_serial.begin(9600, SWSERIAL_8N1, D6, D7, false, 63);
+ dsp_serial.begin(9600, SWSERIAL_8N1, DSP_TX, DSP_RX, false, 63);
dsp_serial.setTimeout(20);
states[TARGET] = 20;
@@ -22,8 +19,8 @@ void CIO::begin() {
states[CHAR1] = ' ';
states[CHAR2] = ' ';
states[CHAR3] = ' ';
- cio_tx = false;
- dsp_tx = false;
+ cio_tx_ok = false;
+ dsp_tx_ok = false;
}
void CIO::loop(void) {
@@ -46,7 +43,7 @@ void CIO::loop(void) {
}
states[TEMPERATURE] = from_CIO_buf[TEMPINDEX];
states[ERROR] = from_CIO_buf[ERRORINDEX];
- cio_tx = true; //show the user that this line works (appears to work)
+ cio_tx_ok = true; //show the user that this line works (appears to work)
//check if cio send error msg
states[CHAR1] = ' ';
states[CHAR2] = ' ';
@@ -102,7 +99,7 @@ void CIO::loop(void) {
} else {
updateStates();
}
- dsp_tx = true; //show the user that this line works (appears to work)
+ dsp_tx_ok = true; //show the user that this line works (appears to work)
}
} else
{
@@ -172,15 +169,11 @@ void CIO::updatePayload(){
void BWC::begin(void){
- _cio.begin();
- //_startNTP(); this is done from main.cpp
- LittleFS.begin();
- _loadSettings();
- _loadCommandQueue();
- _saveRebootInfo();
- saveSettingsTimer.attach(3600.0, std::bind(&BWC::saveSettingsFlag, this));
- cio_tx = false;
- dsp_tx = false;
+ _cio.begin();
+ //_startNTP(); this is done from main.cpp
+ LittleFS.begin();
+ cio_tx_ok = false;
+ dsp_tx_ok = false;
_cltime = 0;
_ftime = 0;
_uptime = 0;
@@ -199,6 +192,10 @@ void BWC::begin(void){
_tttt_time1 = DateTime.now();
_tttt_temp0 = 20;
_tttt_temp1 = 20;
+ _loadSettings();
+ _loadCommandQueue();
+ _saveRebootInfo();
+ saveSettingsTimer.attach(3600.0, std::bind(&BWC::saveSettingsFlag, this));
}
void BWC::loop(){
@@ -217,69 +214,69 @@ void BWC::loop(){
if(_saveCmdqNeeded) _saveCommandQueue();
if(_saveSettingsNeeded) saveSettings();
ESP.wdtEnable(0);
- cio_tx = _cio.cio_tx;
- dsp_tx = _cio.dsp_tx;
+ cio_tx_ok = _cio.cio_tx_ok;
+ dsp_tx_ok = _cio.dsp_tx_ok;
}
bool BWC::qCommand(uint32_t cmd, uint32_t val, uint32_t xtime, uint32_t interval) {
- //handle special commands
- if(cmd == RESETQ){
- _qButtonLen = 0;
- _qCommandLen = 0;
- _saveCommandQueue();
- return true;
- }
-
- //add parameters to _commandQ[rows][parameter columns] and sort the array on xtime.
- int row = _qCommandLen;
- if (_qCommandLen == MAXCOMMANDS) return false;
- //sort array on xtime
- for (int i = 0; i < _qCommandLen; i++) {
- if (xtime < _commandQ[i][2]){
- //insert row at [i]
- row = i;
- break;
- }
- }
- //make room for new row
- for (int i = _qCommandLen; i > (row); i--){
- _commandQ[i][0] = _commandQ[i-1][0];
- _commandQ[i][1] = _commandQ[i-1][1];
- _commandQ[i][2] = _commandQ[i-1][2];
- _commandQ[i][3] = _commandQ[i-1][3];
- }
- //add new command
- _commandQ[row][0] = cmd;
- _commandQ[row][1] = val;
- _commandQ[row][2] = xtime;
- _commandQ[row][3] = interval;
- _qCommandLen++;
- delay(0);
- _saveCommandQueue();
- return true;
+ //handle special commands
+ if(cmd == RESETQ){
+ _qButtonLen = 0;
+ _qCommandLen = 0;
+ _saveCommandQueue();
+ return true;
+ }
+
+ //add parameters to _commandQ[rows][parameter columns] and sort the array on xtime.
+ int row = _qCommandLen;
+ if (_qCommandLen == MAXCOMMANDS) return false;
+ //sort array on xtime
+ for (int i = 0; i < _qCommandLen; i++) {
+ if (xtime < _commandQ[i][2]){
+ //insert row at [i]
+ row = i;
+ break;
+ }
+ }
+ //make room for new row
+ for (int i = _qCommandLen; i > (row); i--){
+ _commandQ[i][0] = _commandQ[i-1][0];
+ _commandQ[i][1] = _commandQ[i-1][1];
+ _commandQ[i][2] = _commandQ[i-1][2];
+ _commandQ[i][3] = _commandQ[i-1][3];
+ }
+ //add new command
+ _commandQ[row][0] = cmd;
+ _commandQ[row][1] = val;
+ _commandQ[row][2] = xtime;
+ _commandQ[row][3] = interval;
+ _qCommandLen++;
+ delay(0);
+ _saveCommandQueue();
+ return true;
}
void BWC::_handleCommandQ(void) {
- bool restartESP = false;
- if(_qCommandLen > 0) {
- //cmp time with xtime. If more, then execute (adding buttons to buttonQ).
-
- if (_timestamp >= _commandQ[0][2]){
- switch (_commandQ[0][0]) {
-
- case SETTARGET:
- _cio.states[TARGET] = _commandQ[0][1];
+ bool restartESP = false;
+ if(_qCommandLen > 0) {
+ //cmp time with xtime. If more, then execute (adding buttons to buttonQ).
+
+ if (_timestamp >= _commandQ[0][2]){
+ switch (_commandQ[0][0]) {
+
+ case SETTARGET:
+ _cio.states[TARGET] = _commandQ[0][1];
_cio.dataAvailable = true;
if(_cio.states[TARGET] > 40) _cio.states[TARGET] = 40; //don't cook anyone
- break;
+ break;
- case SETUNIT:
+ case SETUNIT:
_cio.states[UNITSTATE] = _commandQ[0][1];
_cio.dataAvailable = true;
- break;
+ break;
- case SETBUBBLES:
+ case SETBUBBLES:
if(_cio.states[BUBBLESSTATE] == _commandQ[0][1]) break; //no change required
_cio.dataAvailable = true;
_currentStateIndex = JUMPTABLE[_currentStateIndex][BUBBLETOGGLE];
@@ -291,7 +288,7 @@ void BWC::_handleCommandQ(void) {
if(ALLOWEDSTATES[_currentStateIndex][3] == 2) {
qCommand(SETFULLPOWER, 1, _timestamp + 10, 0);
}
- // _cio.states[BUBBLESSTATE] = _commandQ[0][1];
+ // _cio.states[BUBBLESSTATE] = _commandQ[0][1];
// if(_commandQ[0][1]){
// //bubbles is turned on. Limit H1, H2 and pump according to matrix
// _cio.states[PUMPSTATE] = _cio.states[PUMPSTATE] && (COMB_MATRIX & 1<<1);
@@ -305,9 +302,9 @@ void BWC::_handleCommandQ(void) {
// //bubbles is turned off
// _cio.heatbitmask = HEATBITMASK1 | HEATBITMASK2; //set full heating power
// }
- break;
+ break;
- case SETHEATER:
+ case SETHEATER:
if(_cio.states[HEATSTATE] == _commandQ[0][1]) break; //no change required
_cio.dataAvailable = true;
_currentStateIndex = JUMPTABLE[_currentStateIndex][HEATTOGGLE];
@@ -320,7 +317,7 @@ void BWC::_handleCommandQ(void) {
qCommand(SETFULLPOWER, 1, _timestamp + 10, 0);
}
- // _cio.states[HEATSTATE] = _commandQ[0][1];
+ // _cio.states[HEATSTATE] = _commandQ[0][1];
// if(_commandQ[0][1]) {
// if(_commandQ[0][1] == 1) {
// //start first heater element
@@ -342,9 +339,9 @@ void BWC::_handleCommandQ(void) {
// _cio.states[JETSSTATE] &= _cio.states[JETSSTATE] && (COMB_MATRIX & 1<<4);
// }
// }
- break;
+ break;
- case SETPUMP:
+ case SETPUMP:
if(_cio.states[PUMPSTATE] == _commandQ[0][1]) break; //no change required
//let pump run a bit to cool element
_cio.dataAvailable = true;
@@ -362,44 +359,44 @@ void BWC::_handleCommandQ(void) {
qCommand(SETFULLPOWER, 1, _timestamp + 10, 0);
}
}
- break;
+ break;
- case REBOOTESP:
- restartESP = true;
- break;
+ case REBOOTESP:
+ restartESP = true;
+ break;
- case GETTARGET:
-
- break;
+ case GETTARGET:
+
+ break;
- case RESETTIMES:
- _uptime = 0;
- _pumptime = 0;
- _heatingtime = 0;
- _airtime = 0;
+ case RESETTIMES:
+ _uptime = 0;
+ _pumptime = 0;
+ _heatingtime = 0;
+ _airtime = 0;
_jettime = 0;
- _uptime_ms = 0;
- _pumptime_ms = 0;
- _heatingtime_ms = 0;
- _airtime_ms = 0;
+ _uptime_ms = 0;
+ _pumptime_ms = 0;
+ _heatingtime_ms = 0;
+ _airtime_ms = 0;
_jettime_ms = 0;
- _cost = 0;
+ _cost = 0;
_kwh = 0;
- _saveSettingsNeeded = true;
+ _saveSettingsNeeded = true;
_cio.dataAvailable = true;
- break;
+ break;
- case RESETCLTIMER:
- _cltime = _timestamp;
- _saveSettingsNeeded = true;
+ case RESETCLTIMER:
+ _cltime = _timestamp;
+ _saveSettingsNeeded = true;
_cio.dataAvailable = true;
- break;
+ break;
- case RESETFTIMER:
- _ftime = _timestamp;
- _saveSettingsNeeded = true;
+ case RESETFTIMER:
+ _ftime = _timestamp;
+ _saveSettingsNeeded = true;
_cio.dataAvailable = true;
- break;
+ break;
case SETJETS:
if(_cio.states[JETSSTATE] == _commandQ[0][1]) break; //no change required
@@ -432,26 +429,29 @@ void BWC::_handleCommandQ(void) {
else
_cio.heatbitmask = HEATBITMASK1;
break;
- }
- //If interval > 0 then append to commandQ with updated xtime.
- if(_commandQ[0][3] > 0) qCommand(_commandQ[0][0],_commandQ[0][1],_commandQ[0][2]+_commandQ[0][3],_commandQ[0][3]);
- //remove from commandQ and decrease qCommandLen
- for(int i = 0; i < _qCommandLen-1; i++){
- _commandQ[i][0] = _commandQ[i+1][0];
- _commandQ[i][1] = _commandQ[i+1][1];
- _commandQ[i][2] = _commandQ[i+1][2];
- _commandQ[i][3] = _commandQ[i+1][3];
- }
- _qCommandLen--;
- _saveCommandQueue();
- if(restartESP) {
- saveSettings();
- ESP.restart();
- }
- }
- }
+ }
+ //If interval > 0 then append to commandQ with updated xtime.
+ if(_commandQ[0][3] > 0) qCommand(_commandQ[0][0],_commandQ[0][1],_commandQ[0][2]+_commandQ[0][3],_commandQ[0][3]);
+ //remove from commandQ and decrease qCommandLen
+ for(int i = 0; i < _qCommandLen-1; i++){
+ _commandQ[i][0] = _commandQ[i+1][0];
+ _commandQ[i][1] = _commandQ[i+1][1];
+ _commandQ[i][2] = _commandQ[i+1][2];
+ _commandQ[i][3] = _commandQ[i+1][3];
+ }
+ _qCommandLen--;
+ _saveCommandQueue();
+ if(restartESP) {
+ Serial.println("saving settings");
+ saveSettings();
+ delay(3000);
+ Serial.println("restarting");
+ ESP.restart();
+ }
+ }
+ }
}
-
+
String BWC::getJSONStates() {
// Allocate a temporary JsonDocument
@@ -484,8 +484,8 @@ String BWC::getJSONStates() {
String jsonmsg;
if (serializeJson(doc, jsonmsg) == 0) {
jsonmsg = "{\"error\": \"Failed to serialize message\"}";
- }
- return jsonmsg;
+ }
+ return jsonmsg;
}
String BWC::getJSONTimes() {
@@ -516,8 +516,8 @@ String BWC::getJSONTimes() {
String jsonmsg;
if (serializeJson(doc, jsonmsg) == 0) {
jsonmsg = "{\"error\": \"Failed to serialize message\"}";
- }
- return jsonmsg;
+ }
+ return jsonmsg;
}
String BWC::getJSONSettings(){
@@ -537,13 +537,13 @@ String BWC::getJSONSettings(){
doc["AUDIO"] = _audio;
doc["REBOOTINFO"] = ESP.getResetReason();
doc["REBOOTTIME"] = DateTime.getBootTime();
-
+
// Serialize JSON to string
String jsonmsg;
if (serializeJson(doc, jsonmsg) == 0) {
jsonmsg = "{\"error\": \"Failed to serialize message\"}";
- }
- return jsonmsg;
+ }
+ return jsonmsg;
}
void BWC::setJSONSettings(String message){
@@ -567,7 +567,7 @@ void BWC::setJSONSettings(String message){
_finterval = doc["FINT"];
_clinterval = doc["CLINT"];
_audio = doc["AUDIO"];
- saveSettings();
+ saveSettings();
}
String BWC::getJSONCommandQueue(){
@@ -580,10 +580,10 @@ String BWC::getJSONCommandQueue(){
// Set the values in the document
doc["LEN"] = _qCommandLen;
for(int i = 0; i < _qCommandLen; i++){
- doc["CMD"][i] = _commandQ[i][0];
- doc["VALUE"][i] = _commandQ[i][1];
- doc["XTIME"][i] = _commandQ[i][2];
- doc["INTERVAL"][i] = _commandQ[i][3];
+ doc["CMD"][i] = _commandQ[i][0];
+ doc["VALUE"][i] = _commandQ[i][1];
+ doc["XTIME"][i] = _commandQ[i][2];
+ doc["INTERVAL"][i] = _commandQ[i][3];
}
// Serialize JSON to file
@@ -626,16 +626,16 @@ String BWC::getSerialBuffers(){
String json;
if (serializeJson(doc, json) == 0) {
json = "{\"error\": \"Failed to serialize message\"}";
- }
- return json;
+ }
+ return json;
}
bool BWC::newData(){
bool result = _cio.dataAvailable;
_cio.dataAvailable = false;
- return result;
+ return result;
}
-
+
void BWC::_startNTP() {
// setup this after wifi connected
// you can use custom timezone,server and timeout
@@ -693,11 +693,11 @@ void BWC::_loadSettings(){
}
void BWC::saveSettingsFlag(){
- //ticker fails if duration is more than 71 min. So we use a counter every 60 minutes
- if(++_tickerCount >= 3){
- _saveSettingsNeeded = true;
- _tickerCount = 0;
- }
+ //ticker fails if duration is more than 71 min. So we use a counter every 60 minutes
+ if(++_tickerCount >= 3){
+ _saveSettingsNeeded = true;
+ _tickerCount = 0;
+ }
}
void BWC::saveSettings(){
@@ -715,15 +715,15 @@ void BWC::saveSettings(){
// Don't forget to change the capacity to match your requirements.
// Use arduinojson.org/assistant to compute the capacity.
DynamicJsonDocument doc(1024);
- _heatingtime += _heatingtime_ms/1000;
- _pumptime += _pumptime_ms/1000;
- _airtime += _airtime_ms/1000;
+ _heatingtime += _heatingtime_ms/1000;
+ _pumptime += _pumptime_ms/1000;
+ _airtime += _airtime_ms/1000;
_jettime += _jettime_ms/1000;
- _uptime += _uptime_ms/1000;
- _heatingtime_ms = 0;
- _pumptime_ms = 0;
- _airtime_ms = 0;
- _uptime_ms = 0;
+ _uptime += _uptime_ms/1000;
+ _heatingtime_ms = 0;
+ _pumptime_ms = 0;
+ _airtime_ms = 0;
+ _uptime_ms = 0;
// Set the values in the document
doc["CLTIME"] = _cltime;
doc["FTIME"] = _ftime;
@@ -774,13 +774,13 @@ void BWC::_loadCommandQueue(){
// Set the values in the variables
_qCommandLen = doc["LEN"];
for(int i = 0; i < _qCommandLen; i++){
- _commandQ[i][0] = doc["CMD"][i];
- _commandQ[i][1] = doc["VALUE"][i];
- _commandQ[i][2] = doc["XTIME"][i];
- _commandQ[i][3] = doc["INTERVAL"][i];
+ _commandQ[i][0] = doc["CMD"][i];
+ _commandQ[i][1] = doc["VALUE"][i];
+ _commandQ[i][2] = doc["XTIME"][i];
+ _commandQ[i][3] = doc["INTERVAL"][i];
}
- file.close();
+ file.close();
}
void BWC::_saveCommandQueue(){
@@ -803,17 +803,17 @@ void BWC::_saveCommandQueue(){
// Set the values in the document
doc["LEN"] = _qCommandLen;
for(int i = 0; i < _qCommandLen; i++){
- doc["CMD"][i] = _commandQ[i][0];
- doc["VALUE"][i] = _commandQ[i][1];
- doc["XTIME"][i] = _commandQ[i][2];
- doc["INTERVAL"][i] = _commandQ[i][3];
+ doc["CMD"][i] = _commandQ[i][0];
+ doc["VALUE"][i] = _commandQ[i][1];
+ doc["XTIME"][i] = _commandQ[i][2];
+ doc["INTERVAL"][i] = _commandQ[i][3];
}
// Serialize JSON to file
if (serializeJson(doc, file) == 0) {
Serial.println(F("Failed to write cmdq.txt"));
}
- file.close();
+ file.close();
//revive the dog
ESP.wdtEnable(0);
@@ -837,7 +837,7 @@ void BWC::saveEventlog(){
// Set the values in the document
for(uint16_t i = 0; i < sizeof(_cio.states); i++){
- doc[i] = _cio.states[i];
+ doc[i] = _cio.states[i];
}
doc["timestamp"] = DateTime.format(DateFormatter::SIMPLE);
@@ -845,7 +845,7 @@ void BWC::saveEventlog(){
if (serializeJson(doc, file) == 0) {
Serial.println(F("Failed to write eventlog.txt"));
}
- file.close();
+ file.close();
//revive the dog
ESP.wdtEnable(0);
@@ -871,59 +871,59 @@ void BWC::_saveRebootInfo(){
Serial.println(F("Failed to write bootlog.txt"));
}
file.println();
- file.close();
+ file.close();
}
void BWC::_updateTimes(){
- uint32_t now = millis();
- static uint32_t prevtime;
- int elapsedtime = now-prevtime;
- prevtime = now;
- if (elapsedtime < 0) return; //millis() rollover every 49 days
- if(_cio.states[HEATREDSTATE]){
- _heatingtime_ms += elapsedtime;
- }
- if(_cio.states[PUMPSTATE]){
- _pumptime_ms += elapsedtime;
- }
- if(_cio.states[BUBBLESSTATE]){
- _airtime_ms += elapsedtime;
- }
- if(_cio.states[JETSSTATE]){
- _jettime_ms += elapsedtime;
- }
- _uptime_ms += elapsedtime;
-
- if(_uptime_ms > 1000000000){
- _heatingtime += _heatingtime_ms/1000;
- _pumptime += _pumptime_ms/1000;
- _airtime += _airtime_ms/1000;
+ uint32_t now = millis();
+ static uint32_t prevtime;
+ int elapsedtime = now-prevtime;
+ prevtime = now;
+ if (elapsedtime < 0) return; //millis() rollover every 49 days
+ if(_cio.states[HEATREDSTATE]){
+ _heatingtime_ms += elapsedtime;
+ }
+ if(_cio.states[PUMPSTATE]){
+ _pumptime_ms += elapsedtime;
+ }
+ if(_cio.states[BUBBLESSTATE]){
+ _airtime_ms += elapsedtime;
+ }
+ if(_cio.states[JETSSTATE]){
+ _jettime_ms += elapsedtime;
+ }
+ _uptime_ms += elapsedtime;
+
+ if(_uptime_ms > 1000000000){
+ _heatingtime += _heatingtime_ms/1000;
+ _pumptime += _pumptime_ms/1000;
+ _airtime += _airtime_ms/1000;
_jettime += _jettime_ms/1000;
- _uptime += _uptime_ms/1000;
- _heatingtime_ms = 0;
- _pumptime_ms = 0;
- _airtime_ms = 0;
+ _uptime += _uptime_ms/1000;
+ _heatingtime_ms = 0;
+ _pumptime_ms = 0;
+ _airtime_ms = 0;
_jettime_ms = 0;
- _uptime_ms = 0;
- }
-
- _kwh = HEATER_WATTS * (_heatingtime+_heatingtime_ms/1000) / 3600 +
+ _uptime_ms = 0;
+ }
+
+ _kwh = (HEATER_WATTS * (_heatingtime+_heatingtime_ms/1000) / 3600 +
PUMP_WATTS * (_pumptime+_pumptime_ms/1000) / 3600 +
BUBBLES_WATTS * (_airtime+_airtime_ms/1000) / 3600 +
JETS_WATTS * (_jettime+_jettime_ms/1000) / 3600 +
- IDLE_WATTS * (_uptime+_uptime_ms/1000) / 3600 /
+ IDLE_WATTS * (_uptime+_uptime_ms/1000) / 3600) /
1000.0; //Wh -> kWh
- _cost = _price*_kwh;
+ _cost = _price*_kwh;
}
void BWC::print(String txt){
}
uint8_t BWC::getState(int state){
- return _cio.states[state];
+ return _cio.states[state];
}
void BWC::reloadCommandQueue(){
- _loadCommandQueue();
- return;
+ _loadCommandQueue();
+ return;
}
\ No newline at end of file
diff --git a/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.h b/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.h
index 2819f17e..05e13114 100644
--- a/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.h
+++ b/Code/4-wire-version/lib/BWC4W/BWC_8266_4w.h
@@ -19,6 +19,18 @@
#include
#include
+#ifdef PCB_V2
+const int CIO_RX = D1;
+const int CIO_TX = D2;
+const int DSP_TX = D4;
+const int DSP_RX = D5;
+#else
+const int CIO_RX = D3;
+const int CIO_TX = D2;
+const int DSP_TX = D6;
+const int DSP_RX = D7;
+#endif
+
class CIO {
public:
@@ -37,8 +49,8 @@ class CIO {
uint8_t to_DSP_buf[7]; //ESP to DSP
uint8_t from_DSP_buf[7]; //DSP to ESP. We can ignore this message and send our own when ESP is in charge.
uint8_t to_CIO_buf[7]; //Otherwise copy here. Buffer to send from ESP to CIO
- bool cio_tx; //set to true when data received. Send to webinterface+serial for debugging
- bool dsp_tx; //set to true when data received. Send to webinterface+serial for debugging
+ bool cio_tx_ok; //set to true when data received. Send to webinterface+serial for debugging
+ bool dsp_tx_ok; //set to true when data received. Send to webinterface+serial for debugging
uint8_t heatbitmask;
@@ -55,77 +67,77 @@ class CIO {
class BWC {
public:
- void begin(void);
+ void begin(void);
void loop();
- bool qCommand(uint32_t cmd, uint32_t val, uint32_t xtime, uint32_t interval);
- bool newData();
- void saveEventlog();
- String getJSONStates();
- String getJSONTimes();
- String getJSONSettings();
- void setJSONSettings(String message);
- String getJSONCommandQueue();
- void print(String txt);
- uint8_t getState(int state);
- void saveSettingsFlag();
- void saveSettings();
- Ticker saveSettingsTimer;
- bool cio_tx;
- bool dsp_tx;
- void reloadCommandQueue();
- String encodeBufferToString(uint8_t buf[7]);
- String getSerialBuffers();
+ bool qCommand(uint32_t cmd, uint32_t val, uint32_t xtime, uint32_t interval);
+ bool newData();
+ void saveEventlog();
+ String getJSONStates();
+ String getJSONTimes();
+ String getJSONSettings();
+ void setJSONSettings(String message);
+ String getJSONCommandQueue();
+ void print(String txt);
+ uint8_t getState(int state);
+ void saveSettingsFlag();
+ void saveSettings();
+ Ticker saveSettingsTimer;
+ bool cio_tx_ok;
+ bool dsp_tx_ok;
+ void reloadCommandQueue();
+ String encodeBufferToString(uint8_t buf[7]);
+ String getSerialBuffers();
private:
CIO _cio;
- uint32_t _commandQ[MAXCOMMANDS][4];
- int _qCommandLen = 0; //length of commandQ
- uint32_t _buttonQ[MAXBUTTONS][4];
- int _qButtonLen = 0; //length of buttonQ
- uint32_t _timestamp;
- bool _newData = false;
- uint32_t _cltime;
- uint32_t _ftime;
- uint32_t _uptime;
- uint32_t _pumptime;
- uint32_t _heatingtime;
- uint32_t _airtime;
- uint32_t _jettime;
- uint32_t _uptime_ms;
- uint32_t _pumptime_ms;
- uint32_t _heatingtime_ms;
- uint32_t _airtime_ms;
- uint32_t _jettime_ms;
- int32_t _timezone;
- float _price;
- uint32_t _finterval;
- uint32_t _clinterval;
- uint32_t _audio;
- float _cost;
- float _kwh;
- bool _saveSettingsNeeded = false;
- bool _saveEventlogNeeded = false;
- bool _saveCmdqNeeded = false;
- int _latestTarget;
- int _tickerCount;
- bool _sliderPrio = true;
- uint8_t _currentStateIndex = 0;
- uint32_t _tttt_time0; //time at previous temperature change
- uint32_t _tttt_time1; //time at last temperature change
- int _tttt_temp0; //temp after previous change
- int _tttt_temp1; //temp after last change
- int _tttt; //time to target temperature after subtracting running time since last calculation
- int _tttt_calculated; //constant between calculations
-
- void _qButton(uint32_t btn, uint32_t state, uint32_t value, uint32_t maxduration);
- void _handleCommandQ(void);
- void _handleButtonQ(void);
- void _startNTP();
- void _loadSettings();
- void _loadCommandQueue();
- void _saveCommandQueue();
- void _saveRebootInfo();
- void _updateTimes();
+ uint32_t _commandQ[MAXCOMMANDS][4];
+ int _qCommandLen = 0; //length of commandQ
+ uint32_t _buttonQ[MAXBUTTONS][4];
+ int _qButtonLen = 0; //length of buttonQ
+ uint32_t _timestamp;
+ bool _newData = false;
+ uint32_t _cltime;
+ uint32_t _ftime;
+ uint32_t _uptime;
+ uint32_t _pumptime;
+ uint32_t _heatingtime;
+ uint32_t _airtime;
+ uint32_t _jettime;
+ uint32_t _uptime_ms;
+ uint32_t _pumptime_ms;
+ uint32_t _heatingtime_ms;
+ uint32_t _airtime_ms;
+ uint32_t _jettime_ms;
+ int32_t _timezone;
+ float _price;
+ uint32_t _finterval;
+ uint32_t _clinterval;
+ uint32_t _audio;
+ float _cost;
+ float _kwh;
+ bool _saveSettingsNeeded = false;
+ bool _saveEventlogNeeded = false;
+ bool _saveCmdqNeeded = false;
+ int _latestTarget;
+ int _tickerCount;
+ bool _sliderPrio = true;
+ uint8_t _currentStateIndex = 0;
+ uint32_t _tttt_time0; //time at previous temperature change
+ uint32_t _tttt_time1; //time at last temperature change
+ int _tttt_temp0; //temp after previous change
+ int _tttt_temp1; //temp after last change
+ int _tttt; //time to target temperature after subtracting running time since last calculation
+ int _tttt_calculated; //constant between calculations
+
+ void _qButton(uint32_t btn, uint32_t state, uint32_t value, uint32_t maxduration);
+ void _handleCommandQ(void);
+ void _handleButtonQ(void);
+ void _startNTP();
+ void _loadSettings();
+ void _loadCommandQueue();
+ void _saveCommandQueue();
+ void _saveRebootInfo();
+ void _updateTimes();
};
#endif
diff --git a/Code/4-wire-version/lib/BWC4W/BWC_8266_4w_globals.h b/Code/4-wire-version/lib/BWC4W/BWC_8266_4w_globals.h
index 9ece82ee..fa3fa0d8 100644
--- a/Code/4-wire-version/lib/BWC4W/BWC_8266_4w_globals.h
+++ b/Code/4-wire-version/lib/BWC4W/BWC_8266_4w_globals.h
@@ -2,11 +2,11 @@
#define BWC_8266_4W_GLOBALS_H
#include
//Commands to CIO
-// 130 = bubbles
-// 133 = filter pump
-// 136 = Jets
-// 138 = Jets and bubbles
-// 181 = heating both elements with filter pump
+// 130 = bubbles
+// 133 = filter pump
+// 136 = Jets
+// 138 = Jets and bubbles
+// 181 = heating both elements with filter pump
//only declarations here please! Definitions belong in the cpp-file
@@ -14,48 +14,48 @@
enum States: byte
{
- LOCKEDSTATE,
- POWERSTATE,
- UNITSTATE,
- BUBBLESSTATE,
- HEATGRNSTATE,
- HEATREDSTATE,
- HEATSTATE,
- PUMPSTATE,
- TEMPERATURE,
- TARGET,
- CHAR1,
- CHAR2,
- CHAR3,
- JETSSTATE,
- ERROR
+ LOCKEDSTATE,
+ POWERSTATE,
+ UNITSTATE,
+ BUBBLESSTATE,
+ HEATGRNSTATE,
+ HEATREDSTATE,
+ HEATSTATE,
+ PUMPSTATE,
+ TEMPERATURE,
+ TARGET,
+ CHAR1,
+ CHAR2,
+ CHAR3,
+ JETSSTATE,
+ ERROR
};
enum Commands: byte
{
- SETTARGET,
- SETUNIT,
- SETBUBBLES,
- SETHEATER,
- SETPUMP,
- RESETQ,
- REBOOTESP,
- GETTARGET,
- RESETTIMES,
- RESETCLTIMER,
- RESETFTIMER,
- SETJETS,
- SETGODMODE,
- SETFULLPOWER
+ SETTARGET,
+ SETUNIT,
+ SETBUBBLES,
+ SETHEATER,
+ SETPUMP,
+ RESETQ,
+ REBOOTESP,
+ GETTARGET,
+ RESETTIMES,
+ RESETCLTIMER,
+ RESETFTIMER,
+ SETJETS,
+ SETGODMODE,
+ SETFULLPOWER
};
enum ToggleButtons: byte
{
- BUBBLETOGGLE,
- JETSTOGGLE,
- PUMPTOGGLE,
- HEATTOGGLE
+ BUBBLETOGGLE,
+ JETSTOGGLE,
+ PUMPTOGGLE,
+ HEATTOGGLE
};
const int MAXCOMMANDS = 11;
@@ -69,42 +69,42 @@ const int JETS_WATTS = 800;
#ifdef NO54173
/*combination matrix
- Heater1 Heater2 Bubbles Jets Pump
-H1 - 1 1 0 1
-H2 - 0 0 1
-B - 1 1
-J - 0
+ Heater1 Heater2 Bubbles Jets Pump
+H1 - 1 1 0 1
+H2 - 0 0 1
+B - 1 1
+J - 0
P
ten boolean values above stored in a word "comb_matrix"
Heater and pump values are still partly hardcoded in combination with the heatbitmasks.
Do not change the heatbitmasks below unless you really know what you are doing.
*/
-// const uint16_t COMB_MATRIX = 0x3CF; // B0000001111001111;
+// const uint16_t COMB_MATRIX = 0x3CF; // B0000001111001111;
//what row in allowedstates to go to when pressing Bubbles, Jets, Pump, Heat (columns in that order)
//Example: We are in state zero (first row). If we press Bubbles (first column) then there is a 6
//meaning current state (row) is now 6. According to ALLOWEDSTATES table, we turn on Bubbles and keep
//everything else off. (1,0,0,0)
const uint8_t JUMPTABLE[][4] = {
- {6,4,1,3},
- {7,4,0,3},
- {3,5,6,7},
- {2,4,0,1},
- {5,0,1,3},
- {4,6,1,3},
- {0,5,7,2},
- {1,5,6,2}
+ {6,4,1,3},
+ {7,4,0,3},
+ {3,5,6,7},
+ {2,4,0,1},
+ {5,0,1,3},
+ {4,6,1,3},
+ {0,5,7,2},
+ {1,5,6,2}
};
//Bubbles, Jets, Pump, Heat
const uint8_t ALLOWEDSTATES[][4] = {
- {0,0,0,0},
- {0,0,1,0},
- {1,0,1,1},
- {0,0,1,2}, //the "2" means both heater elements
- {0,1,0,0},
- {1,1,0,0},
- {1,0,0,0},
- {1,0,1,0}
+ {0,0,0,0},
+ {0,0,1,0},
+ {1,0,1,1},
+ {0,0,1,2}, //the "2" means both heater elements
+ {0,1,0,0},
+ {1,1,0,0},
+ {1,0,0,0},
+ {1,0,1,0}
};
//cio
@@ -117,12 +117,14 @@ const uint8_t DSP_CHECKSUMINDEX = 5;
const uint8_t PAYLOADSIZE = 7;
-const uint8_t PUMPBITMASK = B00000101; //5
-const uint8_t BUBBLESBITMASK = B00000010; //2
-const uint8_t JETSBITMASK = B00001000; //8
-const uint8_t HEATBITMASK1 = B00110000; //48 heater stage 1 = 50%
-const uint8_t HEATBITMASK2 = B01000000; //64 heater stage 2 = 100%
-const uint8_t POWERBITMASK = B10000000; //128
+const uint8_t PUMPBITMASK = B00000101; //5
+const uint8_t BUBBLESBITMASK = B00000010; //2
+const uint8_t JETSBITMASK = B00001000; //8
+const uint8_t HEATBITMASK1 = B00110000; //48 heater stage 1 = 50%
+const uint8_t HEATBITMASK2 = B01000000; //64 heater stage 2 = 100%
+const uint8_t POWERBITMASK = B10000000; //128
+const bool HASJETS = true;
+const String MYMODEL = "NO54173";
#endif
#ifdef NO54138
@@ -132,19 +134,19 @@ const uint8_t POWERBITMASK = B10000000; //128
//meaning current state (row) is now 6. According to ALLOWEDSTATES table, we turn on Bubbles and keep
//everything else off. (1,0,0,0)
const uint8_t JUMPTABLE[][4] = {
- {1,2,3,4},
- {0,2,3,4},
- {1,0,3,4},
- {1,2,0,4},
- {1,2,0,3}
+ {1,2,3,4},
+ {0,2,3,4},
+ {1,0,3,4},
+ {1,2,0,4},
+ {1,2,0,3}
};
//Bubbles, Jets, Pump, Heat
const uint8_t ALLOWEDSTATES[][4] = {
- {0,0,0,0},
- {1,0,0,0},
- {0,1,0,0},
- {0,0,1,0},
- {0,0,1,2} //the "2" means both heater elements
+ {0,0,0,0},
+ {1,0,0,0},
+ {0,1,0,0},
+ {0,0,1,0},
+ {0,0,1,2} //the "2" means both heater elements
};
//cio
@@ -157,16 +159,18 @@ const uint8_t DSP_CHECKSUMINDEX = 5;
const uint8_t PAYLOADSIZE = 7;
-const uint8_t PUMPBITMASK = B00000101; //5
-const uint8_t BUBBLESBITMASK = B00000010; //2
-const uint8_t JETSBITMASK = B00001000; //8
-const uint8_t HEATBITMASK1 = B00000000; //0 heater stage 1 = off
-const uint8_t HEATBITMASK2 = B00110000; //48 heater stage 2 = on
+const uint8_t PUMPBITMASK = B00000101; //5
+const uint8_t BUBBLESBITMASK = B00000010; //2
+const uint8_t JETSBITMASK = B00001000; //8
+const uint8_t HEATBITMASK1 = B00000000; //0 heater stage 1 = off
+const uint8_t HEATBITMASK2 = B00110000; //48 heater stage 2 = on
//lines below should be tested. It would be consistent with 54173 model.
//If heating is slow this is probably the cause but I don't want to change it before someone tests it.
-//const uint8_t HEATBITMASK1 = B00110000; //48 heater stage 1 = 50%
-//const uint8_t HEATBITMASK2 = B01000000; //64 heater stage 2 = 100%
-const uint8_t POWERBITMASK = B10000000; //128
+//const uint8_t HEATBITMASK1 = B00110000; //48 heater stage 1 = 50%
+//const uint8_t HEATBITMASK2 = B01000000; //64 heater stage 2 = 100%
+const uint8_t POWERBITMASK = B10000000; //128
+const bool HASJETS = true;
+const String MYMODEL = "NO54138";
#endif
#ifdef NO54123
@@ -177,17 +181,17 @@ const uint8_t POWERBITMASK = B10000000; //128
//meaning current state (row) is now 6. According to ALLOWEDSTATES table, we turn on Bubbles and keep
//everything else off. (1,0,0,0)
const uint8_t JUMPTABLE[][4] = {
- {1,0,2,3},
- {0,1,2,3},
- {1,2,0,3},
- {1,3,0,2}
+ {1,0,2,3},
+ {0,1,2,3},
+ {1,2,0,3},
+ {1,3,0,2}
};
//Bubbles, Jets, Pump, Heat
const uint8_t ALLOWEDSTATES[][4] = {
- {0,0,0,0},
- {1,0,0,0},
- {0,0,1,0},
- {0,0,1,2} //the "2" means both heater elements
+ {0,0,0,0},
+ {1,0,0,0},
+ {0,0,1,0},
+ {0,0,1,2} //the "2" means both heater elements
};
//cio
@@ -200,33 +204,35 @@ const uint8_t DSP_CHECKSUMINDEX = 5;
const uint8_t PAYLOADSIZE = 7;
-const uint8_t PUMPBITMASK = B00010000; //1 << 4;
-const uint8_t BUBBLESBITMASK = B00100000; //1 << 5;
-const uint8_t JETSBITMASK = B00000000; //0; //no jets on this machine.
-const uint8_t HEATBITMASK1 = B00000010; //(1 << 1) "stage 1"
-const uint8_t HEATBITMASK2 = B00001000; //(1 << 3) "stage 2" (thanks @dietmar-1 for testing and reporting this)
-const uint8_t POWERBITMASK = B00000001; //1;
+const uint8_t PUMPBITMASK = B00010000; //1 << 4;
+const uint8_t BUBBLESBITMASK = B00100000; //1 << 5;
+const uint8_t JETSBITMASK = B00000000; //0; //no jets on this machine.
+const uint8_t HEATBITMASK1 = B00000010; //(1 << 1) "stage 1"
+const uint8_t HEATBITMASK2 = B00001000; //(1 << 3) "stage 2" (thanks @dietmar-1 for testing and reporting this)
+const uint8_t POWERBITMASK = B00000001; //1;
+const bool HASJETS = false;
+const String MYMODEL = "NO54123";
#endif
#ifdef NO54154
//WARNING: THIS DEVICE HAS DIFFERENT PINOUTS!!! CHECK BEFORE USING
//Requested by @chunkysteveo
const uint8_t JUMPTABLE[][4] = {
- {3,0,1,2},
- {4,1,0,2},
- {5,2,0,1},
- {0,3,4,5},
- {1,4,3,5},
- {2,5,3,4}
+ {3,0,1,2},
+ {4,1,0,2},
+ {5,2,0,1},
+ {0,3,4,5},
+ {1,4,3,5},
+ {2,5,3,4}
};
//Bubbles, Jets, Pump, Heat
const uint8_t ALLOWEDSTATES[][4] = {
- {0,0,0,0},
- {0,0,1,0},
- {0,0,1,2},
- {1,0,0,0}, //the "2" means both heater elements
- {1,0,1,0},
- {1,0,1,1}
+ {0,0,0,0},
+ {0,0,1,0},
+ {0,0,1,2},
+ {1,0,0,0}, //the "2" means both heater elements
+ {1,0,1,0},
+ {1,0,1,1}
};
//cio
@@ -239,12 +245,14 @@ const uint8_t DSP_CHECKSUMINDEX = 5;
const uint8_t PAYLOADSIZE = 7;
-const uint8_t PUMPBITMASK = B00010000; //1 << 4;
-const uint8_t BUBBLESBITMASK = B00100000; //1 << 5;
-const uint8_t JETSBITMASK = B00000000; //0; //no jets on this machine.
-const uint8_t HEATBITMASK1 = B00000010; //(1 << 1) "stage 1"
-const uint8_t HEATBITMASK2 = B00001000; //(1 << 3) "stage 2" (thanks @dietmar-1 for testing and reporting this)
-const uint8_t POWERBITMASK = B00000001; //1;
+const uint8_t PUMPBITMASK = B00010000; //1 << 4;
+const uint8_t BUBBLESBITMASK = B00100000; //1 << 5;
+const uint8_t JETSBITMASK = B00000000; //0; //no jets on this machine.
+const uint8_t HEATBITMASK1 = B00000010; //(1 << 1) "stage 1"
+const uint8_t HEATBITMASK2 = B00001000; //(1 << 3) "stage 2" (thanks @dietmar-1 for testing and reporting this)
+const uint8_t POWERBITMASK = B00000001; //1;
+const bool HASJETS = false;
+const String MYMODEL = "NO54154";
#endif
#endif
\ No newline at end of file
diff --git a/Code/4-wire-version/lib/BWC4W/model.h b/Code/4-wire-version/lib/BWC4W/model.h
index 7837b604..ffd99a54 100644
--- a/Code/4-wire-version/lib/BWC4W/model.h
+++ b/Code/4-wire-version/lib/BWC4W/model.h
@@ -7,4 +7,8 @@
//WARNING: DEVICES HAVE DIFFERENT PINOUTS!!! CHECK BEFORE USING
-//The 54123 should work also for 54112 judging from a comment from @jenswalit in the forum
\ No newline at end of file
+//The 54123 should work also for 54112 judging from a comment from @jenswalit in the forum
+
+//If using/testing the new PCB choose PCB_V2
+#define PCB_V1
+//#define PCB_V2 //The PCB with rounded corners
\ No newline at end of file
diff --git a/Code/4-wire-version/lib/BWC4W/platformio.ini b/Code/4-wire-version/lib/BWC4W/platformio.ini
deleted file mode 100644
index dc196415..00000000
--- a/Code/4-wire-version/lib/BWC4W/platformio.ini
+++ /dev/null
@@ -1,35 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; https://docs.platformio.org/page/projectconf.html
-
-[platformio]
-src_dir = src
-data_dir = data
-
-[env:nodemcuv2]
-platform = espressif8266@^2
-board = nodemcuv2
-framework = arduino
-lib_deps =
- bblanchon/ArduinoJson
- mcxiaoke/ESPDateTime
- links2004/WebSockets@^2.3.3
- knolleary/PubSubClient@^2.8
- tzapu/WiFiManager@^0.16
-board_build.filesystem = littlefs
-monitor_speed = 115200
-
-; Uncomment the lines below by removing semicolons and edit IP for OTA upload.
-; You have to upload via USB cable the first time. (upload_protocol = esptool)
-; Make sure to use a data-USB cable. There is power only cables that wont work.
-upload_protocol = esptool
-;upload_protocol = espota
-;upload_port = 192.168.4.121
-;upload_flags =
-; --auth=esp8266
diff --git a/Code/4-wire-version/platformio.ini b/Code/4-wire-version/platformio.ini
index 1013bb6d..f8a9c840 100644
--- a/Code/4-wire-version/platformio.ini
+++ b/Code/4-wire-version/platformio.ini
@@ -34,6 +34,6 @@ monitor_speed = 115200
; Make sure to use a data-USB cable. There is power only cables that wont work.
upload_protocol = esptool
;upload_protocol = espota
-;upload_port = 192.168.4.121
+;upload_port = layzspa.local
;upload_flags =
; --auth=esp8266
diff --git a/Code/4-wire-version/src/config.h b/Code/4-wire-version/src/config.h
index 83d0dffd..2163f78a 100644
--- a/Code/4-wire-version/src/config.h
+++ b/Code/4-wire-version/src/config.h
@@ -1,7 +1,8 @@
#include
#include
-#define LEGACY_NAME "BW4W_1.0"
+#define LEGACY_NAME "layzspa"
+#define FW_VERSION "4W_2022-05-20"
/*
* Miscellaneous
diff --git a/Code/4-wire-version/src/main.cpp b/Code/4-wire-version/src/main.cpp
index f7732c09..5477f3f4 100644
--- a/Code/4-wire-version/src/main.cpp
+++ b/Code/4-wire-version/src/main.cpp
@@ -198,13 +198,31 @@ void sendWS()
}
// send other info
- String other =
- String("{\"CONTENT\":\"OTHER\",\"MQTT\":") + String(mqttClient.state()) +
- String(",\"CIOTX\":") + String(bwc.cio_tx) +
- String(",\"DSPTX\":") + String(bwc.dsp_tx) +
- String(",\"RSSI\":") + String(WiFi.RSSI()) +
- String("}");
- webSocket.broadcastTXT(other);
+ json = getOtherInfo();
+ webSocket.broadcastTXT(json);
+}
+
+String getOtherInfo()
+{
+ DynamicJsonDocument doc(1024);
+ String json = "";
+ // Set the values in the document
+ doc["CONTENT"] = "OTHER";
+ doc["CIOTX"] = bwc.cio_tx_ok;
+ doc["DSPTX"] = bwc.dsp_tx_ok;
+ doc["HASJETS"] = HASJETS;
+ doc["RSSI"] = WiFi.RSSI();
+ doc["IP"] = WiFi.localIP().toString();
+ doc["SSID"] = WiFi.SSID();
+ doc["FW"] = FW_VERSION;
+ doc["MODEL"] = MYMODEL;
+
+ // Serialize JSON to string
+ if (serializeJson(doc, json) == 0)
+ {
+ json = "{\"error\": \"Failed to serialize message\"}";
+ }
+ return json;
}
/**
diff --git a/Code/4-wire-version/src/main.h b/Code/4-wire-version/src/main.h
index 56b2d113..df5c7664 100644
--- a/Code/4-wire-version/src/main.h
+++ b/Code/4-wire-version/src/main.h
@@ -67,6 +67,7 @@ const int myoutputpin = D8;
void handleAUX();
void sendWS();
+String getOtherInfo();
void sendMQTT();
void startWiFi();
diff --git a/Code/6-wire-version/data/WebSocket.js b/Code/6-wire-version/data/WebSocket.js
index 58821c06..73c5bff5 100644
--- a/Code/6-wire-version/data/WebSocket.js
+++ b/Code/6-wire-version/data/WebSocket.js
@@ -98,11 +98,12 @@ function handlemsg(e)
]
document.getElementById('mqtt').innerHTML = "MQTT: " + mqtt_states[msgobj.MQTT + 4];
document.getElementById('fw').innerHTML = "Firmware version: " + msgobj.FW;
+ document.getElementById('model').innerHTML = "Model: " + msgobj.MODEL;
document.getElementById('rssi').innerHTML = "RSSI: " + msgobj.RSSI;
// hydro jets available
- document.getElementById('jets').style.display = (msgobj.HASJETS ? 'inherit' : 'none');
- document.getElementById('jetstotals').style.display = (msgobj.HASJETS ? 'inherit' : 'none');
+ document.getElementById('jets').style.display = (msgobj.HASJETS ? 'table-row' : 'none');
+ document.getElementById('jetstotals').style.display = (msgobj.HASJETS ? 'table-row' : 'none');
}
if (msgobj.CONTENT == "STATES")
diff --git a/Code/6-wire-version/data/config.html b/Code/6-wire-version/data/config.html
index 3af77adf..cd334797 100644
--- a/Code/6-wire-version/data/config.html
+++ b/Code/6-wire-version/data/config.html
@@ -1,119 +1,126 @@
- Lay-Z-Spa Module | SPA Config
-
-
-
-
-
-
-
+ Lay-Z-Spa Module | SPA Config
+
+
+
+
+
+
+
-