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

Status
Not open for further replies.
Re: Control your Jandy equipment from your PC with a $15 ada

IMG_1079.JPG


Here is what i got. Simulator still saying no connection.
 
Re: Control your Jandy equipment from your PC with a $15 ada

That looks good as far as the wiring goes. Does the gray cable go to a control panel by the pool or on the wall somewhere? Is that still working? If so, then the RS-485 communication is fine and you need to start looking at the software.

You can check if the serial port is being seen on the RPi. In a shell window, type "ls -l /dev/ttyUSB*". It should list the serial port.
Code:
# ls -l /dev/ttyUSB*
crw-rw---- 1 root uucp 188, 0 Jan  6 12:00 /dev/ttyUSB0

Usually it is /dev/ttyUSB0, but it may be something else that you have to tell the program about.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Ok, I was playing with the windows simulator. and it was saying couldnt connect. I just hooked up the RPi with the project I am working on and I am seeing a bunch of data scroll... It looks like a bunch of boxes (illegal chars) and x's. Do you think I have the wires crossed?
 
Re: Control your Jandy equipment from your PC with a $15 ada

That's good. You are getting data now. The wires may or may not be crossed, but either way it's going to look like garbage. You should be able to get agent-P's program working now.
 
Re: Control your Jandy equipment from your PC with a $15 ada

Like you, I wasn't able to get it running on the Pi. I will still try to compile yours - but like you guys, I decided to roll my own. I am using node.

So far I have written the server.js and serial.js

I am seeing the raw data so now its just porting your guys code over to it. Before you know it this thread will be filled with different ports of this stuff. BTW, here is some sample data I am seeing.. it seems to be repeating a lot. It just scrolls fast non-stop.

data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f8000000800000780080787800f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f80000008000787800f8787800f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f8000000800080f8780000f8f80000f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f80000008000f8f8780078f87800f800
data received: 0000800000f8f800007800807878007880f87800f80000008000007800000000
data received: f8000000f80000008000007880807800f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f800000080007878f8807800f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f8000000800080007800f87800f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f80000008000f8007878f87800f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f8000000800078f878f8f8f80000f800
data received: 0000800000008080800000f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f8000000800080787800f80000f800
data received: 0000800000f878007800807878007880f87800f80000008000007800000000f8
data received: 000000f80000008000f8787878f80000f800
 
Re: Control your Jandy equipment from your PC with a $15 ada

So the panel interface is RS-485 and that is what is connected to the combo WiFi/Ethernet adapter I have?

I was really confounded by that thing and more than a little annoyed that it required and internet connection to do anything. I'd been meaning to throw a sniffer on my network to see what it was up to but had not gotten around to it yet. Since the gadget is already on my LAN, is there some way I can go directly to it without the Jandy server? Just curious.
 
Re: Control your Jandy equipment from your PC with a $15 ada

As far as I know it doesn't require an internet connection. We just want to control it from internet connected devices.

We are connecting a computer to the RS485 port. There is a USB to RS485 adapter. Then you need to wire the adapter to the pool panel because it doesn't have a port, just a place to attach the wires.
 
Re: Control your Jandy equipment from your PC with a $15 ada

VegasMike - I haven't looked at pyaqualink in a long time, but I think I remember how it is supposed to work. You are running it correctly. It starts a web server that lets you display and maybe control some equipment. As I recall, it's somewhat specific to the equipment on my pool and definitely doesn't have the slick interface that agent-P's program does. Mostly it was a a prototype that I used to figure out how the Aqualink interface worked. Sorry it's not more useful.

What might be useful, however, is to use it to display the data going to and from the controller to make sure the connection is good. The RS-485 device is set in config.py and defaults to /dev/ttyUSB0. You can edit the file and change it if you need to. You can also set some of the debug flags to "True" and see a dump of the traffic in the log file, which defaults to aqualink.log. If debugRaw is true you will see all the low level data. If debugData is true you will also see the commands that are parsed from the data.

You mentioned using something called "node" to display data. I am not familiar with that. What does it do?
 
Re: Control your Jandy equipment from your PC with a $15 ada

just another programming language. I will turn logging on your program and see if I am getting real values. I am starting to think I maybe have a bad converter or something. Is there anything else it could be besides the connector? Are there any variables or anything I have to set properly?

here is what I have done so far - very small but the idea is that the web server already works with sockets. So I can connect, and the serial port is listening. So if it gets a message and a change that the user is interested in it will change the front-end site. Also, the front-end can send messages to the server which can push them onto the serial port. Very simple approach but I think it should work if I can decipher the serial port issue.
//Setup webserver
var app = require('express')()
,server = require('http').createServer(app)
,io = require('socket.io').listen(server);

server.listen(8181);

app.get('/', function (req, res) {
res.sendfile(__dirname + '/public/index.html');
});

io.sockets.on('connection', function (socket) {

socket.on('disconnect', function() {
});

socket.on('message', function(message) {
console.log(message);
});
});

//Start listening to the Serial port
var SerialPort = require("serialport").SerialPort
var serialPort = new SerialPort("/dev/ttyUSB0", {
baudrate: 89600
});

serialPort.on("open", function () {
console.log('open');
serialPort.on('data', function(data) {

//function to update poolEquipment object
console.log(data.toString('hex'));
io.sockets.send(poolEquipment);
});

// serialPort.write("ls\n", function(err, results) {
// console.log('err ' + err);
// console.log('results ' + results);// });
});
 

Enjoying this content?

Support TFP with a donation.

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

Is there anything special I have to do to get it to read the config? It seems when I load up your aqua server.py it ignores the config. Do you have to build python projects? Or is it literally just "python aquaserver.py"
 
Re: Control your Jandy equipment from your PC with a $15 ada

VegasMike said:
As far as I know it doesn't require an internet connection. We just want to control it from internet connected devices.

We are connecting a computer to the RS485 port. There is a USB to RS485 adapter. Then you need to wire the adapter to the pool panel because it doesn't have a port, just a place to attach the wires.

I should clarify. My Aqualink is already bridged onto my WiFi and I can see the device from my PC. However to connect to it I must go to the server at www.iaqualink.com which intermediates for me. If you've figured out how to direct connect to the thing without the RS-485 to 802.11 and the intermediating server can I possible connect to it via 802.11 (the device is there and working) and skip the www.iaqualink.com hooey?
 
Re: Control your Jandy equipment from your PC with a $15 ada

I am not sure because I would imagine the iaqualink stuff is parsing their messages on the firmware. So it is probably getting weird messages at that point. We are talking about doing this without any other hardware other than a PC and an adapter cable.
 
Re: Control your Jandy equipment from your PC with a $15 ada

VegasMike - Here is a standalone program to display the traffic on the RS485 interface. Remove .txt from the filename. It parses the messages that are being sent between your controller and whatever panels you have. In this example, my controller is talking to a SpaLink panel with address 0x22.
Code:
# python aquadisplay.py 
RS485           : opening RS485 port /dev/ttyUSB0 
RS485           : synchronized 
RS485           : ready 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 13 00  25 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 18 00  2a 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 19 00  2b 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 1a 00  2c 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 1b 00  2d 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 20 00  32 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 21 00  33 1003 
RS485           : --> 1002 22 02 005c569042 ba 1003 
RS485           : --> 1002 00 01 0000 13 1003 
RS485           : --> 1002 23 00  35 1003

It can also display the raw, unparsed data if you add the "raw" parameter:
Code:
# python aquadisplay.py raw
RS485           : ready 
RS485           : 10022202005c569042ba100300100200 
RS485           : 01000013100310024000521003100222 
RS485           : 02005c569042ba100300100200010000 
RS485           : 1310031002410053100310022202005c 
RS485           : 569042ba100300100200010000131003 
RS485           : 1002420054100310022202005c569042 
RS485           : ba100300100200010000131003100243 
RS485           : 0055100310022202005c569042ba1003 
RS485           : 00100200010000131003100210000022 
RS485           : 100310022202005c569042ba10030010 
RS485           : 02000100001310031002110023100310 
RS485           : 022202005c569042ba10030010020001 
RS485           : 00001310031002120024100310022202 
RS485           : 005c569042ba10030010020001000013 
RS485           : 10031002130025100310022202005c56 
RS485           : 9042ba10030010020001000013100310 
RS485           : 0218002a100310022202005c569042ba 
RS485           : 10030010020001000013100310021900 
RS485           : 2b100310022202005c569042ba100300 
RS485           : 10020001000013100310021a002c1003 
RS485           : 10022202005c569042ba100300100200
 

Attachments

  • aquadisplay.py.txt
    4.9 KB · Views: 190
Re: Control your Jandy equipment from your PC with a $15 ada

throwing an error.

RS485 : opening RS485 port /dev/ttyUSB0
Traceback (most recent call last):
File "aquadisplay.py", line 132, in <module>
i = Interface("RS485")
File "aquadisplay.py", line 38, in __init__
self.port = serial.Serial(RS485Device, baudrate=9600,
AttributeError: 'module' object has no attribute 'Serial'
 
Re: Control your Jandy equipment from your PC with a $15 ada

Also, you mention address 0x22. What exactly is that and how are you coming to that address? Am I supposed to "listen" at a certain address? How do I get the value?
 
Re: Control your Jandy equipment from your PC with a $15 ada

Ah, I forgot you need the python serial module. Are you doing this on your RPi or windows? If it's the RPi, try this:
Code:
# wget [url]https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz[/url]
# tar -xvf pip-1.3.1.tar.gz
# cd pip-1.3.1
# python setup.py install
# cd ..
# pip install pyserial
 
Re: Control your Jandy equipment from your PC with a $15 ada

VegasMike said:
Also, you mention address 0x22. What exactly is that and how are you coming to that address? Am I supposed to "listen" at a certain address? How do I get the value?
That just happens to be the address of my SpaLink controller. This program just listens in on whatever conversations are happening between the Aqualink controller and other devices. Depending on what device(s) you have, things will look different. It doesn't let you control anything.
 

Enjoying this content?

Support TFP with a donation.

Give Support
Status
Not open for further replies.