Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all. Im working with GPS receivers, and to receive data and to send data to them i work in ubuntu (progamming in C), and use Serial port communication via ...
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    11

    USB serial port disappear

    Hi all. Im working with GPS receivers, and to receive data and to send data to them i work in ubuntu (progamming in C), and use Serial port communication via USB.
    I open the port, and after read the data then i close the port, and again i open the port, read data........
    If i run this about 1hour, or 2 hours, the device (in this case USB0) disappear and the communication with receiver ends.
    Summarizing, when i turn on the pc, and if i go to filesystem, the device USB0 is there. Then i start the program (communicate with GPS receiver) and 1 hour, 2 hours or less, the program automatically finish and output an errno = 19, what means "no such device". Well if i go to filesystem the device that appears there is not USB0 but USB1. I dont understand why USB0 disappears and turn on USB1.

    Its important, if anyone could help me to solve this..

    Thank you

  2. #2
    Linux Guru
    Join Date
    Jan 2009
    Location
    Dover, NH
    Posts
    1,633
    When a USB device resets for whatever reason and the old block device hasn't cleared yet, UDEV will create a new one for it. It's just normal operation. It used to mess up my printing all the time until they figured out how to address the usb device ID string instead of the block device.

    Unfortunately I am not a device programmer and I don't really know how this works, but I do know there is a way. You have to somehow set it up so it looks for the device ID on the USB tree and auto-configures what block device to address, so that when the block device changes (and the device ID string doesn't), it just finds the new block dev name on the tree, reconfigures itself, and keeps on trucking with only a slight delay. Only when the saved device ID can't be located on the USB tree for more than a few seconds should then the program drop out with a device not found error.

    Maybe you can poke around in the CUPS and SANE source code for hints on how to do this?

Posting Permissions

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