Plugwise and Linux

Plugwise Forum about Plugwise devices and the Source software.
Floppe
Starting Member
Starting Member
Posts: 15
Joined: Fri Jan 30, 2009 8:34 am
Location: Finland

Plugwise and Linux

Post by Floppe »

Do you know if the source stick still uses FTDI chip? My linux box does not find anything when I plug in the stick, other serial converters does work. lsusb does not list anything either.

EDIT: it works in my MythTV Frontend so to answer my question, yes it still uses FTDI.
Floppe
Starting Member
Starting Member
Posts: 15
Joined: Fri Jan 30, 2009 8:34 am
Location: Finland

Plugwise and Linux

Post by Floppe »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by mdamen</i>
<br />The latest work is done in my home automation software, not in the pol binary. If you want those sources let me know..
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

Hello Maarten.

I'm really interested in the source for how to read power used since last reading. I'm planning to build charts using rrdtool (probably cacti) and using current wattage for that is inaccurate when polling the devices in 5 min intervals.

Thanks for your fine work
// Floppe
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Mdamen »

@Foppe: I'll try to put something online for you this evening...

--
Maarten Damen

www.maartendamen.com
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Mdamen »

Foppe, can you fill in your e-mail address so I can e-mail you the sources?

--
Maarten Damen

www.maartendamen.com
Floppe
Starting Member
Starting Member
Posts: 15
Joined: Fri Jan 30, 2009 8:34 am
Location: Finland

Plugwise and Linux

Post by Floppe »

Maarten, I have now enabled emailing. Really excited about the sources :)
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Jfn »

Maarten,

the downloadlinks on your webpage for the python scripts are broken, can you fix them?
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Mdamen »

Download links fixed! Sorry for the inconvenience... And thanks for reporting.

--
Maarten Damen

www.maartendamen.com
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Jfn »

Maarten,

while awaiting the arrival of my Plugwise modules I tried to convert your python script to perl. I almost got it working, except for the calculation of the CRC-16 value.

After commenting out (in your script) the lines initializing the serial port and the lines writing/reading to/from it, I run your script as follows:

Code: Select all

python pol.py -p /dev/ttyUSB0 -o 000A1100003111AB
This should give me a CRC value of AC92, but when adding a print-statement at the end of the CRC calculating routine, I get this as a CRC value: 38F7

The complete string looks like this: 0017000A1100003111AB0138F7

Can you confirm that AC92 is really the correct CRC value, or is indeed 38F7 the correct value.

As soon as my plugs arrive I will try to sort it out myself, but I wanted my code to be finished before they arrive.
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Mdamen »

38F7 is indeed the correct value. I just checked it. Good luck with the rest of your perl script.

--
Maarten Damen

www.maartendamen.com
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Jfn »

CRC calculations are working.

Turned out that the ccittcrc routine from the Perl module Digest::CRC defaults to an init value of 0xffff when doing calculations, instead of 0.
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Plugwise and Linux

Post by Jfn »

From the string that Maarten supplied:

0024 000D6F00002366BB00003681 000457C8 01 85 <b><i>0000</i> <i>0473</i> <i>0007</i></b> 48B4253801F74D

I can add the following:

The part of the string in <i><b>bold/italic</b></i> is the hardware revision of the plug. The code above is typical for the Circle+. The normal plugs I have, have HW revision 0000 0440 0107.

The string I get back from my Circle+ looks almost the same as from Maarten's Circle+ :

<b>0024</b> <b>000D6F000037B4A7</b> <b>0000422C</b> <b>00044040</b> <b>01</b> 85 <b><i>0000 0473 0007</i></b> 48B4253801 <b>CAB4</b>

The parts of the string that are in bold or in italic more or less have a known meaning. Still looking for the rest.
LMJ
Starting Member
Starting Member
Posts: 1
Joined: Tue May 12, 2009 1:30 pm
Location: Sweden

Plugwise and Linux

Post by LMJ »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by mdamen</i>
<br />The latest work is done in my home automation software, not in the pol binary. If you want those sources let me know..
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

I'd also like a copy of that if it's possible.

/LM
solha
Starting Member
Starting Member
Posts: 5
Joined: Wed Apr 29, 2009 6:16 pm
Location: Portugal

Plugwise and Linux

Post by solha »

Hi all,

I'm thinking about developing an application which from time to time scans all the devices (detects them dynamically) on the Plugwise ZigBee network and reports specific info about each one to a file (which would then be read by other applications). One thing that is missing is the command or set of commands to do this device discovery. Anyone? The alternative is to store all the device ids and poll each one and get timeouts for the devices that are out of range or disconnected for some reason.

Thanks in advance
Woeka
Starting Member
Starting Member
Posts: 41
Joined: Tue Dec 09, 2008 12:50 am
Location: Netherlands

Plugwise and Linux

Post by Woeka »

Hi Maarten,

Somebody tuned up the private-msg-minimal-post-thingy up from 30 to 50 ... so have to go public with this one.

I've got myself a plugwise stick and circle+ today. Got it working on windows and was looking for your linux version. However there seems to be a mysql problem on your server.
Floppe
Starting Member
Starting Member
Posts: 15
Joined: Fri Jan 30, 2009 8:34 am
Location: Finland

Plugwise and Linux

Post by Floppe »

Hi all,

Does anyone know how to get 5min average readings from the plugs? I started to develop my own service which shall log all plugs to a MySQL database which Cacti (or other monitoring application) in turn shall read the data and graph it. However, I did not think this through as the log buffers only shows past hours, not the current hour.

Or maybe it's only possible to get 1hour average readings like the source software does.
Post Reply

Return to “Plugwise Forum”