Intelliflow pump RS485 protocol

I have my Pi up and running with tag's code on it.  index.js seems to run just fine after I installed all the required dependencies using npm.  I can see both the main page and the debug page when browsing to my pi at :3000.  Now just waiting for my USB-RS485 dongle to arrive (for now, I have the code looking at tty since I have not ttyUSB0 yet). 
 
As I am digging more into this, I realize that I will need to either disconnect my current Intermatic Multi-wave pool control box (which I do not want to do) or else I must work to understand the meaning of the traffic flow from the Intermatic to the Intlliflo VS (which will be a pretty big task).  I will be curious to see how similar the Intermatic traffic is to that of the IntelliTouch.    
 
Blueman2 
 
blueman2 said:
As I am digging more into this, I realize that I will need to either disconnect my current Intermatic Multi-wave pool control box (which I do not want to do) or else I must work to understand the meaning of the traffic flow from the Intermatic to the Intlliflo VS (which will be a pretty big task).  I will be curious to see how similar the Intermatic traffic is to that of the IntelliTouch.    
 
Yes, the code has gotten pretty complex.  And as I've been debugging it I've added more (and different levels) of debugging.  I'm really close to being done with all of the core functionality and cleaning up the console logging and debugging messages are still high on the list.
 
I don't really know much about the Intermatic pool control box, but at the least it would have to talk to the pumps in the same manner as any other control box.  Beyond that, you would have to test and let me know.  
 
In my code at the top, there is a section to display the pump messages and I would suggest you start there to get a sense of what the pumps/controller are sending back and forth.  There are even some hooks in there for the commands sent directly to the pump without a controller (left over from the references at the bottom of the GitHub Readme.md) that will probably still work.  
 
I'd be happy to help you understand my code better.  Take a look and let me know what questions you have.  I'm always open to suggestions on how to improve it, as well.
 
Thanks once more, Tag.  I will continue reading your code and others to get more up to speed.  I am not a programmer by any means (I started on punch cards many years ago and decided programming was not for me), but there does seem to be a logic to all of this that can be figured out.  Fun puzzle.  But mostly, I need to wait for my USB-RS485 so that I can get my hands on the Intermatic communications.  
 
For the Pentair system, does anyone know what happens if you send a command to a pump (such as change from speed 2 to speed 3) while a Pentair IntelliTouch/EasyTouch is in control of it?  Will the EasyTouch just change the pump back to speed 2 since it monitors N times per minute?  Or is there a way to "force" a disconnect from the EasyTouch so that it not longer monitors the pump??  Does "Set Control Remove" or "Set Control Local" accomplish this?  Of course, I can find all this out myself once I get my adapter, but just curious if anyone knows.  
 
blueman2 said:
or the Pentair system, does anyone know what happens if you send a command to a pump (such as change from speed 2 to speed 3) while a Pentair IntelliTouch/EasyTouch is in control of it?  Will the EasyTouch just change the pump back to speed 2 since it monitors N times per minute?  Or is there a way to "force" a disconnect from the EasyTouch so that it not longer monitors the pump??  Does "Set Control Remove" or "Set Control Local" accomplish this?  Of course, I can find all this out myself once I get my adapter, but just curious if anyone knows.  
 
This is where there is a big difference between the stand-alone pumps and the Intellitouch.  With standalone, you address the pump, choose a program, and let it run (I think the documentation here outlines it pretty well).  When you are using the Intellitouch, it never runs a program on the pump (they are completely ignored).  Intellitouch tells the pump what speed to run, and then keeps checking that it is, in fact, running.  
 
If you have the Intellitouch connected, and then force the pump to do something else, Intellitouch will just keep resending the commands to the pump to try and control it.  I believe, if the Intellitouch doesn't get the response it is waiting for (or an error), it will try to shut the system down.  In short, the answer is no, I don't believe there is any way to force a disconnect between the pump and the controller short of removing the pump from the Intellitouch configuration.
 
Hi blueman2,
 
before you send any command you will have to switch the pump into "Control Remote" mode. Once you have completed your command, you need to switch it back to "Control Local". See my previous post here what to do run a specific speed: http://cocoontech.com/forums/topic/13548-intelliflow-pump-rs485-protocol/page-5#entry247376
From my understanding, you can have multiple controllers on the RS485 bus. As RS485 operates in half-duplex mode, you will have to announce that you are sending data, which is usually handled by whatever Serial library you use. So, I wouldn't worry too much about it. It'll be only a problem, if the two controllers were to send opposite commands like "Run Speed 1 & Start Pump" and the controller two sends "Execute External Program 1".
 
// EDIT: Tag beat me to it :) I don't have an Intellitouch on my system. You just need to make sure the commands from the controllers don't overlap or contradict each other.
 
OK, got the RS485 dongle and hooked everything up.  Did not know which way to hook up the RS485 wires (only 2 of them), but I noticed if I did it one way, it would stop all communications between my Intermatic and the Intelliflo VS.  So I went with the other way which allowed my system to still work.  I then started up index.js, but it crashed after starting.  I removed one of the RS485 wires from the dongle, and then restarted index.js and it ran fine.  I left it running, hooked up the wire, and it immediately crashed again.  Here is the output:


Done queueing messages to retrieve Custom Names and Circuit Names
Wrote 255,0,255,165,10,16,34,202,1,0,1,172 and # of bytes undefined Error?: null

/home/pi/Pentair/index.js:540
                        if (b.data == 0) {
                                  ^
TypeError: Cannot read property '0' of undefined
    at SerialPort.<anonymous> (/home/pi/Pentair/index.js:540:35)
    at SerialPort.emit (events.js:95:17)
    at Object.module.exports.raw [as parser] (/home/pi/Pentair/node_modules/serialport/lib/parsers.js:7:13)
    at SerialPort.settings.dataCallback (/home/pi/Pentair/node_modules/serialport/lib/serialport.js:147:14)
    at SerialPort._emitData (/home/pi/Pentair/node_modules/serialport/lib/serialport.js:350:18)
    at SerialPort.<anonymous> (/home/pi/Pentair/node_modules/serialport/lib/serialport.js:330:14)
    at SerialPort.<anonymous> (/home/pi/Pentair/node_modules/serialport/lib/serialport.js:343:7)
    at Object.wrapper [as oncomplete] (fs.js:466:17)
[email protected]<script data-cfhash='f9e31' type="text/javascript">/* */</script> ~/Pentair $ 

Maybe the non-standard communications from the Intermatic controller is causing this?  Oh, and here are my settings.  I had to change the last 2 in particular or it would crash even earlier:
 

//To do: Clean up the following... consolidate or at least make it consistent
var loglevel = 1; //1=more, 0=less
var pumpMessages = 1; //variable if we want to output pump messages or not
var duplicateMessages = 0; //variable if we want to output duplicate broadcast messages
var showConsoleNotDecoded = 0; //variable to hide any unknown messages
var showConfigMessages = 0; //variable to show/hide configuration messages

EDIT: I did find on Tag's Github the idea for outputting everything, so can now at least see what is happening!
 

od -x < /dev/ttyUSB0
more to come...
 
Here is what I have learned so far from the output of the Intermatic Multi-Wave Pool Controller hooked up to the Pentair VS pump.  I put line breaks where it seemed to help based on the FF-00-FF-A5 pattern than seemed to go with pumps.  From what I have been about to figure out, this is somewhat of a hybrid of the IntelliTouch controller and the IntelliComII controller.  Like the IntelliTouch, it keeps repeating the data every 5-10 seconds, and keep the pump in 'remote' mode at all times.  But unlike the IntelliTouch (and like the IntelliComII) it does not send custom speed commands, but rather just sends commands to use one of the 4 internal speed settings.  But it does also send the 4 speed settings every time data is sent, so that the pump can go to whatever speed you want.  
 
It appears that code is
 
<FF><00><FF>new record 
<A5><00>: Some sort of intro 
<dest><src>: 60-10 to pump from controller, 10-60 to controller from pump??
<cmd> <dlen> <data*dlen> <csH> <csL>
 
There are only 10 <cmd><data> messages being sent from the Intermatic:
 
cmd      data               data explanation
====  ========   ====================================================================
<01>  <03><21> = Set current speed to speed setting <00><08>=1, <00><10>=2, <00><18>=3, <00><20>=4
<01>  <03><27> = Set Speed Setting 1 to speed <xx><xx> in rpm
<01>  <03><28> = Set Speed Setting 2 to speed <xx><xx> in rpm
<01>  <03><29> = Set Speed Setting 3 to speed <xx><xx> in rpm
<01>  <03><2A> = Set Speed Setting 4 to speed <xx><xx> in rpm
<01>  <03><2B> = set pump timer to <xx><xx> minutes (or might be <hr><mn>??)
<04>  <00>         = set pump to local
<04>  <FF>        = set pump to remote
<06>  <04>         = Turn pump off
<06>  <0A>         = Turn pump on
 
 
 
Here is the raw dump of all communications, with line breaks added for readability.  Starts with pump OFF, going to SPEED 2.

FF 00 FF A5 00 60 10 01 04 03 27 02 EE 02 34 Set Speed Setting 1 <03><27> to 750rpm <02><EE>
FF 00 FF A5 00 10 60 01 02 02 EE 02 08
FF 00 FF A5 00 60 10 01 04 03 28 06 D6 02 21 Set Speed Setting 2 <03><28> to 1750rpm <06><D6>
FF 00 FF A5 00 10 60 01 02 06 D6 01 F4
FF 00 FF A5 00 60 10 01 04 03 29 07 D0 02 1D Set Speed Setting 3 <03><29> to 2000rpm <07><D0>
FF 00 FF A5 00 10 60 01 02 07 D0 01 EF
FF 00 FF A5 00 60 10 01 04 03 2A 0C B2 02 05 Set Speed Setting 4 <03><2A> to 3250rpm <0C><B2>
FF 00 FF A5 00 10 60 01 02 0C B2 01 D6
FF 00 FF A5 00 60 10 04 01 FF 02 19 Set Pump to Remote <FF>
FF 00 FF A5 00 10 60 04 01 FF 02 19
FF 00 FF A5 00 60 10 06 01 04 01 20 Turn Pump Off <04>
FF 00 FF A5 00 10 60 06 01 04 01 20
FF 00 FF A5 00 60 10 01 04 03 21 00 00 01 3E Current Speed <03><21> set to Setting 0 <00><00>
FF 00 FF A5 00 10 60 01 02 00 00 01 18
FF 00 FF A5 00 60 10 06 01 0A 01 26 Turn Pump On <0A>
FF 00 FF A5 00 10 60 06 01 0A 01 26
FF 00 FF A5 00 60 10 01 04 03 21 00 10 01 4E Current Speed <03><21> set to Setting 2 <00><10>
FF 00 FF A5 00 10 60 01 02 00 10 01 28
FF 00 FF A5 00 60 10 01 04 03 2B 00 01 01 49 Pump Timer <03><2B> set to 1 minute <00><01>
FF 00 FF A5 00 10 60 01 02 00 01 01 19

02 AA 55 10 07 08 05 2E I think these are attempted communications to either the
02 AA 55 10 07 08 05 2E P5043ME device Intermatic sells or the AutoPilot
chlorinator that they support on this controller


This set of data repeats every 10 seconds. It takes a very brief amount of time to send, then sends nothing
until the next 10 second period. So that leaves lots of open space for sending other messages on the bus
if I start them right after this message is sent.
 
So with only 10 total commands coming from the Intermatic, this should be reasonably simple to work with.  
 
Well, now that I have the basics of the command structure, I come to how to use it.  At this point, I could probably disconnect the INtermatic controller and give commands directly.  But since I want to keep my Intermatic controller in place ideally, I wonder if there is a way to tell the Intermatic to change the pump speed?  Otherwise, it will just overwrite any command I give the pump.  Any thoughts?  
 
Hey Blueman,
 
It appears you are moving pretty quickly - congratulations.
 
Michael and others have previously decoded most of the commands that you have captured. He has a pretty good write-up on the protocol that you can download with his code here:
 
http://cocoontech.com/forums/files/file/173-pab014sharezip/
 
Look at the README.txt file, and I think you will find everything in you communications dump decoded already.
 
rocco said:
ook at the README.txt file, and I think you will find everything in you communications dump decoded already.
 Doh!!  I guess I could have saved myself some time, but at least now I understand how everything works much better!  thanks for the lead!
 
blueman2 said:
/home/pi/Pentair/index.js:540
                        if (b.data == 0) {
                                 

 
Hi,  I know you've made a lot of progress.  But just to close the loop on my end, I'm not sure why you are getting this error.  Is this one still happening now that you've made progress?  
 
If you want to just "listen" with my code then you could simply comment out all the lines in the getConfiguration() method.  That's the only place in the code that actually looks to write back to the controller (the UI does as well, but it wouldn't load until you have the response to these commands anyway).
 
You could also compare your Intematic messages to the wiki on my project page.  It focuses more on the system messages than pump specific messages but maybe you could garner some good information there.
 
tag
 
Tag,
 
Yes, the combination of the Intermatic Multi-wave and the IntelliFlo VS do still crash the program.  I am pretty sure it is because the Intermatic is not made to respond to the requests your program sends it, and replies with some sort of non-standard communication.  But I would still like to use your program for testing.  I want to see if there are ANY commands that the Intermatic will respond to.  The trouble is that I see no way to view the raw data that is going back and forth to see what is causing the crash.  I have tried all levels of logging, but nothing appears to capture any traffic in either of the log files.  
 
Any idea of how we can see what incoming data is causing the crash?
 
BTW, my goal using your program (or something else) is to send the Intermatic some test commands and see if it responds to any of them. I could not find any other programs here that will send commands on an active data bus.  

Also, your Wiki page is FANTASTIC!! It saved me hours of trying to find that info in other places.
 
Hi Blueman,
 
Maybe you should look at Michael's code. It is more of a suite of utilities rather than operational software. There is a program that just listens and logs what it sees on the bus.
 
You just run the make file to build it. I had no problems when I built it on the BeagleBone - I just copied the directory over and ran "make". So it should run on the rPi as well.
 
mark
 
Yes, based on your guidance I already installed and compiled those utilities.  The padec tools is VERY cool!  It told me instantly everything I worked many hours to guess on my own.  And it told me several things I never could figure out.  Very nice. However, the 'active' tools that could write to the network or a device are all designed for no controller on the network.  If they sense traffic, they shut down.  So I am still looking for some way to send commands onto an active bus.  Not that I will want to long term (not a good idea!), but for testing.  
 
Oh, and the aprs485 module does a great job logging everything, but it prevents any other program (such as yours) from getting any ttyUSB0 data.  So I cannot use it to see why your program crashes, for example.  Unless I am using something wrong.  Which is likely!
 
I probably should start another thread on this or add to the Hayward controller thread, but I just realized my Hayward Salt Chlorinator unit has RS485 too.  Some people have done work to decode the Controller comm traffic, but apparently no one has done any work understanding the communication between the Hayward controller and the Hayward Salt Chlorinator.  More puzzle work ahead!
 
Back
Top