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

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

jkurl & johnyri - I don't want to spend much money, so the Raspberry Pi is a good choice, although they are sometimes hard to get. I could use an old PC running linux, but I don't want another box with fans running in my house. I'm trying to decide where to put the RPi - in the Aqualink box by the pool, in the Aqualink control panel box in the wall, or in a closet somewhere. Putting it outside would require running an ethernet cable to the box, and I don't feel like crawling under the house. Wireless would be a good solution, but I have already found that wifi dongles pull more power than the RPi provides on USB, so it either needs a powered hub or a hardware mod. There's a discussion somewhere on the Raspberry Pi forum that talks about that.

For me, half of the reason I'm doing this is to have a fun software project.

<edit> Duh - I just realized that wireless isn't an option in the metal box. The plastic controller box isn't big enough, so the closet is going to be the best option.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Humm a powered hub would work but would be slightly to big for the RPi and router in the same box. Could try doing a serial or use conversion to cat5 and that might be enough to power it w/out more power. With the RPi in the same box as my router I don't think I would need any extra amplification of the signal if I hook directly into the router. The picture below is what I am using outside. Now that I think about it I may not have enough room either.

uqamyva5.jpg

Sent from my HTC One X using Tapatalk 2
 
Re: Control your Jandy equipment from your PC with a $15 ada

OK, I now have the RPi in the closet where my network equipment is. I used an abandoned piece of CAT5 that runs under the house from there to near the Aqualink control panel. It seems to matter which conductors in the CAT5 you use. That cable is about 40' long and the data was garbled until I used a twisted pair for the data +/- (black/yellow). Any other wire can be used for ground (green), and the power (red) doesn't have to be connected.

Jandy - CAT5
black - blue
yellow - blue/white
green - green
red - nc
 
Re: Control your Jandy equipment from your PC with a $15 ada

jbuehl said:
jkurl - What goes in that box that you posted the picture of?
It will be a wireless router and was gonna be the autelis controller but I moving towards the RPi. The box has 120VAC ran into it so I will good for power. I will have less of a run that way and I should be able to use the network jack on the router and RPi to communicate W/ any device on my network as long and I get it configure right

Jbuehl-can you do a quick drawing of you RPi system or post some pics so I can get a visual on your hook up.

Jerry
Sent from my HTC One X using Tapatalk 2
 
Re: Control your Jandy equipment from your PC with a $15 ada

jbuehl said:
agent-P, I haven't been able to build your project successfully on arch linux yet. I need to find source for libwebsockets that includes libwebsocket_internal_extensions, which is showing up as an undefined reference. I built libwebsockets from source that I got from here http://git.warmcat.com/cgi-bin/cgit/libwebsockets/, but the 0.5 release doesn't define that symbol and the 0.6 release, which does, is missing the Makefile stuff from the tarball. I see that Fedora 17 has a package available called jetty-websocket, but I haven't located the source for that one yet. Any suggestions?

jbuehl,

I had trouble building libwebsockets also at first. I ended up creating an Eclipse CDT project for the libwebsockets src, and it built fine. I did need to add a library, though. I don't remember which, off the top of my head. You should be able to download Eclipse CDT for Arch Linux. If you do that I will send you my project directories. It should just build at that point. Let me know if you want to try that.

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

agent-P said:
jbuehl said:
agent-P, I haven't been able to build your project successfully on arch linux yet. I need to find source for libwebsockets that includes libwebsocket_internal_extensions, which is showing up as an undefined reference. I built libwebsockets from source that I got from here http://git.warmcat.com/cgi-bin/cgit/libwebsockets/, but the 0.5 release doesn't define that symbol and the 0.6 release, which does, is missing the Makefile stuff from the tarball. I see that Fedora 17 has a package available called jetty-websocket, but I haven't located the source for that one yet. Any suggestions?

jbuehl,

I had trouble building libwebsockets also at first. I ended up creating an Eclipse CDT project for the libwebsockets src, and it built fine. I did need to add a library, though. I don't remember which, off the top of my head. You should be able to download Eclipse CDT for Arch Linux. If you do that I will send you my project directories. It should just build at that point. Let me know if you want to try that.

agent-P

The Arch linux distro for the RPi is very minimal, which is why I'm using it, but it doesn't have a GUI, so I have to do everything in a command shell. There are other distros available, including Fedora, but last time I tried that it was flakey. I'm building your project with a Makefile. If you can point me to where you got the source for libwebsockets I can build that.
 
Re: Control your Jandy equipment from your PC with a $15 ada

jbuehl,

Got the libwebsockets code from the same place you did. I had no end of trouble with their "builds on any platform" install script. I can post my binary of the library I built in FC14. I don't know how different Arch and FC are. Might work. Do you want to give it a try?

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

agent-P said:
jbuehl,

Got the libwebsockets code from the same place you did. I had no end of trouble with their "builds on any platform" install script. I can post my binary of the library I built in FC14. I don't know how different Arch and FC are. Might work. Do you want to give it a try?

agent-P

The RPi has an ARM processor, so an x86 library won't work. Where is their install script? The versions 0.5 and earlier use the standard ./configure;make;make install method, but 0.6 is missing the files to enable that, although the INSTALL document still says to do that. I'm not seeing an install script anywhere in the warmcat.com git repository.
 

Enjoying this content?

Support TFP with a donation.

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

jbuehl,

Not sure what version I have, but it is compiling and linking fine using ./configure and make. I never did the install. I made the Eclipse CDT project so I could create a static library to link my daemon to, so I wouldn't have to install the shared lib on the target machine, just copy over the daemon.

Anyway, did you get any errors when you ran ./configure? Or did it error just during make? Not sure what I did with the original download. I will look around for it, and see what version it is. I downloaded it over the Christmas holidays. So, it has to be fairly recent.

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

agent-P said:
jbuehl,

Not sure what version I have, but it is compiling and linking fine using ./configure and make. I never did the install. I made the Eclipse CDT project so I could create a static library to link my daemon to, so I wouldn't have to install the shared lib on the target machine, just copy over the daemon.

Anyway, did you get any errors when you ran ./configure? Or did it error just during make? Not sure what I did with the original download. I will look around for it, and see what version it is. I downloaded it over the Christmas holidays. So, it has to be fairly recent.

agent-P

The 0.5 version that I first built was missing the symbol libwebsocket_internal_extensions. I missed that it wasn't the latest version and saw that it was added in the 0.6 version, but that tarball http://git.warmcat.com/cgi-bin/cgit/lib ... 0.6.tar.gz is totally missing important files like configure and Makefile. Something is screwed up, I think.

In the meantime I have been working on my python program. I have it where I can monitor the air and water temps. It's a daemon that reads the serial data and provides a web server to display them. Not websockets, just javascript that refreshes the page periodically. I'll post it if anyone is interested.
 
Re: Control your Jandy equipment from your PC with a $15 ada

jbuehl,

Tried that refresh technique in my first attempt back in September. Lots of overhead. Works okay on a desktop, but was really poor performance on mobile devices when the display had any complexity.

Don't give up on websockets just yet. It really is the best way to do this kind of app. You can try to copy your lib directory from version 6 into your version 5 replacing the version 5 lib directory. I can't think of any reason why it won't work. Though, if it doesn't, I will tar up the working version I have and you can give that a try. In the mean time, I will do a little research on your build problem.

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

jbuehl,

I looked through the version 6 scripts. Did you try running ./autogen.sh? It prepares your build system, and I believe it generates the config files. I am virtually certain I have version 6, and I think that is how I got it to work. I haven't used it since I use CDT to build a static library. So, I am having trouble remembering exactly what I did. I shut my dev server down for the evening, but I will try to build version 6 from a clean tar tomorrow. If you have the time you might want to give it a shot. Hope this helps.

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

agent-P said:
jbuehl,

I looked through the version 6 scripts. Did you try running ./autogen.sh? It prepares your build system, and I believe it generates the config files. I am virtually certain I have version 6, and I think that is how I got it to work. I haven't used it since I use CDT to build a static library. So, I am having trouble remembering exactly what I did. I shut my dev server down for the evening, but I will try to build version 6 from a clean tar tomorrow. If you have the time you might want to give it a shot. Hope this helps.

agent-P

Silly me, I assumed that the install documentation they provided was accurate :rant: autogen is new to me so I didn't think to try that. Well I ran it and it failed. I don't know if the locale messages it is complaining about are causing it to die or if it's something else. Googling the error message didn't turn up anything. You mentioned that you had trouble with it as well. Was it the same thing?

Code:
[root@alarmpi libwebsockets-release-0.6]# ./autogen.sh 
Preparing the libwebsockets build system...please wait

Found GNU Autoconf version 2.69
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_COLLATE = "C",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_COLLATE = "C",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Found GNU Automake version 1.13.1
Found GNU Libtool version 2.4.2

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... ERROR: aclocal failed
 
Re: Control your Jandy equipment from your PC with a $15 ada

