diff --git a/README.md b/README.md index dc78ac3..11f4405 100644 --- a/README.md +++ b/README.md @@ -119,22 +119,18 @@ NEED TO FIX FOR THIS RELEASE. * DONE look at virtual button support * vbuton will need the PDA on iAQT protocol working. * change dimmer to % from steps. (will make HASIO & Homekit easier) -* show Colorlight name in UI * add config for homekit_f (panel in F homekin in C), F to F or C to C is fine. * deprecate extended_device_id_programming * show error is vbutton and no extended_device_id # Updates in 2.3.9 --> - + * use `device_id=0x33` in aqualinkd.conf + # Updates in Release 2.4.0 * WARNING Breaking change if you use dimmer (please change button_??_lightMode from 6 to 10) * Fixed bugs with particular Jandy panel versions and color lights. diff --git a/release/aqualinkd-amd64 b/release/aqualinkd-amd64 new file mode 100755 index 0000000..3dd339d Binary files /dev/null and b/release/aqualinkd-amd64 differ diff --git a/release/aqualinkd-arm64 b/release/aqualinkd-arm64 index 4a1e9af..9795867 100755 Binary files a/release/aqualinkd-arm64 and b/release/aqualinkd-arm64 differ diff --git a/release/aqualinkd-armhf b/release/aqualinkd-armhf index 2985ee5..640f65a 100755 Binary files a/release/aqualinkd-armhf and b/release/aqualinkd-armhf differ diff --git a/release/aqualinkd.conf b/release/aqualinkd.conf index a341dc0..8fbbecd 100755 --- a/release/aqualinkd.conf +++ b/release/aqualinkd.conf @@ -28,6 +28,10 @@ display_warnings_in_web=true # If you change this from 80, remember to update aqualink.service.avahi socket_port=80 + +# Note on serial port below. If you want aqualinkd to start and run without connecting to a panel or port +# use 0x00 for device_id and a dummy serial_port like /dev/tty0. + # The serial port the daemon access to read the Aqualink RS8 serial_port=/dev/ttyUSB0 @@ -59,7 +63,6 @@ panel_type = RS-8 Combo # Working RS ID's are 0x0a 0x0b 0x09 0x08 <- 0x08 is usually taken # If your panel is a PDA only model, then PDA device ID's are 0x60, 0x61, 0x62, 0x63. # (These are NOT recomended to use unless you absolutly have no other option) -#device_id=0x0a device_id=0x00 diff --git a/release/serial_logger-amd64 b/release/serial_logger-amd64 new file mode 100755 index 0000000..8712448 Binary files /dev/null and b/release/serial_logger-amd64 differ diff --git a/release/serial_logger-arm64 b/release/serial_logger-arm64 index 6c6875a..bf70e29 100755 Binary files a/release/serial_logger-arm64 and b/release/serial_logger-arm64 differ diff --git a/release/serial_logger-armhf b/release/serial_logger-armhf index 854861a..f9170f2 100755 Binary files a/release/serial_logger-armhf and b/release/serial_logger-armhf differ diff --git a/source/aq_serial.h b/source/aq_serial.h index ba556f0..487dfd3 100644 --- a/source/aq_serial.h +++ b/source/aq_serial.h @@ -121,7 +121,8 @@ DEV_UNKNOWN_MASK = 0xF8; // Unknown mask, used to reset values #define AQ_MINPKTLEN 5 //#define AQ_MAXPKTLEN 64 //#define AQ_MAXPKTLEN 128 // Max 79 bytes so far, so 128 is a guess at the moment, just seen large packets from iAqualink -#define AQ_MAXPKTLEN 256 // Still getting this at 128, so temp increase to 256 and print message over 128 in aq_serial.c +//#define AQ_MAXPKTLEN 256 // Still getting this at 128, so temp increase to 256 and print message over 128 in aq_serial.c +#define AQ_MAXPKTLEN 512 // Still getting this at 128, so temp increase to 256 and print message over 128 in aq_serial.c #define AQ_PSTLEN 5 #define AQ_MSGLEN 16 #define AQ_MSGLONGLEN 128 diff --git a/source/aqualinkd.c b/source/aqualinkd.c index 6b52f1f..6ddf64b 100644 --- a/source/aqualinkd.c +++ b/source/aqualinkd.c @@ -482,7 +482,7 @@ int startup(char *self, char *cfgFile) // Sanity check on Device ID's against panel type if (isRS_PANEL) { - if (_aqconfig_.device_id >= 0x08 && _aqconfig_.device_id <= 0x0B) { + if ( (_aqconfig_.device_id >= 0x08 && _aqconfig_.device_id <= 0x0B) || _aqconfig_.device_id == 0x00) { // We are good } else { LOG(AQUA_LOG,LOG_ERR, "Device ID 0x%02hhx does not match RS panel, please check config!\n", _aqconfig_.device_id); @@ -992,7 +992,7 @@ void main_loop() got_probe_rssa = true; if (_aqconfig_.device_id == 0x00) { - LOG(AQUA_LOG,LOG_NOTICE, "Searching for valid ID, please configure one for faster startup\n"); + LOG(AQUA_LOG,LOG_WARNING, "Searching for valid ID, please configure `device_id` for faster startup\n"); } LOG(AQUA_LOG,LOG_NOTICE, "Waiting for Control Panel probe\n"); @@ -1001,13 +1001,17 @@ void main_loop() // Loop until we get the probe messages, that means we didn;t start too soon after last shutdown. while ( (got_probe == false || got_probe_rssa == false || got_probe_extended == false ) && _keepRunning == true) { - if (blank_read == blank_read_reconnect) { + if (blank_read == blank_read_reconnect / 2) { LOG(AQUA_LOG,LOG_ERR, "Nothing read on '%s', are you sure that's right?\n",_aqconfig_.serial_port); #ifdef AQ_CONTAINER // Reset blank reads here, we want to ignore TTY errors in container to keep it running blank_read = 1; #endif - } else if (blank_read == blank_read_reconnect*2) { + if (_aqconfig_.device_id == 0x00) { + blank_read = 1; // if device id=0x00 it's code for don't exit + } + _aqualink_data.updated = true; // Make sure to show erros if ui is up + } else if (blank_read == blank_read_reconnect*2 ) { LOG(AQUA_LOG,LOG_ERR, "I'm done, exiting, please check '%s'\n",_aqconfig_.serial_port); stopPacketLogger(); close_serial_port(rs_fd); diff --git a/source/config.c b/source/config.c index ec9fced..88e8ea2 100644 --- a/source/config.c +++ b/source/config.c @@ -686,7 +686,8 @@ bool setConfigValue(struct aqualinkdata *aqdata, char *param, char *value) { pump_detail *pump = getpump(aqdata, num); if (pump != NULL) { pump->pumpID = strtoul(cleanalloc(value), NULL, 16); - if ( (int)pump->pumpID <= PENTAIR_DEC_PUMP_MAX) { + //if ( (int)pump->pumpID <= PENTAIR_DEC_PUMP_MAX) { + if ( (int)pump->pumpID >= PENTAIR_DEC_PUMP_MIN && (int)pump->pumpID <= PENTAIR_DEC_PUMP_MAX) { pump->prclType = PENTAIR; } else { pump->prclType = JANDY; diff --git a/source/devices_jandy.c b/source/devices_jandy.c index c4fa4f4..641c8cb 100644 --- a/source/devices_jandy.c +++ b/source/devices_jandy.c @@ -947,7 +947,6 @@ bool processPacketFromJandyChemFeeder(unsigned char *packet_buffer, int packet_l - /* // JXi Heater diff --git a/source/iaqtouch.c b/source/iaqtouch.c index e6947e9..1245786 100644 --- a/source/iaqtouch.c +++ b/source/iaqtouch.c @@ -334,7 +334,13 @@ void updateAQButtonFromPageButton(struct aqualinkdata *aq_data, struct iaqt_page } break; default: - LOG(IAQT_LOG,LOG_NOTICE, "Unknown state 0x%02hhx for button %s\n",pageButton->state,pageButton->name); + // Dimmer light will have the % as the state. so 0x32=50% 0x4B=75% + // So anything greater than 0 use as on + if (pageButton->state > 0x00) { + aq_data->aqbuttons[i].led->state = ON; + aq_data->updated = true; + } + //LOG(IAQT_LOG,LOG_NOTICE, "Unknown state 0x%02hhx for button %s\n",pageButton->state,pageButton->name); break; } } diff --git a/source/iaqualink.h b/source/iaqualink.h new file mode 100644 index 0000000..8f0b4eb --- /dev/null +++ b/source/iaqualink.h @@ -0,0 +1,7 @@ + +/* + +Read Jandy packet To 0xa3 of type Unknown '0x53' | HEX: 0x10|0x02|0xa3|0x53|0x08|0x10|0x03| +Read Jandy packet To 0x00 of type Ack | HEX: 0x10|0x02|0x00|0x01|0x3f|0x00|0x52|0x10|0x03| + +*/ \ No newline at end of file diff --git a/source/json_messages.c b/source/json_messages.c index cdf095e..2f0693b 100644 --- a/source/json_messages.c +++ b/source/json_messages.c @@ -45,19 +45,33 @@ //SPA WILL TURN OFF AFTER COOL DOWN CYCLE +bool printableChar(char ch) +{ + if ( (ch < 32 || ch > 126) || + ch == 123 || // { + ch == 125 || // } + ch == 34 || // " + ch == 92 // backslash + ) { + return false; + } + return true; +} int json_chars(char *dest, const char *src, int dest_len, int src_len) { int i; int end = dest_len < src_len ? dest_len:src_len; for(i=0; i < end; i++) { + /* if ( (src[i] < 32 || src[i] > 126) || src[i] == 123 || // { src[i] == 125 || // } src[i] == 34 || // " - src[i] == 92 // backslash - ) // only printable chars + src[i] == 92 // backslash + ) // only printable chars*/ + if (! printableChar(src[i])) dest[i] = ' '; else dest[i] = src[i]; @@ -120,24 +134,11 @@ const char* _getStatus(struct aqualinkdata *aqdata, const char *blankmsg) return JSON_TIMEOUT; } - // NSF should probably use json_chars here. if (aqdata->last_display_message[0] != '\0') { int i; for(i=0; i < strlen(aqdata->last_display_message); i++ ) { - if (aqdata->last_display_message[i] <= 31 || aqdata->last_display_message[i] >= 127) { + if (! printableChar(aqdata->last_display_message[i])) { aqdata->last_display_message[i] = ' '; - } else { - switch (aqdata->last_display_message[i]) { - case '"': - case '/': - case '\n': - case '\t': - case '\f': - case '\r': - case '\b': - aqdata->last_display_message[i] = ' '; - break; - } } } //printf("JSON Sending '%s'\n",aqdata->last_display_message); diff --git a/source/serial_logger.c b/source/serial_logger.c index 450521d..70a0c6d 100644 --- a/source/serial_logger.c +++ b/source/serial_logger.c @@ -206,6 +206,7 @@ const char *getDevice(unsigned char ID) { if (ID >= 0x70 && ID <= 0x73) return HEAT_PUMP; + // Looks like 0xe0 is also a Jandy ePump if (ID >= 0x78 && ID <= 0x7B) return EPUMP; diff --git a/source/version.h b/source/version.h index e17cf67..4955baa 100644 --- a/source/version.h +++ b/source/version.h @@ -2,4 +2,4 @@ #define AQUALINKD_NAME "Aqualink Daemon" #define AQUALINKD_SHORT_NAME "AqualinkD" -#define AQUALINKD_VERSION "2.4.0" +#define AQUALINKD_VERSION "2.4.1 (Dev)"