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

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

VegasMike,

One other note. The revision of the Aqualink firmware matters. I designed all of the message decoding around my rev, rev. A, I think. Also, the Aqualink terminal address you choose also matters. Some of them are reserved for different types of terminals, and those message streams can also depend on the firmware revision. There is a config file where you can set a low log level to see all of the Aqualink messages and the daemon's error and warning messages. Good luck. I will answer any questions that I can. Don't hesitate to ask.

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

Ok, I am going to get down to it. I am still not totally understanding the hardware aspect (or the software aspect for that matter).

What I got at Frys - hopefully it works or I will order what you guys are suggesting:

I got a USB -> RS232.
then I got a RS232 -> RS485 and with it came a little board with D-, D+ and GRD

I will take pictures and ask questions I am sure.

What i currently have is a newer system with Jandy Aqaulink PDA Handheld device. It takes so long to connect and is probably one of the most annoying things I have ever used.

So going into the control box outside is the antenna for that with a gray wire going into the box. I will unscrew the faceplates and see if I can find out where it goes in to. If I am understanding I would find where that antenna goes in and replace that with this adapter? Or is it a different place altogether.

jbuehl, is your checked in code the most recent or at least worth cloning into and taking a look at?

Thank you both for the help.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Also, agent-P would you please share your latest with the many enhancements? I think the websocket is the way I would like to go for sure, and I can get libwebsockets going. So if I am able to build yours I think I will have half the battle done.

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

VegasMike - I'm not familiar with that Aqualink controller. Mine is about 10 years old and has hardwired panels and those are connected via RS-485. Probably the antenna connection is not the same. Post some pictures.

If you are talking about the code I checked into github, it's worth looking at. I don't remember exactly what it did, though. I am currently using a different version that fits into a home automation system I am developing, so it's not usable standalone.
 
Re: Control your Jandy equipment from your PC with a $15 ada

IMG_1073.JPG


Here is a picture of the panel outside. I am thinking the Red place where 4 wires are going in is where I am interested in?

Edit: Let me know if I should zoom out or any other pictures you would be interested in. I really appreciate the help.
 
Re: Control your Jandy equipment from your PC with a $15 ada

IMG_1074.JPG


And here is the connector I got. If I am understanding I am going to take wires out of a Cat5 cable to connect to the middle 2 screws in the Panel. I have a D+, D- and Ground. So which wires will go where?
 
Re: Control your Jandy equipment from your PC with a $15 ada

VegasMike,

Like jbuehl I am also working on a larger automation system. The web socket interface is simply a command and telemetry stream for the Aqualink. You don't have to use the javascript client to use the server, but by default if you hit the device's default url the daemon will serve up the javascript client for convenience. Also, the code is segregated enough to separate out the Aqualink interface from the web socket server, and simply implement a pure socket interface. Which is how I had originally implemented it, but it was inconvenient for implementing a self-contained web application.

In any case, I will post the latest code to github and post a link here when it is done. Also, I am working on a RPi version, but am targeting wheezy not raspbian. I will post a note here when it is working. I am simplifying the daemon and using Grizzly to serve up the web sockets and the web app. The daemon will remain in C, and the rest will be in Java with a simple socket connection between the two.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Awesome! Thanks, Let me do that and play with the emulator at the very least. Jbuehl, you mentioned you used a make file when you were trying to build agent-P's code. How do you do such a thing? Is it just because you are more familliar with compiling in c?

Thanks again.
 

Enjoying this content?

Support TFP with a donation.

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

I vaguely remember doing something with a makefile, but not because I knew what I was doing :) agent-P would be far better qualified to help you get his code running than I am.
 
Re: Control your Jandy equipment from your PC with a $15 ada

So here is what I am trying - I have no idea how far off I am:

gcc -o aqualinkd aqualinkd.c aqualink_menu.c aqualink_temps.c aqualink_time.c globals.c json_messages.c logging.c websocket_server.c -I ~

