D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Adventures with USB-serial converter

 

On Wed, Sep 10, 2008 at 3:34 PM, Tony Sumner <tony@xxxxxxxxxxxxxxx> wrote:

>> $ stty /dev/ttyUSB0 2400
>
> I tried that but the result was the same; it ran for about three hours
> and then stopped with fgets: Success. So speed was not the problem. No
> worry; I am back running my script that switches from ttyUSB0 to
> ttyUSB1 and back so I get a complete record and it runs forever.
>

This would suggest that the USB device is dropping the connection, or
resetting or something nasty Then it reboots very quickly and linux
re-enumerates at the next available device node hence your flipping
from /dev/ttyUSB0 to /dev/ttyUSB1 that you are seeing.

You could possibly use a udev rule to force the device to always be on
a specific device node then it would not flip around something a bit
like this in /etc/rules.d/ as a new file - 25_my_temperature_probe :-

 ACTION!="add", GOTO="my_rules_end"
 SUBSYSTEM=="usb_device", GOTO=my_rules_start"
 SUBSYSTEM!="usb", GOTO="my_rules_end"
 LABEL="my_rules_start"

 ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="0002", MODE="0664",
GROUP="plugdev", NAME="mytemperatureprobe"

 LABEL="my_rules_end"

but you will have to set Vendor and Product to be appropriate for your
device as well, that will create /dev/mytemperatureprobe for you to
talk to.


Robin

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html