Intelliflow pump RS485 protocol

Alright, it's been now a few weeks, but I made some good progress and wanted to share this with you. I can now control my Pentair VS pump from my mobile phone: https://www.youtube.com/watch?v=T3iz8tXQJtM
My test rig is a bit unwieldy at the moment and not ready for permanent use just yet :)
 
I mentioned this before, but I just wanted to sum up what my goal here was. I have a very basic pool setup: VS pump, manual valves and a manual heater. So my main motivation was to be able to perform some basic tasks on the pump and not have to walk all the way back to my pump. While I could also run an external program and have to repeat the command every 30 seconds, which my Arduino controller program can do, it seemed to me a bit of an overkill for my use case. I understand why you want an external controller do that. For example, if the connection to the pump gets disrupted, you want the pump to stop and not keep going for safety reasons. Anyway, so right now I have to walk up to the pump and press one button to get it going. That's what I also wanted to be able to do from my phone.
 
That being said, I also found out more about some of the data for the "Mode" CFI (Command/Function/Instruction) 0x05. The highlighted values below allow you to choose the desired speed like you would press the button the pump panel itself. If you choose to do this, the pump will keep going and will not stop until you actually send the stop command again. This is different from running an external program, where you have to repeat the command every 30 seconds. So, use with caution!
 
From Michael's pa_iflo.h (line 23ff):

#define IFLO_MOD 5
#define IFLO_MOD_FILTER 0x00 /* Filter */
#define IFLO_MOD_MANUAL 0x01 /* Manual */
#define IFLO_MOD_BKWASH 0x02 // ERIE: SPEED 1
#define IFLO_MOD______3 0x03 /* never seen */ // ERIE: SPEED 2
#define IFLO_MOD______4 0x04 /* never seen */ // ERIE: SPEED 3
#define IFLO_MOD______5 0x05 /* never seen */ // ERIE: SPEED 4
#define IFLO_MOD_FEATR1 0x06 /* Feature 1 */
#define IFLO_MOD______7 0x07 /* never seen */
#define IFLO_MOD______8 0x08 /* never seen */
#define IFLO_MOD_EXT_P1 0x09
#define IFLO_MOD_EXT_P2 0x0a
#define IFLO_MOD_EXT_P3 0x0b
#define IFLO_MOD_EXT_P4 0x0c

The above values might have different meanings for a different pump model. But that is what they do in my case.
 
So to run Speed 2, I have to send the following commands:

/*
* Checksum omitted for laziness reasons. The program calculates it at runtime.
* The pump confirmation responses have also been omitted for brevity reasons. The app, however, checks them
* to verify that the last CFI was successful.
*/
P R E A M B L E VER PUMP CTRL CFI LEN DATA CHKH CHKL
Set Control Remote: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x04, 0x01, 0xFF, 0x00, 0x00 }
Set Mode Speed 2: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x05, 0x01, 0x03, 0x00, 0x00 }
Set Run Start: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x06, 0x01, 0x0A, 0x00, 0x00 }
Set Control Local: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x04, 0x01, 0x00, 0x00, 0x00 }

// Stop Pump and put it back into Schedule Mode
Set Control Remote: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x04, 0x01, 0xFF, 0x00, 0x00 }
Set Run Stop: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x06, 0x01, 0x04, 0x00, 0x00 }
// Like pressing Stop twice on the panel
Set Run Stop: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x06, 0x01, 0x04, 0x00, 0x00 }
Set Control Local: { 0xFF, 0x00, 0xFF, 0xA5, 0x00, 0x60, 0x20, 0x04, 0x01, 0x00, 0x00, 0x00 }

My next steps are to get my rig into a small watertight container (Pelican makes some) and see if I can downsize the Arduino board to a UNO or so and then power it maybe with a couple of D batteries, so I can leave the rig next to my pump.
 
Yet another shout-out to Michael whose C code was a tremendous help here! And of course rocco and tag, too :)
 
Erie,
nice job!  Glad you got it working.  I have a question, and an update, of my own.
 
Question: I'm at the point where I need (want) to start to write back to the serial bus.  Unfortunately, I'm getting _nothing_.  I have tried a number of variants in my test code (nodejs) and also some ideas but not sure if there is something wrong with my system config, cable or code.  Not sure where to start, either.  Has anyone had any trouble, and solved it, writing to the RS485 serial bus?  This is my cable.   If anyone has any advice, or test code, I'd be very happy to try it out.
 
