Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a usb gps receiver. The navigation program I use, uses the serial port directly.
Now I would like to use another program e.g. gpsd to use the same data that comes from the serial port, simultaneously with my navigation program. But only one program at a time can use the port.
So I am looking for a way to clone the serial port. Or any other way I can use two (or more) programs reading from the same serial port.
I can let gpsd use the gps serial port and use gpspipe to connect to gpsd and that way I can get the data I need (as standard output) , but I still need a way to make my navigation program use that data.
I won't necessarily have a hardware serial port (rs-232) on the machine.
-s option causes the collected data to be written to the specified
serial device with setttings 4800 8N1. Thus gpspipe can be used with -s
and -r options to emulate a serial port hardwired to a GPS that gpsd is
And you are using wine (which I know next to nothing about), but maybe try something like this
gpspipe -r -s ~/.wine/dosdevices/com1
Then see if your windows program can use com1 as a gps receiver
Last edited by tredegar; 07-30-2010 at 12:11 PM.
Reason: edited the ~/.wine path
and I linked /home/ravenous/.wine/dosdevices/com2 to /dev/ttyS0
but 'cat /dev/ttyS0' or 'gpscat /dev/ttyS0' gave nothing and my navigation software couldn't find it either.
On this machine, I do have one real serial port /dev/ttyS0. Using anything else gives the following error.
ravenous@square:~/gpsd-2.92$ ./gpspipe -r -s /dev/ttyS1
gpspipe: error reading serial port settings
I suppose this is because ttyS0 is a real port. I probably would be able to read from it, if I connected it to another computer and read that other computer's serial port.
That is why I need to emulate a serial port, I think. Or if there is a way to loopback ttyS0, so that you can read everything you write to it, but I haven't found anything in the setserial manual.
I don't think that is going to help, just telling gpspipe to send the data to /home/ravenous/.wine/dosdevices/com2should be enough. Better to remove that link before you find it complicating things.
~/.wine/dosdevices/com2 is just a symlink to /dev/ttyS0 or /dev/ttyUSB0
It is the way wine accesses serial devices. If I should remove the link, what kind of file should ~/.wine/dosdevices/com2 be? It is not automatically created by wine.
This is how my navigation software can use /dev/ttyUSB0, which is my gps receiver and this way the navigation software can use the gps receiver just fine.
But the problem is that I want to use my navigation software on one hand, and use gpsd on the other, running side by side; both using the same gps receiver.
I see you are running gpspipe as yourself. That's OK, but what are the permissions on /dev/ttyS1 (where you have a node, but no real device) and what groups are you in?
It would also be useful to know what distro you are running
/dev/ttyS1 is rw for dialout group, which ravenous belongs to.
I tried running gpspipe as root and using sudo, but I get the same message.
I am using Kubuntu 10.04
I have read several things about socat and remserial. I just came up with an idea. Creating a stream with socat between my gps receiver and a network port. Then creating two other streams that connect between that network port and two PTY's, which according to the manual, can be accessed as a serial line. But I don't know socat, so maybe someone has some suggestions about this?
I was about to refer you to this page where they seem to have solved it with a php script and a fifo pipe, when you posted the above.
The script I linked probably won't work with the latest version of gpsd anyway.
But your fix is more elegant, easier and probably the "right" way to do it. man socat was giving me a headache!