-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running AqualinkD on PC wanting to control other equipment #152
Comments
Raspberry Pi OS has some very specific USB modifications to overcome the limitations on the Broadcom usb chip in the Pi 1,2 & 3. (and probably Pi 4 soon). So using that as a base distribution on anything other that a Raspberry doesn't surprise me that there are some serial/usb issues. AqualinkD can easily be compiled on any Linux distribution, so you'll probably be better off starting with a base Debain distribution on your PC. Other distributions are just as good, but Debain is the base of Raspbain (now Raspberry OS) so you may be more familiar with it. First thing I would do is spend more time looking at why your VSP can't be controlled by your panel, as you might find that the simplest option. As for writing something yourself, on the pump, that 4 wire cable is RS485 connection and you are correct, you should be able to control that via computer with a USB2RS485 converter. Few things to remember on the RS485 protocol, there can only be one master on the physical network and that has multiple slaves, the slaves can ONLY do bi-directional communication to the master not each other. The physical control panel has to be the master, and everything else is a slave (including AqualinkD). So if the control panel is NOT communicating with your pump correctly, you HAVE to have a separate physical RS485 network running for this to work, as you will need to make the software work as a master. I created a fork of Aqualinkd many years ago to do this for SWG, (Called AquapureD) so you could also look at that code. The Jandy & Pentair RS485 protocols are not difficult to understand (and your pump will use one of those) and the serial logger will tell you all the information you need to know. I did have a lot of documentation on these protocols, but had to remove it, but following the code posted in GitHub will show everything as well. Option 2 will lead you down a really difficult path, but first how do you intend on reading the display of the VSP? Using the pi to close circuits (pressing buttons) is easy, but reading the display would be the stumbling block. |
thank you for the rapid response. I was not assuming that the pump had a 485 bus and would use a protocol from one of the major manufacturers that the serial logger could be used on it. I will connect to that and revert back. to be clear the small control panel mounted on the motor does not have any connectors other than the one plug that goes to the motor's variable speed package. I was assuming they used a 2 device serial connection with a proprietary protocol and not a 485 bus with a known protocol. From systemctl status I get that the Aqualink control panel is version 6521 REV F the manual only covers 2 speed motors with no mention of variable speed, I will do the searches you suggest. thanks again |
Rev O & P are where VSP pumps start to get real support from the Jandy Control Panel. So you could consider a chip upgrade to get your panel to support it, as with rev F you won't be able to control any VSP from your panel. 2 speed pump control is a very different type of control than VSP, so I don't think you will get far on that option. I would be surprised if that interface is not RS485, (but can't say for sure as I don't have a Harris VSP). It's always a crap shoot talking to pool manufactures (and even dealers/distributers), but you might want to ask them "how to implement remote control" if the manual doesn't mention it. I did a few quick web searches, but didn't get much info on the Harris VSP's. |
thanks for the help. I hooked up the pump control panel to the 485 adapter. the serial logger would start but not complete. I also started aqualinkd with log level serial debugger. The log stopped after boot saying the adapter blocked attributes. I ran the command sudo -s eval 'stty raw -echo < /dev/ttyUSB0; cat -vte /dev/ttyUSB0' > serial_feed to capture the traffic and it did show the adapter was reading characters but no words or anything what you get mixed in running that command when hooked up to the Jandy control card. what I was getting was basically a repeating pattern of ^@M-+^@^A^@^B^@^A^B^@^B^@M-+^@M-+^@M-+^@M-+^@^A^@^B^B^@^A^@^B^@^A^B^@^B^A^@M-+^@M-+^@^@^B^@^BM-+^@M-+^AM-+^@^@M-+^@^@^B^@^A^@^BM-+^@^A^. This was with the pump control board powered up and not getting any response from the motor. As a next step I am going to create access to the Tx and Rx connections when the pump control panel is back connected to the motor and see if once the motor is responding the stream of characters makes any more sense. I will repeat patterns of turning the pump off and on and changing speeds to see if I can find patterns. If that does not do it I will try a direct serial connection without the adapter and repeat the exercise. thanks again PS I had already asked the manufacturer and they said the pump did not support any remote control and were unwilling to share protocols or design info. |
Are you running the right baud rate?
On 9 Nov 2021, at 12:51 pm, John ***@***.***> wrote:
thanks for the help.
I hooked up the pump control panel to the 485 adapter. the serial logger would start but not complete. I also started aqualinkd with log level serial debugger. The log stopped after boot saying the adapter blocked attributes. I ran the command sudo -s eval 'stty raw -echo < /dev/ttyUSB0; cat -vte /dev/ttyUSB0' > serial_feed to capture the traffic and it did show the adapter was reading characters but no words or anything what you get mixed in running that command when hooked up to the Jandy control card. what I was getting was basically a repeating pattern of ***@***.***+^@^A^@^B^@^A^B^@***@***.******@***.******@***.******@***.***+^@^A^@^B^B^@^A^@^B^@^A^B^@***@***.******@***.***+^@^@^B^@***@***.***+^AM-+^@***@***.***+^@^@^B^@^A^@^BM-+^@^A^. This was with the pump control board powered up and not getting any response from the motor.
As a next step I am going to create access to the Tx and Rx connections when the pump control panel is back connected to the motor and see if once the motor is responding the stream of characters makes any more sense. I will repeat patterns of turning the pump off and on and changing speeds to see if I can find patterns.
If that does not do it I will try a direct serial connection without the adapter and repeat the exercise.
thanks again
PS I had already asked the manufacturer and they said the pump did not support any remote control and were unwilling to share protocols or design info.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#152 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQUKQBU542HMVI63PPK5Y6DULB5C3ANCNFSM5HSTYT6A>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I have not considered baud rate yet. thank you for raising it as a variable to consider. I am only running the default baud rate on the adapter as it picked up the Jandy signals correctly out of the box. I do not have access to an oscilloscope to look at the signal but may investigate changing the rate on the 485 adapter and seeing if it changes anything. If there are any programs that cycle through baud rate settings on adapters and look for valid character strings that would be helpful. |
No worries. When Inhave seen that sort of stuff in the past it has generally been when the baud rate was different. It seems like you have comms but just not the right parameters set.
On 9 Nov 2021, at 1:18 pm, John ***@***.***> wrote:
I have not considered baud rate yet. thank you for raising it as a variable to consider. I am only running the default baud rate on the adapter as it picked up the Jandy signals correctly out of the box. I do not have access to an oscilloscope to look at the signal but may investigate changing the rate on the 485 adapter and seeing if it changes anything. If there are any programs that cycle through baud rate settings on adapters and look for valid character strings that would be helpful.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#152 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQUKQBTW5EZMJGY5MNYBWGTULCAJBANCNFSM5HSTYT6A>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Interesting what the manufacturer told you since their documentation clearly talks about remote control and the serial wiring, but I could not find real details on that. |
a few thoughts - How do i run serial_logger in raw mode? to the comment I do not have a master, The only electrical connection between the control panel on the motor and the variable speed drive package on the motor is the 4 wire connection. So if the 4 wire is power and a 485 bus then wouldn't one of the two parts have to be a master for the pump control panel to control the motor? in this case wouldn't the control panel on the motor be the most likely choice for the master? I have 2 USB to RS 485 adapters. with the labeling of the 4 wire adapter Tx and Rx I still wonder if it is straight serial and not a 485 bus If it was straight serial would my 485 adapter still read it? Does the fact that I do get characters mean it is 485? The characters I get with monitoring the raw feed from the adapter 'stty raw -echo < /dev/ttyUSB0; cat -vte /dev/ttyUSB0' are always a consistent pattern do you think this implies the baud rate is ok as mismatched baud rates would cause inconsistent dropping of bits? my Harris pump is a few years old and it has been two years since my interaction on remote control. Perhaps they have added to their new models. I think being able to monitor 2 way communication with the pump in operation will be very helpful. however that requires setting up outside and will probably take some time. thanks again for support |
running serial_logger without any parameters will give you a help message. On the master, (if this is RS485) then no it will be a slave device, and there will be no master at the pump. The panel/interface on VSP's (like SWG, chem feeders and intelligent heaters) has two modes. One mode the panel/interface is controlling the motor directly. The other mode "remote control" it reads commands from a master device ie "pool control panel" and acts on them. So in the first mode there is no real RS communication happening, so no master / slave signals. There are many RS485 devices that label the data lines as Tx and Rx so that's not necessarily an indication that it's not RS485. But it could be RS232 (ie standard serial), in which case the RS485 adapter would read but probably not able to write. RS232 is similar to 485 in many ways, but it can only support two devices communicating, which is probably why it's not usually used in pool equipment, as you have multiple devices that need to comunicate. RS232 for stable bi-directional communication also "usually" uses more that two lines. CTS/RTS/DTD etc. Since you have 2 RS485 adapters, one thing you could try (if you have windows 7) is download the Jandy RS simulator tools. They have a control panel that will send out all the RS485 probe messages, so if you connect one RS485 adapter to the Jandy Simulator and the pump, and see if you get any kind of connection, and if you do you might be able to then use the other RS485 adapter to sniff. But for that to work, you'd really need to confirm what the pump is going to talk on. As for the repeat messages, you really need to get the hex of them. Using |
just an update for anyone interested. I have done a few things and made some progress but it is clear this is a learning experience for me and while I may gain remote control of my pump in the end it will be a process. Perhaps useful to others wanting to integrate odd equipment to AqualinkD I removed the control board completely from its casing and found connection holes marked V, Gnd, A, B. and took a guess this might be a 485 connection. So I hooked up my adapter to those pin outs I did not get any response and the no leds on the pump local control board lit up. i reverted to the hook up I had used successfully before using the V Gnd Tx and Rx pins and had the previous behavior, I could receive data echoing the dev/ttyUSB0 I then creating a harness that would allow me to access the V, Gnd, Tx & Rx connections while the local pump control panel was connected to the pump motor. I then connected my 485 adapter to the Tx & Rx connections but did not connect V or Gnd as power was supplied to the local control board from the motor. With my adapter connected to Tx and Rx the pump operated normally but I did not get any output. I added the ground connections but still no data. Using a meter I found that the motor only supplied the local pump control with circa 2V and suspect the pin voltage when the devices are connected is too low to drive the adapter. It is possible that the load of the volt meter is depressing the voltage and the board is operating at 3.3v Regretfully I did not check the voltage of the connection with the A, B, designation when I had the access. When I was accessing the local control board by itself I was powering it with 5v from the adapter. I am fortunate it seems no harm done. I have purchased an inexpensive ($10) logic analyzer to help and it did capture data with the local control panel connected to the motor. Using the visualizations of the logic data from open source Pulse View by sigrok I have determined that the local control communicates with the motor at 9600 baud with the Tx and Rx lines operating independently not differential voltage as found in 485 I pulled several samples of data and I am analyzing them now. What I started with was observing a condition of power on to the control system and pump off with no buttons pushed for 3 minutes. The control board had a repeating pattern of 9 data / idle pairs. 8 of the data messages were identical but the 9th and final one was slightly different. all 9 data messages were the same length 5 bytes with 1 through 8 being AB, 00, 00, 00, 00 in hex and 9 being AA, 82, 92, 00, 00 but the idle periods in between varied. The pattern of the idle period length was consistent from cycle to cycle. The motor did not send any communication to the motor during this capture I have created sample where I only cycle the motor on and off. This does create messages from the motor and new messages from the local control panel that I am reviewing now. My go forward plan is to capture the command exchange and program a PI Zero to mimic the local controller commands and mimic a 485 device to AqualinkD I am assuming the PI will replace the local control panel. Once I have a few command / response elements identified I will cross reference with Jandy/Pentair protocols but I am suspecting the manufacturer as opted for as common of a variable speed control as possible and not made any allowances for a pool application. Please advise if these updates are of any interest or should be posted somewhere else. This is definitely not an AqualinkD issue and I have appreciated your advice and support. |
I'm interested as I'm curious in where this ends up going for you. I also have a Pentair pump and it stopped communicating recently with my Jandy PDA chip. I think it is due to old wiring that may have failed and I am replacing the Pentair cable soon. In any case, since your situation is similar-ish to mine I'd like to know what you end up doing. |
An update on my approach and progress. Comments and suggestions requested. @shaun - I am more than happy to move this to the new equipment sub-forum if you prefer. As always thank you for a great project and I hope this can end up being some contribution to AqualinkD. I am using a $10 FX2LP based 8 channel 24 mhz logic analyzer from Amazon and PulseView, open-source software by sigrok. It comes with a protocol analyzer for UART communication that is decoding the communication between the pump control and motor variable speed package. A word of caution on inexpensive logic analyzers. On the one I purchased channel 0 had a defect and led me to some incorrect conclusions about the motor not responding to every control message before I started using different channels. I realize I have reached at least 1 incorrect conclusion about the communication. That one I have corrected but there is a good chance there will be more before the work is complete. I like to think I am using an agile approach of creating an incremental way forward, getting a result, refining the way forward. I have not decided at what point I should try to configure and execute a prototype controller. Prototype could do motor data collection to aid in decoding. Any experiences / suggestions appreciated. At a high level my current approach is a variation on the RS485 logging approach defined by Shaun on the logging and new equipment sub-forum: Establish a base set of conditions to monitor Controller functions and planned condition sets for data capture 02 - Pump on high-speed 3100 RPM after prime no buttons pushed 82 second data capture 03 - Pump on 5 min high speed priming time out complete starting condition push stop 50 sec into 82 second data capture 04 - Pump off prime completed starting condition pushed high-speed start 3100 RPM 50 sec into 82 second data capture |
I believe I understand the basic get status, start and stop protocols and I would like to build a prototype to test that my data collection and data analysis process is sound. @shaun I would like your thoughts on prototype approaches. I can build a pi Zero that is a simple replacement app and integrates to AqualinkD via my home automation that uses the AqualinkD API in the future. or I can use my Pi 3 to run AqualinkD and the local control. To this set up I could add RS 485 Jandy or Pentair VSP emulation into the controller app in the future. Or I could possibly just replace connect to the controller with a TTL to RS485 adapter and use your defined process in the sub-forum for adding new equipment. |
I have looked on the website without success. Where can I find the Jandy or Pentair VSP motor control protocol definitions? i am moving ahead with the design that has the Raspberry Pi 3 perform motor control via serial communication with the motor control package and emulates a Jandy or Pentair motor on a separate 485 bus. |
I have a python program on the Pi that can send the appropriate serial commands to the pump speed control package using the GPIO pins of the Pi. This had some added complication because the controller protocol is inverted from normal and I had to find a program that created a configurable UART port to make it work. Soft_UART did the trick. I am a bit undecided on implementing the integration with AqualinkD as my idea requires understanding of the Jandy or Pentair protocols that I don't have. Since my Pi has wifi access and is a separate device with a separate ip address from my aqualinkD host it will be much more straightforward to just have a pump mini-page |
I also wonder if my board REV F will support the Jandy or Pentair VSP protocols? |
No is doesn't. VSP came in rev O or P if I remember correctly. |
thank you for the response. I think the API method you described is the best way forward. If you could share the way to have the plug in that would be most appreciated |
In
Then create a directory Below is the content of that file, that produces the UI a few posts above. (obviously you need to add the icons in that directory as well).
The above is using Domoticz API, and written in a generic way to see what type of device Domoticz returns and create the tiles appropriately. So a lot more complicated than you would need. Import parts are. setTimeout function. This is what would poll your python program for information. in this example it calls extra_domoticz function. That function all the Domoticz api, and passes the return. it calls extra_updateDevice which will either update or create the tile if it's not their. That's the flow, you shouldn't need to modify any AqualinkD code. |
thank you very much for this. I have family in for the holidays and will try in a week or so. Merry Christmas Shaun! |
First let me say thanks again for your work in progressing AqualinkD. My Raspberry Pi was knocked out in a lightning storm and I decided to reinstall on an unused laptop I happened to have. I loaded up the latest version of the Raspberry Pi OS that you can use for an x86 PC and I installed AqualinkD. I used the Make option to install and while I received several warning messages all seems to work fine. I found you had put in the instructions how to make the serial_logger. I used make slog to make a working version of the serial_logger The serial_logger found addresses but did not report my panel version or model.
The reason I am posting this issue is that I have installed a Harris Variable Speed pump and would like to add control of the pump. The pump does not support external control as delivered but the control panel mounted on the motor is accessible. If the power to the pump is off for an extended period of time it does not automatically start on the last setting. So even my on off control of the pump via AqualinkD is not reliable. I have two approaches possible and would like your advice on the better way to proceed.
`1. The panel communicates with the variable speed motor through a 4 wire cable +5v GND Tx Rx I think I could attach to this and sniff communication and potentially replace the manual panel with a PI Zero based controller that could send serial messages to the motor and link to AqualinkD or at least be controlled from the same PC
I have limited amount of experience in sniffing protocols and more experience with making simple controllers so the second option seems more straightforward to execute but not as elegant
`
The text was updated successfully, but these errors were encountered: