[ale] how do I lock tty settings in place once set

Ron Frazier (ALE) atllinuxenthinfo at c3energy.com
Sat Feb 18 00:18:31 EST 2012


Hi guys,

Still working on getting NTPD to talk to my USB GPS which uses a 
Prolific 2303 serial USB converter internally to talk to the computer.  
Linux has a built in driver for it, and recognizes it.  I use this 
command for the port to initialize it.

sudo stty -F /dev/ttyUSB0 57600 igncr clocal -echo -ixon

Then, I use this command to create /dev/gps5, which is what my ntpd 
config file needs.

sudo ln -T /dev/ttyUSB0 /dev/gps5

Now, when I look at the output with cat /dev/gps5, I get:

ron at asus-k52f-1:~$ cat /dev/gps5
$GPZDA,045334.000,18,02,2012,,*59
$GPZDA,045335.000,18,02,2012,,*58
$GPZDA,045336.000,18,02,2012,,*5B
$GPZDA,045337.000,18,02,2012,,*5A

which is exactly what the GPS should be putting out.

However, when I start NTPD, then stop it, and look again, I get this:

ron at asus-k52f-1:~$ cat /dev/gps5
$GPZDA,045254.000,18,02,2012,,*5E

$GPZDA,045255.000,18,02,2012,,*5F

$GPZDA,045256.000,18,02,2012,,*5C

Notice the blank lines between each output line.  It looks like NTPD is 
turning off the igncr (ignore carriage return) parameter which I set 
using the stty command.  I don't know if this is intentional design or 
an accident, but I think it may be interfering with NTPD's ability to 
read the GPS in a timely fashion and causing it to add offset to the 
clock when it starts up.  This behavior does not happen in the Windows 
port of NTPD.  The output of the GPS doesn't change at all during 
starting and stopping NTPD.  I know it's the port settings creating the 
change in output, because, if I run the stty command again, I get right 
back to my original GPS output pattern, so the GPS itself hasn't changed.

I need to know how to lock the port settings that I put in with the stty 
line, so NTPD cannot change them, whether it's doing so intentionally or 
not.

Thanks in advance.

Sincerely,

Ron


-- 

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new messages very quickly.)

Ron Frazier

770-205-9422 (O)   Leave a message.
linuxdude AT c3energy.com



More information about the Ale mailing list