Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Other Distributions > Imedia Linux usb-serial device gps

Forgot Password?
 Other Distributions   Post questions about distributions that do not have their own forums in here

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 06-26-2009   #1 (permalink)
Just Joined!
 
Join Date: May 2009
Posts: 39
Question Imedia Linux usb-serial device gps

Hi,

Working with iMedia Linux, I plug in a gps device to one of the usb port and I need /dev/ttyUSB0 to show up. It doesn't, but it does on my CentOS machine.

When I plug it in I see the following lines after running dmesg:
-usb 2-1: new full speed USB device using ohci_hcd and address 4
-usb 2-1: configuration #1 chosen from 1 choice

When I run lsusb it shows:
-Bus 002 Device 004: ID 067b:aaa0 Prolific Technology, Inc.

My goal is to be able to read the GPS device through a C++ program which already works as long as ttyUSB0 shows up.

Any info that could help me understand the way this works would be appreciated.

Thanks.

olacelle
olacelle is offline  



Reply With Quote
Old 06-26-2009   #2 (permalink)
/etc/init.d/moderator
 
bigtomrodney's Avatar
 
Join Date: Nov 2004
Location: Sunny South-East of Ireland
Posts: 6,068
Most device handling is done these days through HAL, hotplug and udev. You can have a look through manpages for these to get an indepth look but this article might just give you a quick overview.

hotplug, udev and hal, oh my! (tummy.com, ltd. Journal Entry)

It's worth noticing that device names are dynamic, so if you plug in another USB device first that may end up as /dev/ttyUSB0 and your GPS could end up as /dev/ttyUSB1

I hope that article can get you started.
__________________
Registered Linux user #378740
New members read here / Forum Rules
#linuxforums on irc.freenode.net
bigtomrodney is offline   Reply With Quote
Old 06-26-2009   #3 (permalink)
Just Joined!
 
Join Date: May 2009
Posts: 39
Thanks bigtomrodney.
I have read your link and some man pages on hotplug, udev and hal, but I find it all a little unclear. I'd like to know what happens from the moment I plug in my gps device. If my understanding is correct udev is the one creating the ttyUSB0 node but how exactly it does it I am not sure. I'll keep searching, any other info is welcome.

olacelle
olacelle is offline   Reply With Quote
Old 06-29-2009   #4 (permalink)
Just Joined!
 
Join Date: May 2009
Posts: 39
Still no luck with hotplug/udev. I have read a good deal about them but my impression is that the problem is not there. I noticed the following differences on my 2 machines:

dmesg on iMedia linux machine when I plug the GPS:
-usb 2-1: new full speed USB device using ohci_hcd and address 4
-usb 2-1: configuration #1 chosen from 1 choice

dmesg on Centos machine:
-usb 2-2: new full speed USB device using ohci_hcd and address 3
-usb 2-2: configuration #1 chosen from 1 choice
-pl2303 2-2:1.0: pl2303 converter detected
-usb 2-2: pl2303 converter attached to ttyUSB0

Looks like the CentOS machine is doing something more. Why? Any clue?
olacelle is offline   Reply With Quote
Old 06-30-2009   #5 (permalink)
Just Joined!
 
Join Date: May 2009
Posts: 39
I tried different things with my iMedia installation. I did a custom install and tried different things until I got the pl2303.ko file installed in /lib/modules/'uname -r'/kernel/drivers/usb/serial.

Now my ttyUSB0 gets created when I hotplug my gps. My problem now is it won't do it on bootup. Somebody has an idea?

Thank you.
olacelle is offline   Reply With Quote
Old 07-02-2009   #6 (permalink)
Just Joined!
 
Join Date: May 2009
Posts: 39
Sounds like the module wasn't being loaded on bootup.
So in iMedia the startup scripts are in /etc/rcS.d.
I create a new script called M99-local and put the following in it:
/sbin/modprobe -s pl2303 (following other scripts format).
Now my /dev/ttyUSB0 gets created on boot!! Whooohoooo!
I havn't tested my program yet but it looks like I finally got what I needed.

I hope this is gonna be of some help to someone.

olacelle
olacelle is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 04:38 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1