Firmware version 2 Plugwise protocol and POL 2.0

Plugwise Forum about Plugwise devices and the Source software.
wusel
Starting Member
Starting Member
Posts: 19
Joined: Sat Jan 16, 2010 6:48 pm
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by wusel »

Mdamen wrote:I see you are using lowercase chars in your mac address... try uppercase. This might just be the problem.
Waaaa! Yeah, that's it!

Code: Select all

lenny:~/POL# date ; /root/with_timeout +15 python pol.py -p /dev/ttyUSB1 -w 000D6F00004BXXXX ; date
Mon Jan 18 18:10:16 CET 2010
12.8642627264
Mon Jan 18 18:10:16 CET 2010
lenny:~/POL# date ; /root/with_timeout +15 python pol.py -p /dev/ttyUSB1 -w 000D6F000059XXXX ; date
Mon Jan 18 18:12:17 CET 2010
12.8741645377
Mon Jan 18 18:12:18 CET 2010
cam-serv2:~/POL# 
Great! Thanks! So, since Firmware 2 does not seem to be around for the time being, I'll try to make a module for FHEM based on your description of version 1.

What irritates me: what is the internal measurement interval of the Circles, is this known? And which interval is best to use to query the Plugwise network? I get rather strange readings both with 1 second and 30 second intervals (59XXXX is a SheevaPlug plus one selfpowerd USB-Hub, an buspowered 2,5" HDD and some other USB gadgets; 4BXXXX is a T-Entertain IPTV receiver (Kiss/Linksys-OEM box)):

Code: Select all

lenny:~/POL# for i in `seq 1 10 `; do echo -n "`date` " ; /root/with_timeout +15 python pol.py -p /dev/ttyUSB1 -w 000D6F000059XXXX ; sleep 1 ; done
Mon Jan 18 18:15:22 CET 2010 12.8741645377
Mon Jan 18 18:15:23 CET 2010 10.7370886394
Mon Jan 18 18:15:25 CET 2010 10.7370886394
Mon Jan 18 18:15:26 CET 2010 12.8741645377
Mon Jan 18 18:15:28 CET 2010 12.8741645377
Mon Jan 18 18:15:29 CET 2010 12.8741645377
Mon Jan 18 18:15:31 CET 2010 12.8741645377
Mon Jan 18 18:15:32 CET 2010 12.8741645377
Mon Jan 18 18:15:34 CET 2010 12.8741645377
Mon Jan 18 18:15:35 CET 2010 12.8741645377
lenny:~/POL# for i in `seq 1 10 `; do echo -n "`date` " ; /root/with_timeout +15 python pol.py -p /dev/ttyUSB1 -w 000D6F00004BXXXX ; sleep 30 ; done
Mon Jan 18 18:18:03 CET 2010 19.2967838466
Mon Jan 18 18:18:33 CET 2010 19.2967838466
Mon Jan 18 18:19:07 CET 2010 19.2967838466
Mon Jan 18 18:19:41 CET 2010 19.2967838466
Mon Jan 18 18:20:12 CET 2010 19.2967838466
Mon Jan 18 18:20:42 CET 2010 19.2967838466
Mon Jan 18 18:21:13 CET 2010 19.2967838466
Mon Jan 18 18:21:43 CET 2010 19.2967838466
Mon Jan 18 18:22:14 CET 2010 19.2967838466
Mon Jan 18 18:22:47 CET 2010 19.2967838466
Somehow, I don't think it's resolution is beyond 1 Watt? And, playing with on/off with the T-Entertain box, I can actually produce energy ;)

Code: Select all

Mon Jan 18 18:47:30 CET 2010 12.8642627264
Mon Jan 18 18:47:41 CET 2010 12.8642627264     # python pol.py -p /dev/ttyUSB1 -o 000D6F00004BXXXX @ 18:47:43
Mon Jan 18 18:47:52 CET 2010 -0.0010449924251
Mon Jan 18 18:48:02 CET 2010 -0.0010449924251
[...]
Mon Jan 18 18:49:02 CET 2010 -0.0010449924251  # python pol.py -p /dev/ttyUSB1 -o 000D6F00004BXXXX @ 18:49:13
Mon Jan 18 18:49:15 CET 2010 6.43165311342
Mon Jan 18 18:49:28 CET 2010 23.5850820973
[...]
Mon Jan 18 18:50:21 CET 2010 23.5850820973
Mon Jan 18 18:50:31 CET 2010 21.4409378882
[...]
But that's most likely stuff for a new thread.

