[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] Overvågning af tilsluttet serielport



2010/6/1 Jesper K. Pedersen <sslug@sslug>:
> Jeg har en usb enhed (microcontroller) der fungerer som en standard USB
> serielport.
> Hver gang jeg resetter den skifter den tty nummer.
>
> I stedet for at jeg selv skal søge efter hvilken tty den sidder på, vil
> jeg gerne lave et lille script som finder den korrekte port.
>
> Da jeg har andre serielle USB forbindelser kan jeg ikke bare søge efter
> /dev/ttyUSB? og forvente den sidder der.
>
> Da det er en hotplug enhed burde man kunne lave en regel, som i stedet for
> at lave /dev/ttyUSBx for enheden også laver en link fra det aktuelle
> /dev/ttyUSBx til f.eks. /dev/arm7.
> Så bruger man blot /dev/arm7 som aktiv enhed i stedet for det varierende
> /dev/ttyUSBx
>
> I stedet for jeg gør mig selv mere forvirret end jeg allerede er, håber
> jeg der er en som kan give et hint til, hvordan dette kan løses (formoder
> det er udev man skal dykke ned i).
>
> Mvh
>  JesperKP
>
>
>

Kig i lsusb og noter dig ID nummeret for din USB enhed.

lav en ny fil i /etc/udev/rules.d der hedder 99-ttyusb.rules

skriv i filen

KERNEL=="ttyUSB*", ATTRS{idVendor}=="XXXX",ATTRS{idProduct}=="YYYY"
SYMLINK+="microcontroller"

Hvor XXXX er de første fire tegn i ID'et, og YYYY er de sidste 4.

for fremtiden burde /dev/microcontroller så være et symlink til den
korrekte ttyUSB*

-Doc
-- 
No trees were killed in the sending of this message
However, a large number of electrons were terribly inconvenienced.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2010-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *