I’ve been following this thread for quite some time and wanted to restart the discussion. It seems that most of us commenting here are having the same issue; we can’t reliably send commands to our pool controller. I’d like to suggest that a config setting be added for latency and propose a code change for the timing of sending the command. This is beyond my skill level, so I will just go so far as explaining my logic here. BTW-I have an Aqualogic PS-4
I spent quite a bit of time analyzing the output from my RS-485 device and came up with a few conclusions. First, I don’t believe that the output from the Aqualogic is as convoluted as it seems. I dumped a couple minutes of the output log and then painstakingly broke it into consistent lines by inserting a CRLF whenever “10 03” is found. I also read through the aq-co-serial device manual. The manual actually explains a lot, including timing, and is consistent with what’s been decoded here so far. What I found is:
- The display is updated every 2 seconds.
- A “listen” packet is sent every 100ms, ten times in a row. This correlates to the aq-co-serial manual.
- There is only one weird packet sent, that’s the “00 E0 18 80 00 E6 00 18 9E 00 E0 1E 80” which is also sent every 2 seconds, opposite the display update. I suggest that this is either a command to clear the comm bus or has to do with the radio.
- I believe that the “keep alive” packet is actually the “listen” packet and is the KEY to avoiding data bus collisions.
- The timing seems to be:
- Display type 1 (Led status, display message combined)
- Display type 2 (Led status only)
- Display type 3 (display message only)
- Listening packet sent 10 times (every 100 ms) “10 02 01 01 00 14 10 03”
- Unformatted packet; maybe this clears the comm bus? “00 E0 18 80 00 E6 00 18 9E 00 E0 1E 80”
- Listening packet sent 10 times (every 100 ms) “10 02 01 01 00 14 10 03”
- Repeat
My second conclusion is that the “listen” or “keep-alive” packet is the key to communicating back to the controller. I hypothesize that the outgoing command needs to be buffered and sent first thing after the FIRST listening packet is received; either after the last display update or after the “00 E0 18 80 00 E6 00 18 9E 00 E0 1E 80” packet is received. Either way, there is a window of 1 sec with 10 listening packets interspersed.
But this still won’t prevent collisions. Due to the latency of different networks, I believe that we need a delay or latency constant in the config file. This value, in milliseconds, could then be tweaked by each user to add to the send time. The value could be anywhere between 0 ms and 1000 ms.
By sending immediately after the FIRST listening packet, we could then avoid collisions by tweaking the latency constant so that the command is RECEIVED immediately after a listen packet is sent from the controller; but not necessarily the first packet. We have a window of 100 ms between commands, providing that we avoid the display update and the “00 E0 18 80 00 E6 00 18 9E 00 E0 1E 80” packet.
In theory,
- Format and buffer the command to send
- Wait for the first listening packet either after the display updates or the “00 E0 18 80 00 E6 00 18 9E 00 E0 1E 80” is received.
- Send the buffered command.
- If it’s not acted upon by the controller, e.g. lights don’t turn on, the add 10 ms to the latency constant and try again.
- Each system should be able to adjust the latency constant to their own needs to get consistent key press action.
So this is beyond my skill level and I’m hoping that someone on the forum could take up this project and code it. I’m more than happy to assist with testing it out.
The other thing I’d like to see is adding all the buttons/keypresses to be able to navigate the menu. I believe these are all the button codes beginning with the 5th byte (after “10 03 00 83”; where the “00 83” may differ by control). All the commands repeat in each packet.
01 01 00 00 00 01 00 00 00 00 Right Arrow
01 02 00 00 00 02 00 00 00 00 Menu/Enter
01 04 00 00 00 04 00 00 00 00 Left Arrow
01 08 00 00 00 08 00 00 00 00 Service
01 10 00 00 00 10 00 00 00 00 Down Arrow
01 20 00 00 00 20 00 00 00 00 Up Arrow
01 40 00 00 00 40 00 00 00 00 Pool/Spa/Spillover
01 80 00 00 00 80 00 00 00 00 Filter
01 00 01 00 00 00 01 00 00 00 Lights
01 00 02 00 00 00 02 00 00 00 Aux 1
01 00 04 00 00 00 04 00 00 00 Aux 2
01 00 08 00 00 00 08 00 00 00 Aux 3
01 00 10 00 00 00 10 00 00 00 Aux 4
01 00 20 00 00 00 20 00 00 00 Aux 5
01 00 40 00 00 00 40 00 00 00 Aux 6
01 00 80 00 00 00 80 00 00 00 Aux 7
01 00 00 01 00 00 00 01 00 00 Valve 3
01 00 00 02 00 00 00 02 00 00 Valve 4
01 00 00 04 00 00 00 04 00 00 Heater 1
01 00 00 08 00 00 00 08 00 00 Aux 8
01 00 00 10 00 00 00 10 00 00 Aux 9
01 00 00 20 00 00 00 20 00 00 Aux 10
01 00 00 40 00 00 00 40 00 00 Aux 11
01 00 00 80 00 00 00 80 00 00 Aux 12
01 00 00 00 01 00 00 00 01 00 Aux 13
01 00 00 00 02 00 00 00 02 00 Aux 14
So that’s what I got. Discussion please!