mcauser / Raspberry-Pi-ITead-Studio-GPS-NEO-6M

Experiments with my ITead Studio RPI GPS Add On
http://imall.iteadstudio.com/development-platform/raspi/raspberry-pi-gps-add-on.html
22 stars 9 forks source link

Raspberrypi 3 #3

Open thijstriemstra opened 7 years ago

thijstriemstra commented 7 years ago

I followed your instructions and got them to work with an older B+ model but it didnt work on the raspberrypi 3. There I had to use the following (the jq installation is optional; it's used to get json data from the GPS):

Wire up device
--------------

========== ================
**uBlox**  **Raspberry Pi**
GND        GND         
TX         RX (GPIO 15)
RX         TX (GPIO 14)
VCC        3V3
========== ================

Installation
------------

Install some packages::

   sudo apt-get install gpsd-clients ntpdate

Compile and install jq (if you want json gps data)::

  wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz
  tar xf jq-1.5.tar.gz
  cd jq-1.5
  ./configure
  make -j4
  sudo make install
  cd ..
  rm -rf jq*
  jq --version

Remove ``console=serial0,115200`` from ``/boot/cmdline.txt``.

Disable services::

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

Change ``/etc/default/gpsd`` and change the ``GPSD_OPTIONS`` setting to::

  GPSD_OPTIONS="/dev/serial0"

Make sure it's started during boot::

  sudo ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/

Now reboot the device.

Test
----

Identify the device::

   gpsctl /dev/serial0

Output should be something like::

   /dev/serial0 identified as a u-blox 1.00 (59842) at 9600 baud.

Run gpsmon (Ctrl+c to exit)::

  gpsmon /dev/serial0

Show time packet. ``"mode": 1`` means the GPS sensor has not achieved satellite
lock yet::

  gpspipe -w -n 30 | grep -m 1 time | jq '.'

Show GPS packet::

  gpspipe -w -n 30 | grep -m 1 lat | jq '.'

Show device info::

  gpspipe -w -n 30 | grep -m 1 DEVICE | jq '.'

More in this thread: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=51788

kirgy commented 7 years ago

@thijstriemstra I've been trying to get this working on the pi zero, following your comments above I now get data out running: sudo cat /dev/serial0 sudo gpsmon /dev/serial0

but not: sudo cgps -s

Any thoughts as to why cgps doesnt like this?

thijstriemstra commented 7 years ago

@kirgy no, I also saw mixed results with these tools.

kirgy commented 7 years ago

@thijstriemstra I was hoping to produce a GPS tracker using a node library, unfortunately the node libraries I found rely on using the cgps. It seems fairly simple to just read in from the serial in node and translate the sentences to GPS lat/lon, so I'm going to have a go at making a small node library for my solution.

Thanks for sharing, I was stumped until I discovered this!

mcauser commented 7 years ago

Thanks @thijstriemstra I'll update the instructions to make them clear they were for Raspi B/B+ I don't have a Raspi 3 or Zero, so can't test your changes.

@kirgy Have you seen this one? https://github.com/eelcocramer/node-gpsd

thijstriemstra commented 7 years ago

I've documented more after opening this ticket, will update the description, maybe there's something useful in there @kirgy (done)