Re: Control your Jandy equipment from your PC with a $15 ada
Just some notes for anyone who might be interested:
1. The aqualink.c code is an okay start, but the version I found did not close the loop on the protocol. In fact, it sent no ack packets at all. It might be okay for simple monitoring, but I already had that working so I never tested it.
2. A $15 USB/Serial adapter is fine if you just want to monitor, but you need to close the loop on the protocol with the master unit to command it. In fact, simple monitoring only works if there is another terminal that is closing the loop. If not, you will just see a series of command probes from the master. I tried a really cheap one with the Prolific chip set on both Mac OS X and Linux, and couldn't get it to send commands. Not sure if it was the device or the driver, but it wouldn't send commands. I tried a $60 dual ported USB adapter with LED tx/rx indicators with the FTDI chip set and it worked without issue. The dual port and the LEDs were great for closed loop testing and troubleshooting during initial coding.
3. My code works like a dream in Linux (Fedora Core 14) on a mini-itx VIA EPIA-M10000 Nehemiah with 1GB RAM I had lying around. The 1GB RAM was required for FC14. I had it running okay on Puppy Linux with 256MB, but I preferred Fedora Core. I didn't try Windows because I gave up Windows some years ago. I did try it on Mac OS X 10.6.x and 10.7.x. I could not get it to fully work. Monitoring worked flawlessly, but the protocol loop would not close consistently. Not sure if it was the driver or basic OS behavior, but I could not deque a single byte consistently which prevented me from responding to the master in the allotted time window. Note that the master will make three attempts to resend the packet if it doesn't receive an ack before it sends a command probe. I tried setting the process priority, but there was no effect. If someone else has this figured out, I would love to try it again on the Mac.
I ended up implementing a linux daemon with a self contained multi-threaded web server that serves the HTML/javascript client as well as the REST services for getting status and commanding the Aqualink master unit. One of my favorite features is the automated time synch. The Aqualink's internal clock drifts all over the place, and I hated resetting it through the terminal. Never more than 90 seconds off now (if you have to ask...). I have the javascript working in the iOS simulator, but the iPad doesn't command consistently. Should finish the whole thing in a few more weeks. If anyone is interested in seeing the code or an image of the javascript client let me know. I plan to post the whole package to source forge when it is at version 1.0.