Intelliflow pump RS485 protocol

tag said:
farcouet, welcome, and nice job contributing!  What's interesting is that a similar discussion to this has also picked up on a thread I originally used for my research at SDYoung's blog.  I think we are a little ahead of them, but we should all put our heads together.  I'll ping them as well to point them here and to my code.
 
tag
Yes I have seen that one too but I was not getting the 10 02 50 string because of the difference in baud rate (everything was ok at 19600 except the other packets for the chlorinator). So I was thiking that there might had been some difference with the way the Oncommand was talking to it.
 
Another thing is that yesterday I was not able to get reply when sending manually. I looked a while to find what was different with my previous test. In fact I was able to send a 30% chlorinator or anything else and get a reply if I was in parallel on the RS485 active bus but as soon as I disconnected the Oncommand I could not get any reply. I finally figured out that if connecting directly to the chrlorinator a 10.7V power is needed on the + connector (I was connecting GND, TXD+, TXD- but leaving the + disconnected). I connected a 10.7v source and then I was able to get reply from the Chlorinator and totally control it without the Oncommand.
 
farcouet said:
Yes I have seen that one too but I was not getting the 10 02 50 string because of the difference in baud rate (everything was ok at 19600 except the other packets for the chlorinator). So I was thiking that there might had been some difference with the way the Oncommand was talking to it.
 
Another thing is that yesterday I was not able to get reply when sending manually. I looked a while to find what was different with my previous test. In fact I was able to send a 30% chlorinator or anything else and get a reply if I was in parallel on the RS485 active bus but as soon as I disconnected the Oncommand I could not get any reply. I finally figured out that if connecting directly to the chrlorinator a 10.7V power is needed on the + connector (I was connecting GND, TXD+, TXD- but leaving the + disconnected). I connected a 10.7v source and then I was able to get reply from the Chlorinator and totally control it without the Oncommand.
 
Wow.  You really are a good puzzle solver.  I too tried to get something, anything back from the chlorinator but got zilch.   That explains it.  You are making great progress on this!!!  Have you been able to find a 'query' command that will cause the chlorinator to respond with its full status?  Voltage, amperage, water temp, ppm salt, % chlorination, etc??
 
What are your settings for stop and start bits?  I think the Hayward systems usually are 19200 baud, 1 start, 2 stop.  And that Pentair is 9600 baud on stop.  But you say the AquaRite is 9600 baud, so I wonder if they also use a different start/stop bit.   
 
EDIT:  Well, after reading some other posts and forums, I realized why the AquaRite uses 9600.  It is because they also OEM this device to Pentair and they needed to support 9600 to fit the rest of the Pentair protocol I guess.  Very fortunate for us.  
 
blueman2 said:
Wow.  You really are a good puzzle solver.  I too tried to get something, anything back from the chlorinator but got zilch.   That explains it.  You are making great progress on this!!!  Have you been able to find a 'query' command that will cause the chlorinator to respond with its full status?  Voltage, amperage, water temp, ppm salt, % chlorination, etc??
 
What are your settings for stop and start bits?  I think the Hayward systems usually are 19200 baud, 1 start, 2 stop.  And that Pentair is 9600 baud on stop.  But you say the AquaRite is 9600 baud, so I wonder if they also use a different start/stop bit.   
 
EDIT:  Well, after reading some other posts and forums, I realized why the AquaRite uses 9600.  It is because they also OEM this device to Pentair and they needed to support 9600 to fit the rest of the Pentair protocol I guess.  Very fortunate for us.  
It took a lot of time and it's so simple finally. Just that the difference of speed made me loose a lot of time. I think that it worked with both one or 2 stop bits. I do not have the option to set the start bit in my terminal. I coded the string and receive with the rexlang (using the rexcontrols so I can program the pool controler with a plc software) and I only set the 9600 speeds and on parity. It works very well and was really simple to code.
 
For the chlorintator it seems that the Oncommand sends a kind of ping 10 02 50 00 62 10 03 and then the chlorinator responds with this 10 02 00 01 00 00 13 10 10 03. Not much use as even if I disconnect the chlorinator and reconnect it I can send the command to set the output directly without sending the ping.
 
So each time I set the output I get the same reply: 10 02 00 12 42 00 66 10 03. The only two things that are changing are the 42 (which is the hex value for the salt that must be multiplied by 50 and that explaination was on the other site). and the checksum. If I stop the pump (and then the no flow light turns on) I still get the same reply. So it looks like I am not able to get any status other than the water salinity.
 
There is one exception is if I remove the power from the chlorinator it sends this one or two times before it dies 10 02 00 12 40 20 84 10 03. I am surprised that I am not getting anything else like the amps, voltage, temp, etc. Maybe there is some other commands to send to retrieve those but the Oncommand was not fetching it. So will check on the other forum in case I find something.
 
One interesting thing is the 10 02 50 11 ff 72 10 03 frame that comes from chlorinator when the pump is disabled.
 
Thanks.  Well, I have my RS485 connected to my IntelliFlow pump and my AquaRite Chlorinator.  I hooked up 12V power to the AquaRite.  I continue to get all the normal flow of traffic from the pump and the IntelliComII talking to each other, but not a peep from the AquaRite.  Please confirm for me that you get data from the AquaRite even when there is no controller attached?  
 
