0

I bought a Raspberry Pi 3 Model B, a microstack baseboard and a microstack GPS.

I followed the instructions written in the official documentation but I can't connect to the GPS.

Basically, the GPS led flashes so it means it has find a gps fix, but I can't see any data from the PI.

For example, if I try

cat /dev/ttyAMA0

I get always nothing. I already used raspi-config to disable kernel serial and to enable i2c and spi.

Also if I try

stty -F /dev/ttyAMA0 ispeed 4800 && cat </dev/ttyAMA0"

I get an error.

Anyone has any advice, please?

Or maybe these modules are not compatible with Pi 3?

Thanks a lot!

GavynSykes
  • 133
  • 2
  • 15
  • If gpsd were running and the device located at `/dev/ttyAMA0` you would be told `cat: /dev/ttyAMA0: Device or resource busy`It seems one or both cases warrant investigation. – Nodak Apr 08 '16 at 07:05
  • sorry I didn't understand – GavynSykes Apr 08 '16 at 13:08

3 Answers3

1

It's hard telling what has been done, or not done. The 'official' documentation from Microstack provides two methods of setting up the serial port. It then continues with

Automatically Starting gpsd To automatically start the gps service when the Raspberry Pi® boots, re­configure the GPS daemon by typing into a terminal
sudo dpkg-­reconfigure gpsd

● Choose <yes> when asked if you want to start gpsd automatically.
● Choose <no> when asked “should gpsd handle attached USB GPS receivers automatically” .
● When asked which “Device the GPS receiver is attached to” , enter /dev/ttyAMA0 .
● Accept the defaults for other options.

If you have configured your serial port as per instructions and configured gpsd to automagically start and pick up the device you have just setup, ...then, since the gpsd is handling the device (right?), the device will be busy and the command cat /dev/ttyAMA0 should return cat: /dev/ttyAMA0: Device or resource busy...but, it did not.

Either the serial is not configured as per instructions, or the gpsd is not running and picking up the device, or both.

The goal is not to cat your gps data, but the cat not returning an error indicates something is amiss.

Typically, it's just a typo. But it can be from skipping a step in the process, or mixing instructions from various sources so that the left hand doesn't know what the right hand has done.

Try: sudo killall gpsd if it returns gpsd: no process found that answers one question.

If it returns with no error, follow it up with cat /dev/ttyAMA0. If it returns nothing, the direction you should look is your serial port configuration.

If sudo dpkg-reconfigure gpsd is not allowing you to reconfigure (I thought it was just me) you can modify the configuration of gpsd by using your favourite editor, e.g. sudo nano /etc/default/gpsd and entering something like:

# Default settings for the gpsd init script and the hotplug wrapper.

# Start the gpsd daemon automatically at boot time
START_DAEMON="true"

# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="false"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyAMA0"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n -G"

You may find the -n and -G useful. Save and restart.

Nodak
  • 929
  • 1
  • 8
  • 14
  • thanks a lot. the problem is that if I try sudo dpkg-reconfigure gpsd, it will not ask me any option, just print some info about a gpsd account and start the service again – GavynSykes Apr 09 '16 at 09:05
  • if I try sudo-reconfigure gpsd I get: Warning: Stopping gpsd.service, but it can still be activated by: gpsd.socket Creating/updating gpsd user account... – GavynSykes Apr 09 '16 at 11:04
  • @GavynSykes I've added gpsd configuration to the answer – Nodak Apr 09 '16 at 12:47
1

I finally found a solution:

On the Pi 3, there are more steps to use serial, you have to disable the BT.

Edit config file:

sudo nano /boot/config.txt

Add this at the bottom:

dtoverlay=pi3-disable-bt-overlay

Then run this:

sudo systemctl disable hciuart
GavynSykes
  • 133
  • 2
  • 15
0

This article was very usefull for me

http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/#comment-67160

and i recommand you to read it

Now on RPI3 the Serial port

ttyAMA0 is used by BlueTooth ttySO refers to the GPIO The Alias Serial0 refers to the GPIO both on RPI2 and RPI3. So :

after a reinstallation of Jessie with a recent version to be sure all is clean

as usual

$ sudo apt-get update 
$ sudo apt-get upgrade

$ sudo  raspi-config

go to Advanced options : Would you like a login shell to be accessible over serial? response "yes" (not as in the microstack datasheet )

$ sudo apt-­get install python3-­microstacknode

To install the gpsd standard tools

$ sudo apt­-get install gpsd gpsd-­clients python­-gps

edit GPSD by

$ sudo nano /etc/default/gpsd

and put the options :

START_DAEMON="true"
USBAUTO="false"
DEVICES="/dev/serial0"
GPSD_OPTIONS="-n -G"

equally

$ sudo nano /boot/cmdline.txt

remove

console=serial0,115200 and save

$ sudo nano /boot/config.txt

you must have at the end

enable_uart=1

Disable the console by

$ sudo systemctl stop serial-getty@ttyS0.service
$ sudo systemctl disable serial-getty@ttyS0.service

i have equally done $ sudo chmod 775 ../../dev/ttySO ( i dont know if it is really necessary )

and obviously a reboot

and miracle the gps works with

cgps -s

NB: you must have a fix on the GPS ( the red led flashes )

jpherrenknecht

jpherren
  • 11
  • 1