Thanks again, both for POL as well as getting me started!
-kai
--
Kai 'wusel' Siering, Blog: http://blogdoch.net/
daromer
Starting Member
Starting Member
Posts: 42
Joined: Sat Oct 24, 2009 2:41 pm
Location: Sweden

Re: Firmware version 2 protocol and POL 2.0

Post by daromer »

whats that wait_timeout ur using?

I have been trying to get such a function working in python but havent got it to work. Anything you want to share?
wusel
Starting Member
Starting Member
Posts: 19
Joined: Sat Jan 16, 2010 6:48 pm
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by wusel »

daromer wrote:whats that wait_timeout ur using?
It's something I use for about 10 years now, not sure where it came from, can't find a trace of it in Google and it's not even rocket science ;) I put it at http://blogdoch.net/images/with_timeout.c, don't know if it's of any use for you ...
I have been trying to get such a function working in python but havent got it to work. Anything you want to share?
... as I'm not that much into python; that one's in C ;) Just "cc -o with_timeout with_timeout.c" is all I usually do, every other year, when I need that funcionality somewhere.

HTH,
-kai
--
Kai 'wusel' Siering, Blog: http://blogdoch.net/
daromer
Starting Member
Starting Member
Posts: 42
Joined: Sat Oct 24, 2009 2:41 pm
Location: Sweden

Re: Firmware version 2 protocol and POL 2.0

Post by daromer »

How did it go with pol 2.0?
Floppe
Starting Member
Starting Member
Posts: 15
Joined: Fri Jan 30, 2009 8:34 am
Location: Finland

Re: Firmware version 2 protocol and POL 2.0

Post by Floppe »

Anyone figured out the rest of version 2 protocol?
paradoxi
Starting Member
Starting Member
Posts: 2
Joined: Sat Aug 08, 2009 11:54 am
Location: France

Re: Firmware version 2 protocol and POL 2.0

Post by paradoxi »

Any News about de version 2 and Pol 2.0 ?????

Tks
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by Mdamen »

I have reversed most of the v2.0 protocol. I have created a document (12 pages) describing the new protocol.
It's under review by someone (I won't call any names here :) ) right now. After he (or she) has reviewed it, I will release this document publicly.
zonique
Starting Member
Starting Member
Posts: 9
Joined: Wed Aug 11, 2010 12:06 am

Re: Firmware version 2 protocol and POL 2.0

Post by zonique »

Mdamen wrote:I have reversed most of the v2.0 protocol. I have created a document (12 pages) describing the new protocol.
That explains the radio silence ;) Can't wait to see the document and get my hands dirty!
YogiBear75
Starting Member
Starting Member
Posts: 24
Joined: Thu Dec 31, 2009 12:41 am

Re: Firmware version 2 protocol and POL 2.0

Post by YogiBear75 »

He Mdamen,

Any chance of giving me this document ?
I would like to get my hands on :)
The powerinfo in mWatts ;)

Ronald
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by Mdamen »

I just released the document for the general public, please have a look at: http://www.maartendamen.com/?p=359

Any feedback is greatly appreciated!
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by Digit »

Great job! And again, a lot of people will be very happy with this; indeed worth a donation :D
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by Bwired »

Good News :)
I was already working on a driver for Bwired and had some parts working.
but with the firmware changes from 2.0 and higher lost of things where changed again.
Specially current usage and history usage I could not find .....

So a deep bow for you Maarten, I quickly tried your functions in my program and its working :)
I have a perfect current and history usage now!

what I see is that I have the hour usage for the last hours,
But no usage for the current Hour, so lets say its 21:20, I want the usage for the 20 minutes.
But I have to wait till 22:00 to get the usage from 21 till 22:00.

I guess its stored somewhere else?
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by Digit »

I'm also working on Plugwise, but from another point of view: XBee modules :)
Still a long way to go, but you can read about the first results here.
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by RDNZL »

I just had a quick look at the document, so the Stick Initialisation is new, and needed?
I miss info about switching power state (POWERCHANGECODE = 0017), does this mean this has to be reverse engineered still, or that it hasn't changed since version 1??
I want to have some overview of what has changed between versions before I upgrade my firmware...
Regards, Ron.
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

Re: Firmware version 2 protocol and POL 2.0

Post by Mdamen »

@RDNZL:

Initialization is not needed but, it's needed if you want to keep track of send and received packets (sequences)
Powerchange hasn't changed but it should be in the document, I'll add it!
Post Reply

Return to “Plugwise Forum”