Author Topic: Reverse engineering an IR protocol  (Read 29524 times)

Guest

  • Guest
Reverse engineering an IR protocol
« Reply #15 on: October 18, 2004, 09:27:19 am »
Quote
All looking good. I downloaded portmon from http://www.sysinternals.com

Nice bit of (free!) software, respect to the authors.

I have captured the PC side (and this is what I want to emulate) of a couple of conversations. Time to start comparing the hex with the data I know was in the unit.

It actually looks reasonably simple:

IOCTL_SERIAL_SET_BAUD_RATE: 9600

IOCTL_SERIAL_SET_RTS

IOCTL_SERIAL_SET_DTR

IOCTL_SERIAL_SET_LINE_CONTROL: StopBits: ERROR Parity: NONE WordLength: 8

IOCTL_SERIAL_SET_CHAR: EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13

IOCTL_SERIAL_SET_HANDFLOW: Shake:1 Replace:40 XonLimit:0 XoffLimit:4096


Not sure what the StopBits: ERROR means (other than it's trying to use an illegal value - can you have no stop bit?). Any guesses?


Si

P.S. I've stuck up a web page about this: http://sgp.zaurii.net/howtos/accu-chek.html

No actual data yet, but I'll put it up there and report back here as I progress.
How do I make a call to this IOCTL_SERIAL_SET_HANDFLOW: without having the windows DDK? I am trying to set the values using Win32 function calls.

If you have any info please email me at peterd_33014@yahoo.com

thanks in advance.

-Peter

Guest

  • Guest
Reverse engineering an IR protocol
« Reply #16 on: October 21, 2004, 12:26:52 pm »
Hello,

I am from Germany and in my computer science lessons at school I want to programm a Diabetes-Management-Software with Delphi.
But there are some problems: I've downloaded a rs-232-monitor-tool for testing the communication to the hardware.
It doesn't matter which caracter I send, the meter doesn't power on and I always reseive a String: Something like a "Y".
Please take a look at the screenshot...:
http://www.basicmotion.de/sonstiges/rs232.jpg

The computer communications port is set to 9600 baud, 8data bits, 1 stop bit.
What do I make wrong? Where is the problem?
I just can't find any solution :-(
So please help me,
Thanks,
Anton
antonbischof@web.de

khafra

  • Newbie
  • *
  • Posts: 18
    • View Profile
Reverse engineering an IR protocol
« Reply #17 on: October 29, 2004, 05:01:26 pm »
Speaking of reverse engineering IR protocols, I'm thinking of getting a casio camera watch, but don't have an ir port on my pc.  What's more, I tried talking to a clie by using the ir applet on pdaXrom and couldn't even get started.  How difficult would that be?


http://www.i4u.com/reviews/casiowristcamerareview_i4u.htm (they're pretty cheap now on Ebay)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Reverse engineering an IR protocol
« Reply #18 on: February 01, 2005, 07:12:43 am »
I have a copy somewhere at home, I'll find it and email you.

BTW where has it gone? It should be attached to the page.

Have all attachments vanished, or just this one?

Cheers,


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Reverse engineering an IR protocol
« Reply #19 on: February 02, 2005, 08:36:18 am »
http://people.bath.ac.uk/enpsgp/Zaurus/metertest.pl

Edit: Moved slightly, I've changed the link above to match the new location.

Si
« Last Edit: August 27, 2007, 11:32:50 am by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

bob_070

  • Newbie
  • *
  • Posts: 1
    • View Profile
Reverse engineering an IR protocol
« Reply #20 on: February 02, 2005, 12:21:15 pm »
I think all attachments got lost when the forms moved servers.

Can you also provide that log file again?   http://sgp.zaurii.net/howtos/accu-chek.html is no longer a valid address.  It would be really helpful to me.

Thanks!

Bob

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Reverse engineering an IR protocol
« Reply #21 on: February 02, 2005, 12:50:11 pm »
http://students.bath.ac.uk/enpsgp/Zaurus/accu-chek.html


Si

P.S. I received an email from a chap who was interested in adding support for this meter to the KPUMPE Project (of which I'd never heard I must admit). It seems to be a blood sugar analysis program, and OpenSource, just what I wanted :-) (though I'm sure there'll still be a place for Octave/R analysis too ;-))
« Last Edit: February 02, 2005, 12:56:32 pm by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Entropy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Reverse engineering an IR protocol
« Reply #22 on: March 20, 2005, 06:12:39 pm »
Quote
http://students.bath.ac.uk/enpsgp/Zaurus/accu-chek.html


Si

P.S. I received an email from a chap who was interested in adding support for this meter to the KPUMPE Project (of which I'd never heard I must admit). It seems to be a blood sugar analysis program, and OpenSource, just what I wanted :-) (though I'm sure there'll still be a place for Octave/R analysis too ;-))
[div align=\"right\"][a href=\"index.php?act=findpost&pid=65169\"][{POST_SNAPBACK}][/a][/div]
I haven't been here in a while.  (BTW, I'm not a Zaurus user, this was just the only place I could find any protocol information.)

Annoying that my attachment got nuked, good thing you've mirrored it, although I'm pretty sure I still have it on my laptop.  I still need to do some serious cleaning up of that script, I've just been too busy with other stuff to actually DO anything.  

BTW, could you post a communications log of the Compass software setting the meters' time?  I'd love to be able to add time setting functionality to my meter.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Reverse engineering an IR protocol
« Reply #23 on: March 21, 2005, 05:06:35 am »
Will do.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Reverse engineering an IR protocol
« Reply #24 on: March 27, 2005, 06:22:08 am »
Right, here are two files which should be pretty much identical (they're not of course) except that on one the time was changed, and on the other I said no when the dialog window came up.

http://students.bath.ac.uk/enpsgp/Zaurus/P...bs_readings.zip

http://students.bath.ac.uk/enpsgp/Zaurus/P...d_date_time.zip

The time on the meter when it was changed was about 11:01:41, and the PC time (to which it was changed - GTM->BST) was 12:00:10 or so.

Let me know how you get on,


Si

P.S. I do wonder about releasing my blood sugar history in this way :-D. By way of an excuse for those who do look at the data, Saturday's readings were affected by my staying at a friend's house after a night out and not having much with me (no meter - makes life difficult when you go to bed very drunk and tired, and wake up the same way ;-) and then having to play it by ear (in terms of when/how much insulin to give myself) for the rest of the day (which I obviously got wrong in the end). My hba1c is still about 5% though so I can't be doing it all wrong :-).
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

mohanc@ozemail.com.au

  • Newbie
  • *
  • Posts: 3
    • View Profile
Reverse engineering an IR protocol
« Reply #25 on: March 31, 2006, 03:05:51 am »
Quote
Attached is a somewhat cleaned-up version of my Perl script.  It's still a mess.   There are a lot of print statements commented out - uncomment them to see what the meter is spewing back.

This version actually pretty-prints the results and times.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=38748\"][{POST_SNAPBACK}][/a][/div]

mohanc@ozemail.com.au

  • Newbie
  • *
  • Posts: 3
    • View Profile
Reverse engineering an IR protocol
« Reply #26 on: March 31, 2006, 03:09:41 am »
Quote
Attached is a somewhat cleaned-up version of my Perl script.  It's still a mess.   There are a lot of print statements commented out - uncomment them to see what the meter is spewing back.

This version actually pretty-prints the results and times.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=38748\"][{POST_SNAPBACK}][/a][/div]

mohanc@ozemail.com.au

  • Newbie
  • *
  • Posts: 3
    • View Profile
Reverse engineering an IR protocol
« Reply #27 on: March 31, 2006, 03:18:14 am »
Quote
Attached is a somewhat cleaned-up version of my Perl script.  It's still a mess.   There are a lot of print statements commented out - uncomment them to see what the meter is spewing back.

This version actually pretty-prints the results and times.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=38748\"][{POST_SNAPBACK}][/a][/div]

Could you please email me your perl script with a brief word on how to run it. I don't know how to run a perl script. I want to be able to download my accu-chek readings using your perl script if that is ok.


My email is mohanc@ozemail.com.au

Thanks
Mohan

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Reverse engineering an IR protocol
« Reply #28 on: March 31, 2006, 05:14:40 am »
It's on my web site.

Under Linux just make sure it's executable and run it (you ought to have perl installed by default).

Under Windows, install perl and then you can probably just double click on the file (assuming it registers a handler for the .pl extension).


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

NetAmp

  • Newbie
  • *
  • Posts: 1
    • View Profile
Reverse engineering an IR protocol
« Reply #29 on: August 15, 2006, 04:49:37 pm »
Hi guys, great stuff going on here.

One question though, about the Perl script.
Can I use my laptop's built-in IR port? I am quite certain that it resides on COM4:, but it seems that it's only activated when I put another device, like my mobile phone or my Zaurus PDA in front of the IR port/'window' on my laptop.

Do you guys know how to set it up, so that I can use it for 'normal' serial communication with a device (Accu-Chek Compact Plus meter in my case)?

I'm using (Active)Perl v5.8.8 on Windows XP.

Maybe i'd be better off when just booting Linux on my laptop; sadly I'm a Windows:P user most of the time (sorry )

[span style=\'font-size:8pt;line-height:100%\']First I couldn't get the Win32API module to work, but the solution turned out to be simple for me:
I just had to type this at the Command Prompt to completely install it from the ActivePerl site:
Code: [Select]
ppm install Win32-APIMaybe someone else will be helped by this [/span]