Sure I do so setup is my laptop or the raspeberry pi connected with the GND, TX+ and TX-. I also connect +10.7v between gnd and power. One thing try to invert the TX + and -. I had it wired opposite by mistake couple of times. When there is traffic you notice it as data is strange. If you are wired correctly with 9600 bauds then you can send  the ping (hex) 10 02 50 00 62 10 03 or try to set output 10 02 50 11 0a 7d 10 03 (10 %). With both packet you will get a replyl
 
OK.  I have only been snooping mode right now using od -x < /dev/ttyUSB0 and flipping the bits (this gives MSB and LSB swapped for some reason).  I have not tried to inject any packets yet.  Just listening to see if I see the distinctive 10 02 or 10 03.  
 
You will not get anything unless you send the ping or the control frames to set output.
 
That's the other reason it made it hard to find. I used realterm (freeware) on windows to send the hex packet (just need to put 0x10 or $10 format in the send window) and I was able to get the reply. I then moved the USB RS485 adapter to the PI and used the plc software and it worked on 1st try.
 
blueman2 said:
Excuse my ignorance. What plc software?  
 
Instead of coding the software in python, c or something else I use rexcontrols (just add the dot com as I can't post links). So basically it is turning the raspberry pi into a programmable logic controller (used to do industrial automation). It is much easier to program that kind of thing. The interesting part is that it's really quick to program and you can see all the status live. So that's so easy to debug. I started with the free demo version (has to be restarted every two hours) and then bought the license for the PI which is 35$ I think. All the software to program and create the HMI (interface) are free.
 
For now I access the interface remotely after connecting via open vpn on my router. I need to see if I can add a password to the webserver to the interface (I think that the problem is that the java script can't use a link with a password).
 
I could have do it with python but it would have take me so much more time. And it will also be easier to add things.
 
Next thing is a PH and ORP probe.
 
And later to try to control the chlorinator output based on the pool temperature and ORP level. And maybe also add an acid pump to control the ph.
 
OK, I might give that a try.  I was trying to use this to send packets to the Chlorinator:
 
echo -n -e '\x10\x02' > /dev/ttyUSB0
 
while at the same time monitoring the data from the /dev/ttyUSB using 
 
od -x < /dev/ttyUSB0
 
but I never see the 10 02 coming across or getting a reply from the Chlorinator.  
 
I can pretty easily trap these packets based on the way I'm going through the incoming buffer.  I pasted a new version in the Gitter chat.  I will still need to validate the checksum and parse, but I am at least pulling them out with my code now (16,2,0 and 16,2,80 [decimal, of course]).
 
farcouet said:
Sure I do so setup is my laptop or the raspeberry pi connected with the GND, TX+ and TX-. I also connect +10.7v between gnd and power. One thing try to invert the TX + and -. I had it wired opposite by mistake couple of times. When there is traffic you notice it as data is strange. If you are wired correctly with 9600 bauds then you can send  the ping (hex) 10 02 50 00 62 10 03 or try to set output 10 02 50 11 0a 7d 10 03 (10 %). With both packet you will get a replyl
 So just to be sure, are you able to talk to your AquaRite WITHOUT the controller attached at all?  I am still failing at this, though Tag just did an update to his code that might help me (I will try tomorrow).  I just wanted to confirm that you were able to talk to the AquaRite stand alone.  
 
farcouet said:
Sure I do so setup is my laptop or the raspeberry pi connected with the GND, TX+ and TX-. I also connect +10.7v between gnd and power. One thing try to invert the TX + and -. I had it wired opposite by mistake couple of times. When there is traffic you notice it as data is strange. If you are wired correctly with 9600 bauds then you can send  the ping (hex) 10 02 50 00 62 10 03 or try to set output 10 02 50 11 0a 7d 10 03 (10 %). With both packet you will get a replyl
 OK, tag got this working for us.  I was able to  send (all in decimal)
 
16,2,80,17,10,0,125,16,3  
and got back
16,2,0,18,64,0,100, 16,3
 
So the 64 mean 3200ppm salt?  That is right about what it should be.  Actually, it is about 3400 typically.
 
Also, I sent 
 
16,2,80,0,0,98,16,3
and got back
16,2,0,1,0,0,19,16,3
 
This packet appears to mean nothing other than 'I am here'.  Well, this is a start. My guess is that 80 in the second packet I send is a broadcast byte.  And the 1 in the return might mean "I am Chlorinator #1".  I know the specs allow multiple chlorinators and each will take their own unique address.  Just guessing here.
 
 
Thanks so much for the hand holding!!
 
Spent some more time sending packets to the AquaRite today.  A few things to note:
 
 - I never had even noticed the 'remotely controlled' LED on the panel of the AquaRite.  Sure enough, when you sent it a packet to control the % setting, the 'remotely controlled' LED does come on, but only for 5 seconds.
 - I send packets for setting % to various levels, and if you click through the LCD display panel to the % setting, you will see it responding.  But again, it only holds for 5 seconds before returning to the existing panel settings.
 - If I send the packet repeatedly, every 4 seconds or so, the system does stay remotely controlled.  But it causes packet crashes with other data on the RS485 on occasion when doing this. 
- I also tried sending the other 16,2,80,0,0,98,16,3 packet to see what that did.  While the AquaRite replied over the rs485 bus, it did not seem to have any effect on the panel itself.  It did not show remotely controlled and did not extend the remote time of the other command.  So no idea at all what that command does.
 
Hi you need to send the percentage every 0.5 second. it will stop being remotely controlled after few seconds of not getting the packet with the setting. you may also just put it on a dedicated rs485 bus.
 
Back
Top