<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Plugwise protocol unleashed part 3: internal clock information</title>
	<atom:link href="http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/</link>
	<description>Blogging on various IT subjects</description>
	<lastBuildDate>Thu, 02 Sep 2010 08:48:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: JMcL</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-1520</link>
		<dc:creator>JMcL</dc:creator>
		<pubDate>Tue, 10 Aug 2010 11:25:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-1520</guid>
		<description>Further to Deep&#039;s analysis of the send command/ack/response sequence, there&#039;s an additional useful response regarding the packet sequence number

When a command packet is sent to the stick, the first reponse from the stick is a line in the form:

PutFifoUnicast 33 : Handle 129 : 000D6F0000xxxxB3

The &#039;129&#039; in the line above is specific to the command sent. From what I&#039;ve implemented it&#039;s as follows:

PowerChange (code=0017) : 33
PowerInfo (code=0012) : 23
Calibration (code=0026) : 60

I presume other commands will also follow this pattern.

The handle returned is the value (in decimal) of the packet sequence Deep refers to and will be used on the subsequent ACK and data packets, so the conversation is now along the lines of (leaving out frame start/ends and inserting spaces for clarity - CCCC represents CRC):

SEND: 0017 000D6F0000xxxxB3 CCCC
RECV: PutFifoUnicast 33 : Handle 129 : 000D6F0000xxxxB3
RECV: 0000 0081 00C1 CCCC (note &#039;0081&#039; = 129)
RECV: 0000 0081 00D8 00D8000D6F0000xxxxB3 CCCC

I guess this could be useful to optimise access to plugs. Fire a command, get the handle, and then keep track of responses received, leaving you free to send other commands in the meantime (Note: I haven&#039;t tried this yet, it&#039;s purely speculation!!!)</description>
		<content:encoded><![CDATA[<p>Further to Deep&#8217;s analysis of the send command/ack/response sequence, there&#8217;s an additional useful response regarding the packet sequence number</p>
<p>When a command packet is sent to the stick, the first reponse from the stick is a line in the form:</p>
<p>PutFifoUnicast 33 : Handle 129 : 000D6F0000xxxxB3</p>
<p>The &#8216;129&#8242; in the line above is specific to the command sent. From what I&#8217;ve implemented it&#8217;s as follows:</p>
<p>PowerChange (code=0017) : 33<br />
PowerInfo (code=0012) : 23<br />
Calibration (code=0026) : 60</p>
<p>I presume other commands will also follow this pattern.</p>
<p>The handle returned is the value (in decimal) of the packet sequence Deep refers to and will be used on the subsequent ACK and data packets, so the conversation is now along the lines of (leaving out frame start/ends and inserting spaces for clarity &#8211; CCCC represents CRC):</p>
<p>SEND: 0017 000D6F0000xxxxB3 CCCC<br />
RECV: PutFifoUnicast 33 : Handle 129 : 000D6F0000xxxxB3<br />
RECV: 0000 0081 00C1 CCCC (note &#8216;0081&#8242; = 129)<br />
RECV: 0000 0081 00D8 00D8000D6F0000xxxxB3 CCCC</p>
<p>I guess this could be useful to optimise access to plugs. Fire a command, get the handle, and then keep track of responses received, leaving you free to send other commands in the meantime (Note: I haven&#8217;t tried this yet, it&#8217;s purely speculation!!!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YogiBear75</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-302</link>
		<dc:creator>YogiBear75</dc:creator>
		<pubDate>Fri, 28 May 2010 09:13:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-302</guid>
		<description>Hi Maarten,

I would like to receive more information on the new protocol version :)
Can you perhaps e-mail me some code, so I can adjust my Perl scripts ?
I am using XPL-Perl with plugwise.pm and already made some adjustments.

Thnx,

Ronald</description>
		<content:encoded><![CDATA[<p>Hi Maarten,</p>
<p>I would like to receive more information on the new protocol version :)<br />
Can you perhaps e-mail me some code, so I can adjust my Perl scripts ?<br />
I am using XPL-Perl with plugwise.pm and already made some adjustments.</p>
<p>Thnx,</p>
<p>Ronald</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olli</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-285</link>
		<dc:creator>Olli</dc:creator>
		<pubDate>Tue, 18 May 2010 08:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-285</guid>
		<description>How do I PM to deep? I assume need to register with this website but where?</description>
		<content:encoded><![CDATA[<p>How do I PM to deep? I assume need to register with this website but where?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deep</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-263</link>
		<dc:creator>Deep</dc:creator>
		<pubDate>Wed, 05 May 2010 19:04:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-263</guid>
		<description>I have more interesting information about the PowerInfo request.

If you want this info, reply to me via PM</description>
		<content:encoded><![CDATA[<p>I have more interesting information about the PowerInfo request.</p>
<p>If you want this info, reply to me via PM</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deep</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-261</link>
		<dc:creator>Deep</dc:creator>
		<pubDate>Tue, 04 May 2010 18:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-261</guid>
		<description>site formatting screws up lot of my detail in above. send me pm and I send correct datas without fukup reformat</description>
		<content:encoded><![CDATA[<p>site formatting screws up lot of my detail in above. send me pm and I send correct datas without fukup reformat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deep</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-260</link>
		<dc:creator>Deep</dc:creator>
		<pubDate>Tue, 04 May 2010 18:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-260</guid>
		<description>hi Maarten,

i have analize the protocol deep and have discovered a number of things not documented (or documented as unkown) in your describe. 

by example, you miss ack from stick in pol.py code and yor describe

Send code
003E000D6F000055XXXXBF07

but, you miss ack data
00000D5200C11699 [len=21]

0000 in first pkt after send instruction means ACK

0D52 is pkt sequence #

00C1 looks like status = OK

1699 = CRC


Look next packet...

003F 0D52 000D6F0000552XXX 13 25 35 04 01 457A 0EFF

003F = resp code

0D52 = same as pkt seq above

So, correct processing is:

TX CMD:

003E000D6F000055XXXXBF07

RX ACK:

00000D5200C11699

RX RESP:

003F0D52000D6F0000552XXX1325350401457A0EFF

but look at ACK and RESP pkt, 0D52 is common in chars 4..8

Look at long sniff, you see chars 4..8 increment 1 by one this is packet sequence.

So protocol is 3 packets:

Send to stick
Stick ACK
Data returns

can also be OOB datas - valid RX packet is:

PACKET DATAS

you can also RX datas without , and these are OOB data&#039;s

I have pythn script to find this and strip

ALso, if you send invalid command to stick, you get error response

do send packet like 004A000D6F000055XXXX

and you get ack with SEQ number

then error packet

000000Ex1699

where 00Ex is error code of some type - if good request, is 00C1

I have more infos from dig - maybe you like to pm me and I tell more.

Oh, I also know how to detect association plugs like Olli wants

bye</description>
		<content:encoded><![CDATA[<p>hi Maarten,</p>
<p>i have analize the protocol deep and have discovered a number of things not documented (or documented as unkown) in your describe. </p>
<p>by example, you miss ack from stick in pol.py code and yor describe</p>
<p>Send code<br />
003E000D6F000055XXXXBF07</p>
<p>but, you miss ack data<br />
00000D5200C11699 [len=21]</p>
<p>0000 in first pkt after send instruction means ACK</p>
<p>0D52 is pkt sequence #</p>
<p>00C1 looks like status = OK</p>
<p>1699 = CRC</p>
<p>Look next packet&#8230;</p>
<p>003F 0D52 000D6F0000552XXX 13 25 35 04 01 457A 0EFF</p>
<p>003F = resp code</p>
<p>0D52 = same as pkt seq above</p>
<p>So, correct processing is:</p>
<p>TX CMD:</p>
<p>003E000D6F000055XXXXBF07</p>
<p>RX ACK:</p>
<p>00000D5200C11699</p>
<p>RX RESP:</p>
<p>003F0D52000D6F0000552XXX1325350401457A0EFF</p>
<p>but look at ACK and RESP pkt, 0D52 is common in chars 4..8</p>
<p>Look at long sniff, you see chars 4..8 increment 1 by one this is packet sequence.</p>
<p>So protocol is 3 packets:</p>
<p>Send to stick<br />
Stick ACK<br />
Data returns</p>
<p>can also be OOB datas &#8211; valid RX packet is:</p>
<p>PACKET DATAS</p>
<p>you can also RX datas without , and these are OOB data&#8217;s</p>
<p>I have pythn script to find this and strip</p>
<p>ALso, if you send invalid command to stick, you get error response</p>
<p>do send packet like 004A000D6F000055XXXX</p>
<p>and you get ack with SEQ number</p>
<p>then error packet</p>
<p>000000Ex1699</p>
<p>where 00Ex is error code of some type &#8211; if good request, is 00C1</p>
<p>I have more infos from dig &#8211; maybe you like to pm me and I tell more.</p>
<p>Oh, I also know how to detect association plugs like Olli wants</p>
<p>bye</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olli</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-207</link>
		<dc:creator>Olli</dc:creator>
		<pubDate>Thu, 22 Apr 2010 21:53:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-207</guid>
		<description>Hi. Great work on this.

Does anyone know if there is a command to get the mac addresses for the plugs in the first place? Or is it always case of manually adding them in from the stickers on the plugs?</description>
		<content:encoded><![CDATA[<p>Hi. Great work on this.</p>
<p>Does anyone know if there is a command to get the mac addresses for the plugs in the first place? Or is it always case of manually adding them in from the stickers on the plugs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maarten</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-150</link>
		<dc:creator>Maarten</dc:creator>
		<pubDate>Fri, 19 Mar 2010 19:04:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-150</guid>
		<description>Yes, I am/was able to read out the power consumption history (buffers)
I will post a blog post about that soon!</description>
		<content:encoded><![CDATA[<p>Yes, I am/was able to read out the power consumption history (buffers)<br />
I will post a blog post about that soon!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lieven</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-148</link>
		<dc:creator>Lieven</dc:creator>
		<pubDate>Thu, 18 Mar 2010 20:59:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-148</guid>
		<description>Hello Maarten,

very interesting information! Currently I&#039;m using the Plugwise devices with the old firmware in combination with MisterHouse to control some devices in my home. 

Were you able to read out the power consumption history of the Circles with the new version of the firmware? I&#039;d like to be able to get hold of this info so that I can add some monitoring to my automation environment.

Keep on the good work!</description>
		<content:encoded><![CDATA[<p>Hello Maarten,</p>
<p>very interesting information! Currently I&#8217;m using the Plugwise devices with the old firmware in combination with MisterHouse to control some devices in my home. </p>
<p>Were you able to read out the power consumption history of the Circles with the new version of the firmware? I&#8217;d like to be able to get hold of this info so that I can add some monitoring to my automation environment.</p>
<p>Keep on the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zynga chips</title>
		<link>http://www.maartendamen.com/2010/02/plugwise-protocol-unleashed-part-3-internal-clock-information/comment-page-1/#comment-132</link>
		<dc:creator>zynga chips</dc:creator>
		<pubDate>Fri, 05 Mar 2010 00:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.maartendamen.com/?p=149#comment-132</guid>
		<description>i was beginning to imagine i may perhaps be the only human being whom thought about this, at the very least at this point i acknowledge i&#039;m not weird :) i&#039;ll make sure to see a number various articles right after i get a tad of caffeine in me, it is tough to read with out my coffee, take care :)</description>
		<content:encoded><![CDATA[<p>i was beginning to imagine i may perhaps be the only human being whom thought about this, at the very least at this point i acknowledge i&#8217;m not weird :) i&#8217;ll make sure to see a number various articles right after i get a tad of caffeine in me, it is tough to read with out my coffee, take care :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
