Control your Jandy equipment from your PC with a $15 adapter

Re: Control your Jandy equipment from your PC with a $15 ada

Let me temper my post by saying this thread is way beyond my scope of knowledge.

I run a storage facility and my gate controller connects to my computer using a serial connection (rs232). I had nothing but trouble using the USB to serial adapter. I found it far superior to install a serial port using one of the PCI slots on the computer. The difference in data transfer was similar to dial up vs high speed cable. What used to take 15 minutes to transfer takes about 30 seconds.
 
Re: Control your Jandy equipment from your PC with a $15 ada

VegasMike said:
So, now... how do I know if its sending good data or bad with this?
If you get output from running it in the default mode, then your RS485 connection is good. If you don't get output, then run it in raw mode. and see what comes out. you should see a lot of the sequence "1002" which is the data that starts every message in the Aqualink protocol. If you don't see that, then probably your wires are crossed.

The only purpose for posting this is to help you get the hardware connection working. I don't know what you ultimately want to do with this, but most likely you want to get agent-Ps stuff working. I have my own app, but it's tied to a lot of other equipment like sprinklers, lights, etc. that aren't relevant here. I just pulled the low level Aqualink code out of my app. If someone wants to write their own code and build on that then hopefully it is helpful.
 
Re: Control your Jandy equipment from your PC with a $15 ada

so as long as I am seeing data in default mode, all is good? I am def. getting data. So now I just need to port the "api" and commands over and we should be good.

Do you think this approach sounds right?

1.) Build a pool object to hold all the values
2.) Listen to the serial port for changes
3.) Make changes to pool object when the serial port says to
4.) Any time there is a change to the pool object send the object in JSON to the connected clients (on the html page)
5.) push changes from the html page to the serial port, when get an ack make changes to the pool object and repeat step 4

And I think thats basically it. What do you think?
 
Re: Control your Jandy equipment from your PC with a $15 ada

Basically that's the model that I am using with my home control app. I have the Aqualink interface implemented underneath my control objects for the pool equipment. I have other objects for the rest of the stuff I am monitoring and controlling and I have a web interface that updates status using JSON using periodic polls from the client.

The difficult part is implementing the Aqualink protocol. What you have to do is to emulate one of the panels that Jandy sells. The best one seems to be the AllButton panel as I have learned the hard way. The controller is the master and polls all the devices on the RS485 bus. You have to pretend to be a panel with a particular address and respond to messages sent to you with a simulated button press if you want to control any equipment. It's all very asynchronous. agent-P's aqualink.h file documents the commands and aqualinkd.c implements it. For a previous python implementation of mine, you can look at pool.py, panel.py, and allbuttonpanel.py in pyaqualink. My current implementation essentially uses that code. It's more complicated than it needs to be, but I haven't gotten around to cleaning it up.

Here's a screen shot of my web interface that summarizes the pool equipment, temperature, lights, doors, sprinklers, and solar power.
[attachment=0:aopuuxeq]192.168.1.51.png[/attachment:aopuuxeq]
 

Attachments

  • 192.168.1.51.png
    192.168.1.51.png
    286.4 KB · Views: 316
Re: Control your Jandy equipment from your PC with a $15 ada

Wow that looks really good! I fully intend on using the work you guys did to implement the panel. You guys did all the hard work. I am just glad to know that i was receiving messages properly. Now I will start seeing how to talk to the master properly using from your guys' code heavily. Thanks again for all the help.
 
Re: Control your Jandy equipment from your PC with a $15 ada

I have JBox with PDA version 2.6.1 and Aqualink Rev. MM.

I also wrote a sniffer (in java) but I see some differences in the behavior of the packets from what agent-P implemented in his C code.

I watch the 02 status and 00 probe packets coming from the master controller (device id 00)

The bits in the 02 status packet sent to the jbox never changes when a the pump or spa or lights are on and off. Agent-p's version parses bits in the 02 Status package

When I press keys on the PDA, I never see commands that match what Agent P sends in his code. For example I see 05/06 for key up and key down....different than agent-p's values.