Update:  I've made (with help) significant progress learning the messages from the pool controller.  Check out my wiki page on Github.  I can now read the configuration broadcast messages and read the circuit names, custom names, schedule, time, equipment status, and a few others.  Still there is a lot to go.  I also have a *very* basic UI page (with websockets) that will update automatically and a debug page where you can listen for specific messages.  I plan on making a fairly complete API (REST) available so the program can be hooked really easily into SmartThings, Echo, HomeKit, etc.
 
Cheers,
Tag
 
Hi Tag,
 
Sorry to hear you are having RS485 troubles, but glad to hear of your other progress.
 
I looked at the datasheet for your cable, and was frustrated to see that it doesn't explain how the transmitter is enabled. I have seen it done two ways.
 
The most common way is an "auto-transmit" mode, where data arriving from the host causes the driver to be enabled. The downside is that there is always a delay, once the data stops, before the transmitter is disabled again, and this can cause collisions.
 
The other way is to enable the transmitter with RTS. The downside is that the OS needs to support it. If that is how that cable works, then you might be able to get it to work by enabling hardware flow-control for your COM port.
 
By the way, does your cable have the visible LEDs? If so, do they do anything?
 
Another possibility is that the pool controller is hogging the bus. An RS485 bus with one master could have the master driving the bus anytime it is not expecting a response from a slave. I've used an RS485 receiver driving a bi-color LED as a way to snoop the bus for asserted and de-asserted (I've also used two comparators to detect "un-driven" as well, but that's more complicated).
 
good luck,
mark
 
Hi all,
 I do have some issue with the internal RTC of my intelliflow pump,
I'm able to control the pump over RS485 but if power loss occurs pump RTC looses current time, I wonder if there is a command to set the pump clock over RS485.
 
Thanks,
Francesco.
 
Frax74 said:
> ...I wonder if there is a command to set the pump clock over RS485.
 
Yes, there is a command that the controller sends out to all the equipment.  I imagine you can use this even if you don't have the controller, but you'll have to confirm that it works.  Date/Time command.
 
rocco said:
Sorry to hear you are having RS485 troubles, but glad to hear of your other progress.
Thanks for the help.  I was able to get this working (silly error on my side with the actual message... I was only able to discover it when I daisy chained two RS485 adapters together and could actually see the packet that was being sent). 
 
Working on the logic now to be able to recognize a response to a command that was just sent to determine if it was successful or not.
 
Hi Francesco,
 
Welcome to the discussion.
 
Frax74 said:
. . . if power loss occurs pump RTC looses current time . . .
 
Although a set-time function could be really useful, your problem might be a simple battery, although I don't know where it is. My pump sometimes looses power for a few days at a time (flakey GFI breaker) and it never looses time. So I've always assumed that there is a battery backup for the clock somewhere.
 
My pump is the (not-worth-the-extra-money) Intelliflo-VF, while most people have the Intelliflo-VS. Maybe the VS is different, and others with the VF might be able to verify.
 
I too have been looking at controlling my Intelliflo VS pump.  I am curious of why people are not using the Autelis for this?  There is a rather expensive device ($249) which is a bit more than I want to pay for this project.  But there is also a 'Universal RS485' box for only $129.  Is there a way to set up the simpler Autelis to do just the basic pump controls?  $129 seems like a reasonable price for a general purpose RS485 interface.   
 
Hi Blueman,
 
Welcome to the discussion.
 
I can't speak for anyone else, but I can tell you why I'm pursuing the DIY route that I am taking. My criteria was simple:
  • It must be fully autonomous. It should do what it needs (which is considerable) even when it is the only thing alive on the network.
  • It needs to be networked. I want to be able to check on it remotely, and also get email messages when there is an issue.
  • It needs to be able control some custom devices and use my own algorithms.
  • It must be inexpensive.
Because I have pool solar panels (Fafco), a laser-based pool filler (Banner), and a chlorine-free pool, none of the off-the-shelf controllers can do what I need. The choices were few, since only Pentair supports the pump. Also, I design industrial controls for a living.
 
