Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-27-2009, 01:56 AM   #1
LQ Newbie
Registered: Oct 2009
Posts: 4

Rep: Reputation: 0
Question Programing to read USB-GPS for SBC2440-IV Single Board Computer

I have an USB-GPS receiver (Haicom 204E) and a SBC2440-IV Single Board
Computer. I have also written a C program to read my GPS receiver on Unbutu 8.10 for testing. It has worked well. On my PC, I have created a file asserted for usb port by using command " $ sudo mknod /dev/ttyUSB0 c 188 0". so I"ve treated my device as a file named "/dev/ttyUSB0".

However, on SBC2440-IV Single Board Computer, when I plug the GPS receiver in the USB host port1, I see a message on the terminal: "[root@arm-linux]# usb 1-1: new full speed USB device using s3c2410-ohci and address 2". then create /dev/ttyUSB0 file by using command "$ mknod /dev/ttyUSB0 c 188 0". I saw a file "ttyUSB0" in dev folder, but I can"t open it like the way on Unbutu. It"s seem to be that /dev/ttyUSB0 is not asserted for the USB host1.

Could someone help me to read the GPS receiver on SBC2440-IV Single Board
this is my C code to read the file.
int main(void)


int status,n;

char *port = "/dev/ttyUSB0";

printf("GPS receiver\n");

open_port (port);

pthread_create(&GPS_READ_ID, NULL, GPSreceiver, 0);
pthread_create(&GPS_SHOW_ID, NULL, GPSshow, 0);



/* close the device file */



void open_port(char *port)


/* open the serial port device file

* O_NDELAY - tells port to operate and ignore the DCD line

* O_NOCTTY - this process is not to become the controlling

* process for the port. The driver will not send

* this process signals due to keyboard aborts, etc.

* O_NONBLOCK- tells port to be nonblocking (read will return immediatly)


GPS_handle = open(port, O_RDWR | O_NDELAY | O_NOCTTY | O_NONBLOCK);

if (GPS_handle == -1)


perror("open_port: Unable to open");




tcgetattr(GPS_handle, &tio);

fcntl(GPS_handle, F_SETOWN, getpid());

fcntl(GPS_handle, F_SETFL, FASYNC);

Old 11-27-2009, 02:03 AM   #2
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Rep: Reputation: 189Reputation: 189
You can try using gpsd.
Old 11-27-2009, 02:40 AM   #3
LQ Newbie
Registered: Oct 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Unhappy Usb gps

I can't use gpsd because I want to program to read data from my GPS. My problem is that I don't know how to make the file asserted for USB hostport1 of SBC2440-IV Single Board Computer.
Somebody help me please,

Last edited by kennyha85; 11-27-2009 at 07:42 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a single board computer feh Linux - Embedded & Single-board computer 13 04-20-2011 02:34 AM
single board computer marceliszpak Linux - Embedded & Single-board computer 4 04-23-2010 04:10 AM
S3C6410 single board computer ported with 4 OS lykmyn Linux - Newbie 1 07-14-2009 05:44 AM
Single Board Computer for custom gaming device Fereter Linux - Embedded & Single-board computer 2 11-05-2008 01:28 AM
Single Board Computer evilrabbi Linux - Hardware 2 02-06-2007 06:13 PM

All times are GMT -5. The time now is 12:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration