Pirotechnic

.. odds'n'sods of Raspberry Pi techy bits

 

 

HDMI Sound

If you really want to hear ship's bells you can enable sound over hdmi so that sound plays through your monitor rather than using the audio jack:

 

edit  /boot/config.txt

 

 

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2

 

 

GPS serial RS232 on GPIO

My GPS devices use 9 pin RS232 connectors, none of the new-fangled USB connections that would make life easy.

The Raspberry Pi GPIO port runs at TTL voltage levels, not RS232, so directly connecting the GPS wasn't an option.

So, what's required?

 

Well, if you were to connect to the GPIO port you'd find that all those messages you see at startup are also sent to the GPIO serial port; this kernel logging needs to be disabled.

edit /boot/cmdline.txt

delete the bold entries

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

 

The “console” and “kgdboc” options that include “ttyAMA0? are the ones that are important here.

(previous versions of this file looked like: dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 rootwait)

 

next:

edit  /etc/inittab

At the bottom of the file there's a configuration line that includes the "ttyAMA0" port address, coment it out (prefix with a #)

 

#Spawn a getty on Raspberry Pi serial line
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

install setserial:

 

apt-get install setserial

my GPS outputs NMEA at 9600 baud, so:

sudo setserial /dev/ttyAMA0 baud_base 9600

If your RS232 runs at a different speed then use that instead of 9600. The Pi doesn't appear to support lower baud rates, so you're stuffed if you only have NMEA at 4800 baud (like my Garmin eTrex)

after a reboot you can connect and verify the connection:

cat /dev/ttyAMA0

... and watch the data flood in :)

 

$PGRMM,WGS 84*06
$GPBOD,,T,,M,,*47
$GPRTE,1,1,c,0,ISLAY1,ISLAY2,LTRBRT*26
$GPWPL,5547.000,N,00558.000,W,ISLAY1*2D
$GPRMC,204041,V,,,,,,,260213,,*36

 

 

 

 

 


Sorry about the adverts around the page, but the few coppers the clicks bring in help towards the upkeep of the site.

 

 

 

Copyright © 1997-2016