BTW: Since the pool has a number of valves, and the valves are controlled and powered similarly to sprinkler valves, I'm also having it control my sprinkler system. I currently have it supporting 16 valves, although I may have to expand that.
 
Thanks, rocco!!  Makes sense given your priorities.  I am still considering just buying that Universal Autelis box for $129 and doing some snooping to find commands to control my VS pump.  I assume the commands to turn of the different preset pump speeds can be found somewhere.  Seems like an easier path to quickly get to VS pump control.  
 
Cheers,
 
Blueman2
 
Hi Blueman,
 
I believe that you can find most everything you need as far as the serial protocol is concerned in this thread. If you download Mike's software, you can be snooping on the bus in no time.
 
Blueman,
if you are strictly concerned with price, then you can pick up a Raspberry Pi and USB<-->RS485 adapter for under $40 and used the experience gathered by the fine folks here.  If you go with the Autellis box, you might be able to garner much of what you need to know, but you might also find unknown roadblocks (like being limited by a generic UI).  If you want ease of use, spend the $249.  If you want to DIY and save $$$, buy a RasPi and RS485 adapter.  My .02.  Tag
 
FYI, I released  new version of my code with write back just a couple of days ago (yes, finally)... 
FYI2, BlueMan, et al, my code focuses on controlling the entire pool system whereas Mike's is for controlling the pumps without a main pool controller.  Shameless plug: Github code
 
I'm going to put a (not quite as shameless) plug for Tag's code as well. I will probably use it as a starting point for my software. One difference is that I'm using a BeagleBone Black instead of a Raspberry Pi, so $20 more. The BBB comes with Node.js built in (as I assume the Pi does, as well), so running Tag's code  is pretty much a load-and-go.
 
tag and rocco, once again thanks for the advice.  
 
tag, I believe you nailed it.  I either go for the 'low cost / hobby' route and enjoy the learning aspects of this, or I go with the off-the-shelf autelis for $249.  I chose the former.  More fun and more flexible.  Already have 2 Pi's sitting around (old version and new version) so that part is done.   For now, I am only looking to control the VS pump.  I already have an Intermatic Multi-wave system that I control via z-wave using an ISY system.  I just need something to control the VS pump which the z-wave does not provide access to.  
 
So it begins....
 
EDIT: Which RS485 adapter is best?  USB to RS485 or TTL to RS485?  I assume both would work on the Pi, but would have different interface methods.  If the USB one, is there a particular model people are using here?  My goal would  be to leverage as much of the code developed here as possible without having to write my own interface code.  
 
EDIT2: Since I only have a Pentair VS pump and no Pentair control system, will Tag's code still work?  To complicate matters, I have my VS pump already being controlled by an Intermatic Multi-wave device.  Hopefully that will not cause conflicts.  
 
blueman2 said:
EDIT: Which RS485 adapter is best?  USB to RS485 or TTL to RS485?  I assume both would work on the Pi, but would have different interface methods.  If the USB one, is there a particular model people are using here?  My goal would  be to leverage as much of the code developed here as possible without having to write my own interface code.
 
I originally bought this one (EZSync ), but am actually having more luck with this much cheaper one (JBTec ).
 
 
blueman2 said:
EDIT2: Since I only have a Pentair VS pump and no Pentair control system, will Tag's code still work?  To complicate matters, I have my VS pump already being controlled by an Intermatic Multi-wave device.  Hopefully that will not cause conflicts.
 
If either system is actively controlling the pool, then you'll probably have issues.  If you are just passively reading/writing to it then it wouldn't theoretically be different from have two different control panels (I have a wireless, the pool controller, a wired, and now my app).  You just don't want to have the two systems conflicting.  
 
My code is based upon having a controller.  But you may find it really useful for seeing what codes are sent/received from the pumps.  The  big caveat is that the pumps respond differently when you are using a remote system vs directly interacting.
 
With a pool controller, it disables the pump panel then sends commands based on what is stored in the pool controller, and then checks N times per minute that it is still running the right program.  Without the pool controller, you would send a command to initialize the controller, program the speed (or run a stored program on the pump) and then let it do it's thing.  So the two are not necessarily interchangeable, but we are all learning from each other.
 
Tag
 
Back
Top