On 10/10/05 5:41, Chris Ridd <[EMAIL PROTECTED]> wrote:

> On 10/10/05 5:02, Karsten Hilbert <[EMAIL PROTECTED]> wrote:
> 
>> On Sun, Oct 09, 2005 at 06:31:13PM +0100, Chris Ridd wrote:
>> 
>>> The protocol seems to revolve around ASCII control characters 0x02 - 0x06.
>> That's pretty common.
> 
> That's good to know. Is there any documentation around which might tell me
> what to do on receipt of certain codes?
>  
>>> An 0x02 means a string follows, terminated by 0x03 and 4 more characters
>>> (perhaps a checksum).
>> Usually some sort of XOR or CRC16/32/MD5 of the bytes
>> between STX and ETX.
> 
> I tried using perl's CRC code and couldn't get anything like the same
> results, and I *doubt* the meter will implement MD5 (:-). XOR though, hm...
> 
> I haven't really got enough sample data to go on yet.

I still haven't worked it out, but it looks fairly arithmetic judging from
some GET_METER results. Since they contain the device's current time, you
can see a pattern if you call it repeatedly (the \xnn notation is C-style):

120051010\x0918:56\x09XC0824-0109 133-113-04        \x0d\x0354\x0d\x0a
120051010\x0918:58\x09XC0824-0109 133-113-04        \x0d\x0356\x0d\x0a
120051010\x0919:01\x09XC0824-0109 133-113-04        \x0d\x034B\x0d\x0a
120051010\x0919:02\x09XC0824-0109 133-113-04        \x0d\x034C\x0d\x0a

(I suspect the final \x0d\x0a are not part of the checksum, since every
checksum I've seen ends in these two bytes, and they're commonly used for CR
and LF. Of course I could be really *really* unlucky...)

If anyone fancies a crack at working the algorithm out, be my guest!

Cheers,

Chris




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/W4wwlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/openhealth/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to