/tmp/ccOWwwOJ.o: In function `process_packet':
aqualinkd.c:(.text+0x172c): undefined reference to `pthread_create'
aqualinkd.c:(.text+0x17c0): undefined reference to `pthread_create'
aqualinkd.c:(.text+0x17f4): undefined reference to `pthread_create'
/tmp/ccOWwwOJ.o: In function `main':
aqualinkd.c:(.text+0x1a84): undefined reference to `libwebsocket_create_context'
aqualinkd.c:(.text+0x1bbc): undefined reference to `libwebsockets_broadcast'
aqualinkd.c:(.text+0x1bd0): undefined reference to `libwebsocket_service'
aqualinkd.c:(.text+0x1c88): undefined reference to `libwebsocket_internal_extensions'
/tmp/ccVuv4nI.o: In function `get_pool_spa_htr_temps':
aqualink_temps.c:(.text+0xdc): undefined reference to `pthread_detach'
/tmp/ccVuv4nI.o: In function `set_pool_htr_temp':
aqualink_temps.c:(.text+0x220): undefined reference to `pthread_detach'
/tmp/ccVuv4nI.o: In function `set_spa_htr_temp':
aqualink_temps.c:(.text+0x374): undefined reference to `pthread_detach'
/tmp/ccVuv4nI.o: In function `get_frz_protect_temp':
aqualink_temps.c:(.text+0x4c8): undefined reference to `pthread_detach'
/tmp/ccVuv4nI.o: In function `set_frz_protect_temp':
aqualink_temps.c:(.text+0x60c): undefined reference to `pthread_detach'
/tmp/ccD3G9VV.o:aqualink_time.c:(.text+0x624): more undefined references to `pthread_detach' follow
/tmp/ccdus6jL.o: In function `set_parameter':
websocket_server.c:(.text+0x14c): undefined reference to `pthread_create'
websocket_server.c:(.text+0x184): undefined reference to `pthread_create'
websocket_server.c:(.text+0x1bc): undefined reference to `pthread_create'
/tmp/ccdus6jL.o: In function `callback_http':
websocket_server.c:(.text+0x2d8): undefined reference to `libwebsockets_serve_http_file'
websocket_server.c:(.text+0x388): undefined reference to `libwebsockets_serve_http_file'
/tmp/ccdus6jL.o: In function `callback_dumb_increment':
websocket_server.c:(.text+0x484): undefined reference to `libwebsocket_write'
websocket_server.c:(.text+0x518): undefined reference to `libwebsocket_write'
collect2: ld returned 1 exit status
 
Re: Control your Jandy equipment from your PC with a $15 ada

Here are the make files created by Eclipse. It does have 3 libraries it links to. Forgot about those. The files say not to edit, but you will have to for some specific paths. Anyway, here they are:


Note, had to add a ".txt" extension so I could upload them. Delete the extensions before using, and edit as necessary for your file paths.
 

Attachments

  • makefile.txt
    1 KB · Views: 49
  • objects.mk.txt
    261 bytes · Views: 26
  • sources.mk.txt
    392 bytes · Views: 29
Re: Control your Jandy equipment from your PC with a $15 ada

So, I figured out my problems. A couple of the calls in there are deprecated and not used in the libwebsockets lib anymore. So I have replaced those. I am so close! When i get everything figured out I will reupload the zip file with a new readme. Thank again for all the help.

aqualinkd.c: In function ‘main’:
aqualinkd.c:789:35: error: storage size of ‘info’ isn’t known
aqualinkd.c:802:9: error: too few arguments to function ‘libwebsocket_create_context’
libwebsockets.h:578:1: note: declared here

I tried ripping out the create_context from their sample server... so I am confused as to why it isnt working right.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Ok, so here is what I have done on the hardware side. I am having a heck of a time.

1.) I cut the ends off of a Cat5 cable. I stripped the ends off the brown/white and twisted them together. I stripped the end off teal/white and twisted them together

2.) I put the brown/white in the 2 port on the panel (reference picture from earlier). I put the teal/white in the 3 port.

3.) I removed the red/green so I have only 2 ports being used in that 4 port switch.

4.) I connected the wires to the RS485 board and connected it to my PC.

5.) I ran the Jandy Simulation program

I get cannot establish connection with power center

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

There are 4 pairs of wires in the CAT5 cable. Each pair is designated by a color (blue, green, orange, or brown) and white. For example, one pair consists of the blue wire with white stripes and the white wire with blue stripes. You should be using one of those pairs to connect the terminal block in the controller to the RS485 device. You shouldn't be twisting anything together.

What do you mean by the "4 port switch"?
 
Re: Control your Jandy equipment from your PC with a $15 ada

ok, so there are the pairs of wire like you said. I removed the plastic and twisted the copper around each other for 2 of the pairs

I then took one pair and put it in D+
I took the other pair and put it in D-

If you look in my picture above on the panel you will see that Red thing.

I took out the wires that were in there (Green, Yellow, Black, Red)

I put my wires in there.

Connected the adapter to my PC - cant connect.
 
Re: Control your Jandy equipment from your PC with a $15 ada

You should not remove the wires that were in the red connector (Green, Yellow, Black, Red). Leave them there.

Don't use 2 pairs in the CAT5, just use one. Let's say it's the blue pair. Connect just the blue wire to terminal 2 on the red connector. Connect the white wire with blue stripes to terminal 3. On the other end of the cable, connect the blue wire to D+ on your RS485 adapter and connect the white/blue wire to D-. The other 6 wires in the CAT5 cable aren't connected to anything.
 

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.