When I tried to go the next step and implement my code as a remote, I set the device id to 0A (agent p's default). I power up the Aqualink and see all the probe packets sent by the controller. When the probe is sent to my device ID, I respond with a proper 01 ACK packet.

Later I see the jbox send an ack packet for its probe.

After that I never receive another probe nor status directed to 0A, my software. The master only probes and sends status to the jbox (60). And as stated above, the contents of that status packet never change even if I turn on/off pumps...lights...

Any ideas here? Should I disconnect my jbox? Maybe the controller ignores all other devices if it sees a jbox?

BTW, I appended earlier about open source home automation efforts and what a good fit this would be. At the time I was looking at OpenRemote. I since punted on that and now am running OpenHAB. My goal is to write a BINDING for openhab (hence I am using java here).

jbuehl homegrown panel looks real cool but I have no desire to custom right for every protocol, including zwave. Also I am an open source fan where cooperation and division of labor results in a richer system. OpenHab has iphone, droid and browser support and it has a very nice ui.
 

Attachments

  • openhap1.png
    openhap1.png
    31.4 KB · Views: 237
  • openhap2.png
    openhap2.png
    26.3 KB · Views: 230

Enjoying this content?

Support TFP with a donation.

Give Support
Re: Control your Jandy equipment from your PC with a $15 ada

djwocky - I am not familiar with the J-box, but here's what I think might be happening. There could be another command that they added later that is being sent to the 60 address that has the status. The 02 command contains what is just the state of LEDs on a panel device. The Aqualink protocol messages are very hardware dependent and when they come out with new hardware that has new capabilities they sometimes add new commands. This was the case with the One Touch panel that I have. Look at all the messages that are being sent to address 60 and see if there some with command codes that are not documented.

The controller should be constantly sending probes to devices. When you respond to the probe to your 0A address, make sure the checksum is correct and the start/stop bits are configured correctly. The controller is very picky about those. If it doesn't accept the ack, it should keep probing.

Regarding open source, I'm in favor of that. The screen shot of the homegrown panel I posted earlier is mostly a development tool for me. I haven't investigated any of the existing projects because I am lazy, but I plan to publish my stuff when it is more usable and contribute if there is a project that it fits with.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Thanks jbuehl I will check the stop bits as I am using javax.comm and now that I think of it, they didn't have an option for zero stop bits so you might be nailing it!

http://www.openhab.org/index.php/start/ is the open source project I am no using if you are interested. Like it so far. Stay away from openremote. Messed with that and gave up. One kicker there is they charge for the "professional designer" which certainly doesn't seem open to me :)

Thanks again!

Dave
 
Re: Control your Jandy equipment from your PC with a $15 ada

djwocky - I just started looking at openHAB and it looks very interesting. I had noticed it a while back, but I didn't look into it at the time. If I like it I may think about converting some of my stuff to java.

edit - I just checked and you want to be using 8N1, not zero stop bits.
 
Re: Control your Jandy equipment from your PC with a $15 ada

so I have the adapter setup, I am seeing data. Even the Simulator doesnt work. It will establish connection with master, but then what do you do with the emulator software from the zodiac site? I cant seem to control even from that.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Hi

Yes changed to 8 bits 1 stop bit when I saw your py code on git. Still no joy.

And like vegasMike, I see data when monitoring but the simulators don't work. The simulators just say "waiting for communication".

I am running 15 meters of twisted pair cable. Not attaching the ground shield but I think maybe I should?

I am going to ohm out the cable to make sure the Tx conductor isn't open.

I also ordered a 2nd 485 usb dongle since they only cost $1.84 on ebay.

Thanks
 
Re: Control your Jandy equipment from your PC with a $15 ada

djwocky and VegasMike - which particular emulators are you talking about?

djwocky - the Tx and Rx uses the same pair in the RS485 mode that Jandy is using, so if you can receive data then you will be able to transmit it. I don't know what type of adapter you have, but if you have one with separate Tx and Rx terminals you will have to put jumpers between the Tx and Rx. I have my T+ and R+ both connected to the blue wire, and T- and R- both connected to the white/blue wire. Here's a photo of mine. The green pair is not needed.
[attachment=0:3k1dai1r]RS485.JPG[/attachment:3k1dai1r]
 

Attachments

  • RS485.JPG
    RS485.JPG
    337.4 KB · Views: 230
Re: Control your Jandy equipment from your PC with a $15 ada

J,

Thanks for your reply.

These are the emulators I am using http://www.zodiacpoolsystems.com/~/medi ... lator.ashx

This is the 485 dongle I am using. I think its the same thing that n8huntsman used (the father of this thread)

http://www.ebay.com/itm/USB-485-USB-to- ... 485cea2b3b

My controller is an old HP T 5000 think client that I popped an old iPod Hitachi harddrive in. It also has a serial d connector but not sure if I need to abandon using the usb device.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Thanks jbuehl. My adapater and wiring looks exactly like yours. I get data from the aquadisplay.py you provided.

When I try to run pyaqualink, it will run the webserver and I can browse to the page. I need to install CherryPy, but I think i have other problems.

It seems you have the serial/interface commented out and thePool commented out. If I try to uncomment those I cant build/run it. Not sure if what is in github is supposed to be buildable. I def. didnt expect this much trouble with all of it.

Also, should you be able to put any address, or do I have to get it from the stream? Or is it a guess and check?

So to summarize, I see data, I can get a webserver running... but nothing else is really happening. I cant seem to receive anything that the programs are looking for.


Thanks again for all your help
 
Re: Control your Jandy equipment from your PC with a $15 ada

OK, I have updated the pyaqualink project at https://github.com/ericbuehl/pyaqualink to be somewhat useful. The last time I updated it I had begun to implement a web server UI on top of the protocol, but I went in a different direction and sort of abandoned that project. Sorry for the confusion. It includes an implementation of the human readable RS-232 protocol that is implemented in the very expensive Aqualink RS dongle, and that's what is now working.

The program to run is aqualinkRS.py. It will accept commands typed into stdin as documented in http://kb.homeauto.com/redirfile.asp?id=203. There are some exceptions noted in the README.md file. You can turn on various levels of debugging which is written to the log file aqualink.log by editing config.py.
 

Enjoying this content?

Support TFP with a donation.

Give Support
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.