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

Thread: Read raw data from USB port

  1. #1
    Join Date
    May 2009
    Location
    Salt Lake City
    Beans
    65
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Read raw data from USB port

    Hi all,

    Background: I have a CMS 50e pulse oximeter which I need to use for sleep studies to tell, while sleeping, when my percent of oxygen gets too low, how low it gets, and how many events below 87% saturation occur. I desperately wish to discontinue my nighttime oxygen use through dieting and exercizing. To do this, I must do periodic sleep studies.

    Obstacle: the pulse oximeter will record up to 24 hours of data which uploads to my laptop through a USB connection. The software is poorly engineered, almost impossible to install (drivers try to install over other devices in use,) and contains sorely deficient documentation. The data is still uploading when the software generates its report, so report suddenly stops at random amounts of data. Searching on the internet, I have discovered that this is a common (universal?) problem

    Hopeful workaround: The data is stored in CSV format. If I could capture data stream for entire upload, I could import it into Open Office and create my own accurate report. The longest report my software generates has been 5 hours of sleep.


    Question (finally!): Does anyone know how to capture a raw USB stream? Here is what I have so far:

    rumrunner@FUSION-UBUNTU:/dev$ lsusb
    Bus 001 Device 002: ID 5986:0100 Acer, Inc OrbiCam
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x Composite Device
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    rumrunner@FUSION-UBUNTU:/dev$

    The Cygnal Integrated Products port is what I want to capture

    rumrunner@FUSION-UBUNTU:/etc$ sudo mount /dev/sda1 /mnt/USB
    rumrunner@FUSION-UBUNTU:/etc$ cd /mnt/USB

    # At this point, I uploaded the data from the SPO2#

    rumrunner@FUSION-UBUNTU:/mnt/USB$ ls -la
    drwxrwxrwx 1 root root 8192 2008-10-05 01:48 .
    drwxr-xr-x 3 root root 4096 2009-05-18 13:44 ..
    -rwxrwxrwx 1 root root 490 2005-09-29 02:35 ACERBP.P2
    -rwxrwxrwx 1 root root 29 2007-09-27 14:36 aimdrs.dat
    drwxrwxrwx 1 root root 0 2007-06-04 00:13 AUTORUN
    -rwxrwxrwx 1 root root 356 2005-07-14 23:25 BACKUP.NAP
    drwxrwxrwx 1 root root 0 2007-06-04 00:13 BitLocker
    -rwxrwxrwx 1 root root 37376 2005-07-29 18:13 BOOT.DAT
    drwxrwxrwx 1 root root 0 2007-06-04 00:13 D2D
    -rwxrwxrwx 1 root root 888832 2006-12-22 01:42 D2D32.EXE
    -rwxrwxrwx 2 root root 78 2007-06-04 15:34 DrAssign2C.ini
    drwxrwxrwx 1 root root 0 2007-06-04 15:34 FACTORY
    -rwxrwxrwx 1 root root 6656 2005-06-27 10:28 FATBOOT.BIN
    -rwxrwxrwx 1 root root 153 2005-12-15 03:12 FmtFAT32.INI
    -rwxrwxrwx 1 root root 69632 2003-09-30 23:29 int15.sys
    -rwxrwxrwx 1 root root 512 2005-06-25 20:49 MBR.BIN
    drwxrwxrwx 1 root root 4096 2007-06-04 00:12 Minint
    -rwxrwxrwx 1 root root 1359 2006-11-12 02:57 model.dat
    -rwxrwxrwx 1 root root 67 2006-09-16 02:18 NAPP.DAT
    -rwxrwxrwx 2 root root 302 2007-06-04 15:23 NewPartDisk.ini
    -rwxrwxrwx 1 root root 47772 2005-03-25 05:00 ntdetect.com
    -rwxrwxrwx 1 root root 298096 2005-03-25 05:00 ntldr
    -rwxrwxrwx 1 root root 230 2007-06-04 15:58 OBR3.acr
    -rwxrwxrwx 1 root root 70 2005-09-12 09:20 OBR3.ini
    -rwxrwxrwx 1 root root 11 2005-07-07 20:31 P1.DAT
    -rwxrwxrwx 2 root root 125 2005-12-28 20:12 PARTITION.ALL
    drwxrwxrwx 1 root root 0 2006-11-02 03:22 ProgramData
    drwxrwxrwx 1 root root 0 2006-11-02 03:23 Program Files
    -rwxrwxrwx 1 root root 207 2007-04-10 04:58 RCD.DAT
    -rwxrwxrwx 2 root root 382 2005-12-19 06:54 RestoreFAT32.INI
    drwxrwxrwx 1 root root 12288 2007-06-04 00:13 RYTOOLS
    -rwxrwxrwx 1 root root 116 2007-04-27 08:37 SCD.DAT
    drwxrwxrwx 1 root root 0 2006-11-11 03:50 sources
    -rwxrwxrwx 1 root root 80 2007-04-27 03:10 SWCD.DAT
    drwxrwxrwx 1 root root 4096 2007-06-04 15:41 System Volume Information
    -rwxrwxrwx 1 root root 131072 2005-08-23 20:02 UNICODE.BIN
    drwxrwxrwx 1 root root 0 2006-11-02 03:22 Users
    drwxrwxrwx 1 root root 8192 2008-08-31 03:30 Windows
    rumrunner@FUSION-UBUNTU:/mnt/USB$


    Can anyone help me out from here?

    Thank you,
    David Boone

  2. #2
    Join Date
    Jul 2009
    Beans
    1

    Smile Re: Read raw data from USB port

    Quote Originally Posted by Vined Adobo View Post
    Hi all,

    Background: I have a CMS 50e pulse oximeter which I need to use for sleep studies to tell, while sleeping, when my percent of oxygen gets too low, how low it gets, and how many events below 87% saturation occur. I desperately wish to discontinue my nighttime oxygen use through dieting and exercizing. To do this, I must do periodic sleep studies.

    Obstacle: the pulse oximeter will record up to 24 hours of data which uploads to my laptop through a USB connection. The software is poorly engineered, almost impossible to install (drivers try to install over other devices in use,) and contains sorely deficient documentation. The data is still uploading when the software generates its report, so report suddenly stops at random amounts of data. Searching on the internet, I have discovered that this is a common (universal?) problem

    Hopeful workaround: The data is stored in CSV format. If I could capture data stream for entire upload, I could import it into Open Office and create my own accurate report. The longest report my software generates has been 5 hours of sleep.


    Question (finally!): Does anyone know how to capture a raw USB stream? Here is what I have so far:

    rumrunner@FUSION-UBUNTU:/dev$ lsusb
    Bus 001 Device 002: ID 5986:0100 Acer, Inc OrbiCam
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 003: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x Composite Device
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    rumrunner@FUSION-UBUNTU:/dev$

    The Cygnal Integrated Products port is what I want to capture

    rumrunner@FUSION-UBUNTU:/etc$ sudo mount /dev/sda1 /mnt/USB
    rumrunner@FUSION-UBUNTU:/etc$ cd /mnt/USB

    # At this point, I uploaded the data from the SPO2#

    rumrunner@FUSION-UBUNTU:/mnt/USB$ ls -la
    drwxrwxrwx 1 root root 8192 2008-10-05 01:48 .
    drwxr-xr-x 3 root root 4096 2009-05-18 13:44 ..
    -rwxrwxrwx 1 root root 490 2005-09-29 02:35 ACERBP.P2
    -rwxrwxrwx 1 root root 29 2007-09-27 14:36 aimdrs.dat
    drwxrwxrwx 1 root root 0 2007-06-04 00:13 AUTORUN
    -rwxrwxrwx 1 root root 356 2005-07-14 23:25 BACKUP.NAP
    drwxrwxrwx 1 root root 0 2007-06-04 00:13 BitLocker
    -rwxrwxrwx 1 root root 37376 2005-07-29 18:13 BOOT.DAT
    drwxrwxrwx 1 root root 0 2007-06-04 00:13 D2D
    -rwxrwxrwx 1 root root 888832 2006-12-22 01:42 D2D32.EXE
    -rwxrwxrwx 2 root root 78 2007-06-04 15:34 DrAssign2C.ini
    drwxrwxrwx 1 root root 0 2007-06-04 15:34 FACTORY
    -rwxrwxrwx 1 root root 6656 2005-06-27 10:28 FATBOOT.BIN
    -rwxrwxrwx 1 root root 153 2005-12-15 03:12 FmtFAT32.INI
    -rwxrwxrwx 1 root root 69632 2003-09-30 23:29 int15.sys
    -rwxrwxrwx 1 root root 512 2005-06-25 20:49 MBR.BIN
    drwxrwxrwx 1 root root 4096 2007-06-04 00:12 Minint
    -rwxrwxrwx 1 root root 1359 2006-11-12 02:57 model.dat
    -rwxrwxrwx 1 root root 67 2006-09-16 02:18 NAPP.DAT
    -rwxrwxrwx 2 root root 302 2007-06-04 15:23 NewPartDisk.ini
    -rwxrwxrwx 1 root root 47772 2005-03-25 05:00 ntdetect.com
    -rwxrwxrwx 1 root root 298096 2005-03-25 05:00 ntldr
    -rwxrwxrwx 1 root root 230 2007-06-04 15:58 OBR3.acr
    -rwxrwxrwx 1 root root 70 2005-09-12 09:20 OBR3.ini
    -rwxrwxrwx 1 root root 11 2005-07-07 20:31 P1.DAT
    -rwxrwxrwx 2 root root 125 2005-12-28 20:12 PARTITION.ALL
    drwxrwxrwx 1 root root 0 2006-11-02 03:22 ProgramData
    drwxrwxrwx 1 root root 0 2006-11-02 03:23 Program Files
    -rwxrwxrwx 1 root root 207 2007-04-10 04:58 RCD.DAT
    -rwxrwxrwx 2 root root 382 2005-12-19 06:54 RestoreFAT32.INI
    drwxrwxrwx 1 root root 12288 2007-06-04 00:13 RYTOOLS
    -rwxrwxrwx 1 root root 116 2007-04-27 08:37 SCD.DAT
    drwxrwxrwx 1 root root 0 2006-11-11 03:50 sources
    -rwxrwxrwx 1 root root 80 2007-04-27 03:10 SWCD.DAT
    drwxrwxrwx 1 root root 4096 2007-06-04 15:41 System Volume Information
    -rwxrwxrwx 1 root root 131072 2005-08-23 20:02 UNICODE.BIN
    drwxrwxrwx 1 root root 0 2006-11-02 03:22 Users
    drwxrwxrwx 1 root root 8192 2008-08-31 03:30 Windows
    rumrunner@FUSION-UBUNTU:/mnt/USB$


    Can anyone help me out from here?

    Thank you,
    David Boone

    I am trying to same. Were you able to load data?

    Sam Baig
    1-281-935-3171
    sbaig04@yahoo.com

  3. #3
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,792

    Re: Read raw data from USB port

    Howdy,

    I would plug the device in and see with 'dmesg' whether it is recognized as a device. If so, confirm the device name in /dev then simply use 'cat' to dump data from the device to a file and then look at it with 'hexeditor'.

    # dmesg
    ... device xxx ...
    # ls /dev/xxx*
    ...
    xxx1
    ...
    # cat /dev/xxx1 > filename
    ...long wait...
    ctrl-d
    # hexedit filename

    Hope that helps!

  4. #4
    Join Date
    May 2009
    Location
    Salt Lake City
    Beans
    65
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Read raw data from USB port

    Quote Originally Posted by sambaig View Post
    I am trying to same. Were you able to load data?

    Sam Baig
    1-281-935-3171
    sbaig04@yahoo.com

    I was able to see it with the dmesg command These were the extra lines added at the bottom when the device was plugged in:

    [ 1262.676089] usb 5-1: new full speed USB device using uhci_hcd and address 2
    [ 1262.838749] usb 5-1: configuration #1 chosen from 1 choice
    [ 1263.149567] usbcore: registered new interface driver usbserial
    [ 1263.149602] USB Serial support registered for generic
    [ 1263.149665] usbcore: registered new interface driver usbserial_generic
    [ 1263.149671] usbserial: USB Serial Driver core
    [ 1263.601896] USB Serial support registered for cp2101
    [ 1263.601951] cp2101 5-1:1.0: cp2101 converter detected
    [ 1263.712081] usb 5-1: reset full speed USB device using uhci_hcd and address 2
    [ 1263.862265] usb 5-1: cp2101 converter now attached to ttyUSB0
    [ 1263.862302] usbcore: registered new interface driver cp2101
    [ 1263.862309] cp2101: v0.07:Silicon Labs CP2101/CP2102 RS232 serial adaptor driver

    The only thing that changed in /dev was ttyUSB0 being added.
    I typed cat ttyUSB0 > /home/dave/spo2. The cursor went into wait just as advertised. After the upload was completed, I unplugged the device and the cursor came back. A file titled spo was made in my home directory, but the file was empty. I never got it working on Vista, and it doesn't work in WINE installed as an XP either. I guess I was lucky to get it running in windows XP.
    Back to the drawing board.
    Last edited by Vined Adobo; August 7th, 2009 at 10:25 AM. Reason: Correction

  5. #5
    Join Date
    May 2009
    Location
    Salt Lake City
    Beans
    65
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Read raw data from USB port

    bump

  6. #6
    Join Date
    Jan 2007
    Location
    Michigan, USA
    Beans
    1,184
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Read raw data from USB port

    Any news on this, if you have a device, and the file was created, then it is possible. Maybe post the file so that others can analyze the format, maybe you got yourself a new FOSS project.

  7. #7
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,792

    Re: Read raw data from USB port

    Howdy,

    It looks like you need to install the USB Serial driver and then dump /dev/usb/ttyUSB0 or some such to a file using cat.
    Last edited by HermanAB; January 28th, 2010 at 08:46 AM.

  8. #8
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Read raw data from USB port

    hi
    the cat command coudn't work because cat is reading from stdion. ( it's possible to use cat but cat is not designed to
    handle raw data.
    1. figure out your mount point of the usb: mout command will show you the stuff.
    2. if your usb is mounted on /dev/sdX (X is your divice) use dd this works !
    --> dd if=/dev/sdX of=/your_path/your_file bs=4k
    in your file you will have now a exact copy of your usb data
    ciao
    Last edited by rnerwein; January 28th, 2010 at 11:08 AM.

  9. #9
    Join Date
    Apr 2006
    Beans
    20

    Re: Read raw data from USB port

    Vined Adobo, sambaig,

    My father has one of these devices. I hooked it up to his laptop yesterday, and found that the provided software did not work under wine.

    I hacked together my own Java + SWT over the past couple of days (it is really poorly written at this point.. will clean up and add features soon).

    I have attached a pic.

    Also the code should be attainable, buildable, and runnable by following this procedure:
    Code:
    $ git clone http://github.com/iphands/PulseOx.git
    $ cd PulseOx/workspace/PulseOx/
    $ mkdir -p jars ; cp /path_to_your_swt.jar ./jars
    $ ant
    $ java -jar pulseox.jar

    Please let me know if this does or does not work for you. I am not running ubuntu, but java is java (though SWT is platform specific).

    Oh and for the moment the /dev/ttyUSB0 path is hard coded.

    Thanks,
    -Ian Page Hands

    edit:
    See my website for up to date information http://ian.ahands.org/progs/pulseox/
    Attached Images Attached Images
    Last edited by iphands; February 19th, 2010 at 01:00 PM.

  10. #10
    Join Date
    May 2009
    Location
    Salt Lake City
    Beans
    65
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Read raw data from USB port

    Quote Originally Posted by iphands View Post
    Vined Adobo, sambaig,

    My father has one of these devices. I hooked it up to his laptop yesterday, and found that the provided software did not work under wine.

    I hacked together my own Java + SWT over the past couple of days (it is really poorly written at this point.. will clean up and add features soon).

    I have attached a pic.

    Also the code should be attainable, buildable, and runnable by following this procedure:
    Code:
    $ git clone http://github.com/iphands/PulseOx.git
    $ cd PulseOx/workspace/PulseOx/
    $ mkdir -p jars ; cp /path_to_your_swt.jar ./jars
    $ ant
    $ java -jar pulseox.jar
    Please let me know if this does or does not work for you. I am not running ubuntu, but java is java (though SWT is platform specific).

    Oh and for the moment the /dev/ttyUSB0 path is hard coded.

    Thanks,
    -Ian Page Hands

    edit:
    See my website for up to date information http://ian.ahands.org/progs/pulseox/

    It went well for me until I got to:
    $ mkdir -p jars ; cp /path_to_your_swt.jar ./jars

    I did it in two steps instead of both on the same command line. The directory was made, but when I used cp /path_to_your_swt.jar ./jars, I got the following:

    [:~/PulseOx/workspace/PulseOx] $ cp /usr/share/jni ./jars
    cp: omitting directory `/usr/share/jni'

    Now I have to admit I am not proficient at Linux systems, so I don't even really know if I got the path right (although the library liibswt-gtk-3452.so is in the directory listed. Also, I can't find where any link was created. When I typed ant, I got 100 errors. I hope you can help. I'm getting closer anyway!


    thank you,
    Dave

Page 1 of 3 123 LastLast

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
  •