From: David S. <dav...@ya...> - 2008-04-16 01:39:56
|
Hi Joe, Last week, I started to take a look at the "bad" ted packets to see if any could be salvaged. I've seen this behavior (replication of 0x10) that you describe. I've also seen "0"s get put in here and there. I'll add your code to TED.pm, run it for a while, and commit. I'll also add the other fields you found. As far as my user code goes, all I am currently doing is logging KW usage and graphing it. I'm also attempting to graph hi/lo voltage, but I think I have a bug in my code. I'm actually away on business until Thu, so I won't be able to play mh until after that. At some point, I want to try to log dollars spent, as well as try to associate the wattage of the stuff I know about (lights,furnace,ac, pellet stove, etc), and try to get a breakdown by item of my carbon footprint. Regards, David Satterfield --- In mis...@ya..., Misterhouse <misterhouse@...> wrote: > > David, > > I understand these weird "blackout" periods and have made a change to > TED.pm to fix it. I have included the fix for you to modify and check in. > > My belief is: TED protects the magic 0x10 marker in its data (it is used > as part of the framing info). What I see is when there is a 0x10 value > in the data fields, the unit replicates the value so that the framing > markers 0x1004 and 0x1003 can never appear. The fix that I did was to > look for a duplicated 0x10 0x10 value, and then remove one of them. Once > I made this change, all was fine. The change I made was at line 220 in > TED.pm. It was brute force and could be cleaned up a bit. You may also > want to call this only when the packet size if not 280. > > Let me know how it works for you. > > for (my $i=0; $i < $#pkt-1; $i++) > { > if ($pkt[$i] == 0x10 && $pkt[$i+1] == 0x10) > { > printf ("TED: Removing duplicate 0x10 at index $i\n") if > $main::Debug{ted}; > splice(@pkt, $i, 1); > } > } > > > BTW: Can you email me your ted.pl file. I'm curious what cool things you > are doing in it. > > Joe ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |