LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Serial port (https://www.linuxquestions.org/questions/linux-newbie-8/serial-port-764704/)

manjunathgn 10-27-2009 12:19 AM

Serial port
 
Dear All,

I have same problem, I have 4 serial ports in the PC, Now we are running our software and using /dev/ttyS0 to read the GPS input. Due to improper earthing i serial port is burnt. Now can i connect the GPS cable to /dev/ttyS1 and redirect that to /dev/ttyS0.

IS it possible because, i am using the exe version of the software, it that, they have used /dev/ttyS0 only.

Cat the data on /dev/ttyS1, i am receiving the GPS time but i want to redirect that GPS time to /dev/ttyS0. Is it possible?

Is there any alternative?

Kindly do the needfull


Manjunath

foodown 10-27-2009 12:41 AM

As root:
Code:

cd /dev
rm ttyS0
ln ttyS1 ttyS0

Should work.

Alternately you could do this:
Code:

cd /dev
rm ttyS0
mv ttyS1 ttyS0

Or if you really want to put the smack down:
Code:

cd /dev
rm ttyS0
mknod ttyS0 c 4 65
chown root.dialout ttyS0
chmod 660 ttyS0

You could, of course, set the mode and ownership however you want . . . no idea what distro you are using . . . my example shows the proper Slackware way.
Be sure your circuits are all properly grounded! Of course, your machine has four UARTS . . . so hey . . . you could make nodes of type c all the way up to minor 67!

Good luck!

manjunathgn 10-28-2009 04:58 AM

Thanks..Will try n get back to you.


Quote:

Originally Posted by foodown (Post 3733707)
As root:
Code:

cd /dev
rm ttyS0
ln ttyS1 ttyS0

Should work.

Alternately you could do this:
Code:

cd /dev
rm ttyS0
mv ttyS1 ttyS0

Or if you really want to put the smack down:
Code:

cd /dev
rm ttyS0
mknod ttyS0 c 4 65
chown root.dialout ttyS0
chmod 660 ttyS0

You could, of course, set the mode and ownership however you want . . . no idea what distro you are using . . . my example shows the proper Slackware way.
Be sure your circuits are all properly grounded! Of course, your machine has four UARTS . . . so hey . . . you could make nodes of type c all the way up to minor 67!

Good luck!


manjunathgn 10-28-2009 05:16 AM

Thanks, Will try this n let back to You

manjunathgn 11-05-2009 09:18 PM

Hi ,
I have checked with

cd /dev
rm ttyS0
ln ttyS1 ttyS0.

This is working fine. But the after rebooting the machine it doesn't work...Again we need to same before running the application software...


Is there any permanent solution to dis?

So tht i can mv or place ttyS1 in place of ttyS0...



Manjunath

foodown 11-05-2009 09:30 PM

The third option that I suggested originally should work as a permanent solution.


All times are GMT -5. The time now is 06:05 PM.