jbuehl said:
agent-P said:
jbuehl,

I looked through the version 6 scripts. Did you try running ./autogen.sh? It prepares your build system, and I believe it generates the config files. I am virtually certain I have version 6, and I think that is how I got it to work. I haven't used it since I use CDT to build a static library. So, I am having trouble remembering exactly what I did. I shut my dev server down for the evening, but I will try to build version 6 from a clean tar tomorrow. If you have the time you might want to give it a shot. Hope this helps.

agent-P

Silly me, I assumed that the install documentation they provided was accurate :rant: autogen is new to me so I didn't think to try that. Well I ran it and it failed. I don't know if the locale messages it is complaining about are causing it to die or if it's something else. Googling the error message didn't turn up anything. You mentioned that you had trouble with it as well. Was it the same thing?

Code:
[root@alarmpi libwebsockets-release-0.6]# ./autogen.sh 
Preparing the libwebsockets build system...please wait

Found GNU Autoconf version 2.69
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_COLLATE = "C",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_COLLATE = "C",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Found GNU Automake version 1.13.1
Found GNU Libtool version 2.4.2

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... ERROR: aclocal failed

I don't remember the exact error, but my linux distro was missing some dev tools. I don't remember the name of the package. I did a quick yum install of the package, and problem solved. Not sure if arch uses yum. I was missing a shared library as well. It gave a much more obvious error message. Make sure you have a full set of the latest version of dev tools and libraries installed. In the mean time I will look back in my browser history to see if I can find the package name.

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

agent-P said:
I don't remember the exact error, but my linux distro was missing some dev tools. I don't remember the name of the package. I did a quick yum install of the package, and problem solved. Not sure if arch uses yum. I was missing a shared library as well. It gave a much more obvious error message. Make sure you have a full set of the latest version of dev tools and libraries installed. In the mean time I will look back in my browser history to see if I can find the package name.

agent-P

I had to install some packages to get to that point. If something is missing, it's not giving me a hint as to what it is.

I might try getting your stuff running on Fedora just to see if I can get something working. I have my python program working pretty well now which monitors the messages being sent to my panel from the controller. I just realized today that your program is emulating the All Button panel, but I have the One Touch panel, so I need to do some additional reverse engineering. I can read messages, but if I try to send a message the controller does not respond. I'm still debugging it, but I think it's an issue with my RS485 adapter.

I noticed a potential bug in your code. When you are building the ack message in send_ack(), it's possible that bytes 6 or 7 could have the value 0x10, so a NUL character would need to be added after it to distinguish it from a DLE. Not the way I would design a protocol, but it is what it is. :?
 
Re: Control your Jandy equipment from your PC with a $15 ada

Thanks for the feedback on the send_ack() bug. I will look into it.

For your build problem, I looked back in my browser history, and, based on my searches, I didn't have the same problem you are having. Looking at the error messages you posted it looks like you are having trouble with broken locale settings. Have you tried running /usr/bin/locale? They can get corrupted if you ssh in from a box with big version differences. In any case my settings look like this:
Code:
$ /usr/bin/locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

On your command issue, I had the same problem with a $12 RS485-USB adapter. It would read, but wouldn't write. Are you able to close the protocol loop or are you reading the data stream of the one-touch? If you can close the protocol loop with an independent device id then your adapter is good, and you can concentrate on your code. If you are not closing the protocol loop, I would first test if you are sending at all.

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

Thanks jkurl - uncommenting the en-US line in locale.gen and running locale-gen got rid of the locale errors. Unfortunately autogen.sh is still crashing later on in the same way it did before. I ran it with the --verbose option and it's complaining that the ./m4 directory is missing. I ran it on a Fedora 14 system and it succeeded. The ./m4 directory isn't part of the distribution, it's something that autogen.sh should have created earlier, which it did on Fedora.

agent-P - I got your code built on Fedora 14 after building libwebsockets. When I run it, it daemonizes itself, and I can bring up the html page, but nothing is happening. I don't see a log file or lock file anywhere, and /var/www/html/log/ is empty. Should the log file be created in the working directory that I ran aqualinkd from?

I'm pretty convinced that the inability to transmit is an issue with the adapter hardware. I put an oscilloscope on the RS485 transmit lines and I could see data going out when I wrote to the device with a test program. I found some posts where others have had the same problem and they indicate that particular device may have termination problems. I did try ACKing a probe on a couple of different device IDs and never got a response from the controller. Obviously I need to get this resolved before your software can work.
 

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.