Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Bayer Contour / Glucofacts

  1. #1
    Join Date
    Aug 2005
    Location
    .nl
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Bayer Contour / Glucofacts

    Hi,

    Bayer, the well known pharmaceutical company is giving away free "Contour" glucose meters for diabetics to check their own blood sugar levels. Or at least in my country they are. Also for free, postage included, is a USB data cable to connect the glucose meter to your computer. Of course they don't give away these things out of the goodness of their heart, they hope you will buy the (expensive) needles and test strips you need to actually use their glucose meter. Only 10 of each of these are included in the free starter set.

    Anyway, their application "Glucofacts" which is a Java program works well in Windows, of course, but not so well in Ubuntu Linux. It installs fine (though Java Web Start) and runs without errors, I can access all menus and get a good idea of the program. But ultimately it remains unable to find a serial port to which the glucose meter is connected.

    The USB cable has a little square box (that presumably contains some magic) near the USB connector and a 3.5 mm "stereo" jack plug on the other end. When plugged into the computer it automatically installs a serial device in Linux called /dev/ttyUSB0. I have added my user account to the "dialout" group which has read and write privileges on the device. But the Glucofacts program just doesn't pick up the presence of the virtual serial port.

    Any ideas? This may not even be too difficult but I feel quite stupid today...

    I don't even care much for this particular application, I would much rather be able to download the data from the glucose meter myself and process it in a spreadsheet. But where do I start if I would want to reverse engineer the communication they use with the device? A simple "cat /dev/ttyUSB0" turns up nothing. I suppose they have a special communications protocol or something.


  2. #2
    Join Date
    Aug 2009
    Beans
    229
    Distro
    Ubuntu Development Release

    Re: Bayer Contour / Glucofacts

    Is there a way to try the program out as running-under-WINE program? Maybe the problem will be the same though.

    If you have easy access to a dual-boot or windows-only computer (maybe a mac too?) then you could just take the easy way out.

    Well, I like to do things the easy way, anyway.

  3. #3
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Bayer Contour / Glucofacts

    A lot of those devices have a cable that converst from serial to usb, they need a driver. Plug the device in, then open a terminal and type:

    Code:
    lsusb
    The result should look something like this:

    Code:
    lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 005: ID 046d:08da Logitech, Inc. QuickCam Messanger
    Bus 002 Device 004: ID 045e:074f Microsoft Corp. 
    Bus 002 Device 003: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0
    Bus 002 Device 002: ID 0665:5161  
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    find the id number of the device, then do a search to see if there is a driver for it.

  4. #4
    Join Date
    Aug 2005
    Location
    .nl
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Bayer Contour / Glucofacts

    Julianb, thank you for your reply. If I were to run the program under Wine I would also have to install the Java JRE into Wine. I am thinking, somehow, this is going to be ridiculous... I already have Sun Java JDK + JRE installed in Ubuntu. Any program running on that should be "platform independent", no?

    I have Windows XP running in VirtualBox so if I would really NEED to use this program I would be able to do so.

    However I just decided that I don't even need any communication with the device at all. I'm only a Type 2 diabetic so it's not like I need to measure my glucose six times a day. More like four times a week, just to be sure. So I'll take a note the old fashioned way, with pen and paper.

    Still as a Linux user it bugs me somewhat that such a thing would not work and that Bayer does not support our favourite operating system.

    It would be a nice challenge to try to hack into this little gadget. But it's Saturday evening here and I have done enough for the week, feel a bit tired and don't know where to start...
    Last edited by Olav; November 7th, 2009 at 08:08 PM.

  5. #5
    Join Date
    Aug 2005
    Location
    .nl
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Bayer Contour / Glucofacts

    Cariboo907, thank you also for your reply. But like I said, perhaps not clearly enough, the USB/serial cable is recognised (if that tells you anything, it has ID 1a79:6001), a driver is present, and a device node was automatically created in /dev even before I did anything else. So that is good, and for this reason I suspect the problem to reside in the application, not in the hardware or drivers. I think it may be looking for things called COM1:, COM2: and such...

    Since I have the thing working in VirtualBox I start to wonder if there are ways to "eavesdrop" on a serial connection in Windows. That would perhaps give some insight into their data protocol.

  6. #6
    Join Date
    Aug 2005
    Location
    .nl
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Bayer Contour / Glucofacts

    Quote Originally Posted by Olav View Post
    Since I have the thing working in VirtualBox I start to wonder if there are ways to "eavesdrop" on a serial connection in Windows. That would perhaps give some insight into their data protocol.
    To answer my own post partially, I found a freeware "serial port monitor" for Windows that lets me follow the conversations between the Glucofacts application and the Contour device. Interesting! I can see the blood sugar measurements I took, with timestamps, fly by in plain text. I need to analyse this a bit further, then perhaps I am able to make a script in Ubuntu that does the same. Anyone else interested? It's not going to happen tonight though, I think I'm going to turn off my computer now and watch a movie instead.


  7. #7
    Join Date
    Nov 2009
    Beans
    3

    Re: Bayer Contour / Glucofacts

    I'm beginnging to do some work with linux and the bayer glucometer and USB cable. I'll let you know my results, but some suggestions on using it...

    If the serial device is recognized and you get a tty device, try using od or simply cat on the the device node to see what kind of data you see streaming in. I'll check back in once I've received my USB cables.

  8. #8
    Join Date
    Nov 2009
    Beans
    3

    Re: Bayer Contour / Glucofacts

    Quote Originally Posted by Olav View Post
    When plugged into the computer it automatically installs a serial device in Linux called /dev/ttyUSB0.
    Hi Olav, you're able to see /dev/ttyUSB0? can you uname -a and udevinfo -a -p $(udevinfo -q path -n /dev/ttyUSB0 ? I don't see a device node with the identical hw.

    Thanks!

  9. #9
    Join Date
    Jul 2006
    Beans
    14
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Bayer Contour / Glucofacts

    For what it's worth, getting results from the Contour using the serial connector is pretty straightforward:
    1. When you plug the meter in and press the "M" button, the device will send an ENQ (ASCII code 5) to signal that's it's listening.
    2. You reply with an ACK (ASCII code 6), saying "send me the next record."
    3. The device will send you a record. To signal you received it and want the next one, send another ACK.
    4. Repeat until you've exhausted all the records.

    The first record you get will be a header of sorts. The next 2 are misc information. Everything after that are glucose measurement records (or control solution).

    You can check this out easily using a serial terminal like cutecom:
    Code:
    sudo apt-get install cutecom
    Open /dev/ttyUSB0, set the input mode to hex, and just keep sending "6".

    Once you've seen what the record format looks like, script to your liking in your favorite language.

    Good luck!

  10. #10
    Join Date
    Nov 2009
    Beans
    3

    Re: Bayer Contour / Glucofacts

    Quote Originally Posted by jconnolly View Post
    Hi Olav, you're able to see /dev/ttyUSB0? can you uname -a and udevinfo -a -p $(udevinfo -q path -n /dev/ttyUSB0 ? I don't see a device node with the identical hw.

    Thanks!
    I got it... I needed to recompile ftdi_sio.c with a patch for bayer support. http://patchwork.kernel.org/patch/41191/

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •