GPS GPL driver.

esw at alum.mit.edu esw at alum.mit.edu
Tue May 1 22:39:50 CEST 2007


> Andreas Kostyrka schreef:
> > * Koen Kooi <koen at dominion.kabel.utwente.nl> [070501 21:14]:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Joe Pfeiffer schreef:
> >>>> I got that far, but I'm at a loss how to send that sequence to the serial port...
> >>> If I'm following the discussion, creating a file with the content and
> >>> 'cat'ing would do it...
> >> Ok, I made the following files:
> >>
> >> http://openembedded.org/~koen/hammerhead.txt
> >> http://openembedded.org/~koen/hammerhead2.txt
> >>
> >> but the uart stays mute after catting them :(
> > 
> > I did not follow this thread, so no idea what you are trying to
> > connect to, but UARTs are not simple files. Depending what you really
> > have, you might need to set it up. E.g. termios.h would be your ticket
> > in C, bash users can use stty.
> 
> I did
> 
> stty -F /dev/ttySAC1 raw speed 115200 -crtscts cs8 -parenb -cstopb
> 
> before cat'ing the files.

It might be the open/closing of the file that is messing things up.
You might send the first file, start to make the gps all happy, but
then an instant later the cat command exits and the filehandle is
closed again and the gps might be back to square one.

I'm not sure if /dev/fd/x alias for file descriptor x exists and if
exec can work this way on about the shell on the neo, but in bash I'd
do something like:

exec 3<>/dev/ttySAC1       # open ttySAC1 as file handle 3
(od -c -w1 /dev/fd/3 ) &   # outputs the bytes we read from fh 3
stty -F /dev/fd/3 raw speed 115200 -crtscts cs8 -parenb -cstopb
cat file1 > /dev/fd/3
cat file2 > /dev/fd/3
#don't forget to do this from a subshell, and or close the fh

-erik

ps. are you sure that's the right stty line/syntax?  my stty doesn't
need the word "speed", it's assumed if it gets a number.



More information about the openmoko-devel mailing list