Page 2 of 4
Re: Firmware version 2 protocol and POL 2.0
Posted: Mon Jan 18, 2010 7:56 pm
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
Re: Firmware version 2 protocol and POL 2.0
Posted: Sat Jan 23, 2010 5:38 am
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?
Re: Firmware version 2 protocol and POL 2.0
Posted: Sat Jan 23, 2010 4:28 pm
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
Re: Firmware version 2 protocol and POL 2.0
Posted: Sat Apr 17, 2010 8:46 pm
by daromer
How did it go with pol 2.0?
Re: Firmware version 2 protocol and POL 2.0
Posted: Fri Jun 04, 2010 9:59 pm
by Floppe
Anyone figured out the rest of version 2 protocol?
Re: Firmware version 2 protocol and POL 2.0
Posted: Sat Jul 24, 2010 1:07 pm
by paradoxi
Any News about de version 2 and Pol 2.0 ?????
Tks
Re: Firmware version 2 protocol and POL 2.0
Posted: Tue Aug 10, 2010 2:55 pm
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.
Re: Firmware version 2 protocol and POL 2.0
Posted: Wed Aug 11, 2010 10:17 am
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!
Re: Firmware version 2 protocol and POL 2.0
Posted: Wed Aug 11, 2010 8:47 pm
by YogiBear75
He Mdamen,
Any chance of giving me this document ?
I would like to get my hands on

The powerinfo in mWatts
Ronald
Re: Firmware version 2 protocol and POL 2.0
Posted: Thu Aug 12, 2010 8:43 pm
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!
Re: Firmware version 2 protocol and POL 2.0
Posted: Thu Aug 12, 2010 9:04 pm
by Digit
Great job! And again, a lot of people will be very happy with this; indeed worth a donation

Re: Firmware version 2 protocol and POL 2.0
Posted: Thu Aug 12, 2010 9:23 pm
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?
Re: Firmware version 2 protocol and POL 2.0
Posted: Thu Aug 12, 2010 10:56 pm
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.
Re: Firmware version 2 protocol and POL 2.0
Posted: Fri Aug 13, 2010 10:51 am
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...
Re: Firmware version 2 protocol and POL 2.0
Posted: Fri Aug 13, 2010 11:29 am
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!