does this eliminate need for ftd_sio or similar? collaborate with insulaudit?

Issue #1 new
bewest
created an issue

I noticed you try to go directly via USB, without loading ftdi_sio module, or obtaining a serial device. Do you not need the serial (/dev/ttyUSB0?)

Can I include your sources in insulaudit: https://github.com/bewest/insulaudit? See also https://github.com/bewest/decoding-carelink/blob/rewriting/analysis/bewest-pump/ReadHistoryData-page-13.data.list_opcodes.markdown#record-5-bolus-2012-12-07t164716-head4-body0-op0x01 if you are a pump user.

Comments (8)

  1. Anders Hammarquist repo owner

    The Contour USB (and presumably the Contour Next USB, though I haven't checked) are HID devices, so no, they are not anything like a serial port.

    From what I understand this is the only way you can talk to a USB device on windows without providing a kernel driver, so it make a lot of sense to do it this way.

    Feel free to use the code. I think there are some timing issues with it, but I haven't investigated. You may need to put some extra delay between commands, I find it works much better when debug prints are active.

  2. bewest reporter

    (Reply via bew...@gmail.com):

    I don't quite understand the checking for "ABC". I've been studying the Bayer protocol, and everything else makes sense to me. Is the prefix of "ABC" an artifact of using pyusb, or of USB itself or something? I wouldn't expect this from reading the pyusb examples.

    Thanks for the pointers.

    -bewest

    On Sun, Feb 3, 2013 at 12:53 PM, Anders Hammarquist issues-reply@bitbucket.org wrote:

  3. bewest reporter

    (Reply via bew...@gmail.com):

    Also, FWIW, I'm using Linux, not windows. Useful to know it works on windows. On linux, I expected to do modprobe ftdi_sio vendor=[....] product=0x6002 and have it create a tty under /dev/ttyUSB0, which is what happens with other "usb" devices, such as the carelink stick, and other glucometers. I could have used this pyusb approach in these instances as well, or bayer actually is different because it's a proper usb device and not a serial device emulated over a usb transport? Trying to understand the distinction here.

    -bewest

    On Sun, Feb 3, 2013 at 3:19 PM, Benjamin West bewest@gmail.com wrote:

    I don't quite understand the checking for "ABC". I've been studying the Bayer protocol, and everything else makes sense to me. Is the prefix of "ABC" an artifact of using pyusb, or of USB itself or something? I wouldn't expect this from reading the pyusb examples.

    Thanks for the pointers.

    -bewest

    On Sun, Feb 3, 2013 at 12:53 PM, Anders Hammarquist issues-reply@bitbucket.org wrote:

  4. bewest reporter

    @Anders Hammarquist correct, the HID interface via libusb does not expose anything like a file object which with to implement select, which is really what I want so I can give it to socat.

    I implemented a forwarder which streams the usb read/write methods you've wrapped up and seems to work well on a git clone here: https://github.com/bewest/decoding-bayer/blob/master/streaming.markdown

    https://github.com/bewest/glucodump https://github.com/bewest/glucodump/blob/master/glucodump/stream.py

  5. raffaele guida

    hi bewest, you said you studied the bayer protocol, where did you get it? Is there a possibility to read it? I found one for older models of the Contour, whilst I'm looking for a new one. Thank you

  6. Log in to comment