nabberuk
Posts: 67
Joined: Fri Mar 09, 2012 10:34 am
Contact: Website

UART GPS Device

Sun Aug 04, 2013 2:34 pm

I'm trying to get readings from a Ublox NEO-6M GPS device thats connect via UART serial. I've followed the various guides on the net on how to disable the onboard serial in order to use it to talk to devices.

I have the following connections from Neo to the RPi;

Neo > Rpi
GND > Pin6
VIN > Pin1
TXD > Pin14
RXD > Pin15

I;ve been trying to get cgps to talk to it using the following guide (GPS is running at 9600);

http://diydrones.com/profiles/blogs/how ... spberry-pi

Issue being is i get no data through to cgps, are there any steps i've missed?

I've just double checked i've wired it up to the correct pins.
the autonomous sailing boat: www.autonboat.com

nabberuk
Posts: 67
Joined: Fri Mar 09, 2012 10:34 am
Contact: Website

Re: UART GPS Device

Sun Aug 04, 2013 3:08 pm

if i do a lsusb should the device appear as it doesnt in this case.
the autonomous sailing boat: www.autonboat.com

User avatar
joan
Posts: 15845
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: UART GPS Device

Sun Aug 04, 2013 3:19 pm

TX on one device needed to be connected to RX on the other.

The Pi device is /dev/ttyAMA0 (from memory).

Use the command

stty -F /dev/ttyAMA0

to see the current settings.

and

stty -F /dev/ttyAMA0 9600

to set a baud rate of 9600 (4800 is more normal for GPS).

Try

cat </dev/ttyAMA0

to see if your GPS unit is properly connected.

nabberuk
Posts: 67
Joined: Fri Mar 09, 2012 10:34 am
Contact: Website

Re: UART GPS Device

Sun Aug 04, 2013 5:01 pm

brilliant, i got it working. i had the rx/tx the wrong way round lol. embarrassing!
thanks
the autonomous sailing boat: www.autonboat.com

SunilRathod
Posts: 2
Joined: Wed Apr 06, 2016 5:42 pm

Re: UART GPS Device

Wed Apr 06, 2016 5:45 pm

Hi, I am not getting the data on the screen. After performing all the steps when i give command cgps -s i get the screen with no data in it. I am using raspberry pi 3. Also when i performed sudo nano /etc/inittab step i did not get any data in the file to comment. Please let me know if i am missing on anything. On a separate note I want to read this data and push to Azure IOT hub. I don't have any FTDI cable hence i was using this approach without FTDI cable. I appreciate your help in this regard too.

Thanks

Sunil Rathod

mastermushi
Posts: 37
Joined: Thu Apr 07, 2016 8:47 am

Re: UART GPS Device

Thu Apr 07, 2016 8:57 am

I have absoulutely same issue with GPS at Raspberry Pi 3 (OS Jessie)
Module GY-NEO6MV2
- TTY login is disabled through raspi-config
- Double and tripple checked that GND and VCC are connected (VCC pin measured at chip itself)
- RXD/TXD are swapped and connected
All instructions from
http://libresmartphone.com/navigation-s ... pberry-pi/
and
https://learn.adafruit.com/adafruit-ult ... ead-of-usb
are being checked.
In result I see only blank screen and GPS timeout (using cgps -s )
:?

Is there some sort of issue in RPI3?

mastermushi
Posts: 37
Joined: Thu Apr 07, 2016 8:47 am

Re: UART GPS Device

Thu Apr 07, 2016 10:56 am

mastermushi wrote:I have absoulutely same issue with GPS at Raspberry Pi 3 (OS Jessie)
Module GY-NEO6MV2
........
Is there some sort of issue in RPI3?
I see that for RASPBERRY PI 3 solution might be in using /dev/ttyS0

Will try and report!

mastermushi
Posts: 37
Joined: Thu Apr 07, 2016 8:47 am

Re: UART GPS Device

Thu Apr 07, 2016 7:10 pm

Raspberry Pi 3 GPS module issue / UART fix
for Jessie (ver. after 18 March 2016)

0) Installing GPS daemon. This step will take a while....
sudo apt-get install gpsd gpsd-clients cmake subversion build-essential espeak freeglut3-dev imagemagick libdbus-1-dev libdbus-glib-1-dev libdevil-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgarmin-dev libglc-dev libgps-dev libgtk2.0-dev libimlib2-dev libpq-dev libqt4-dev libqtwebkit-dev librsvg2-bin libsdl-image1.2-dev libspeechd-dev libxml2-dev ttf-liberation

1) sudo nano /boot/config.txt
add

Code: Select all

core_freq=250
enable_uart=1
2) sudo nano /boot/cmdline.txt
Change the file to the following:

Code: Select all

dwc_otg.lpm_enable=0  console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4  elevator=deadline fsck.repair=yes   rootwait
or IF YOU HAVE DATA PARTITION Change the file to the following:

Code: Select all

dwc_otg.lpm_enable=0  console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4  elevator=deadline fsck.repair=yes   rootwait
3)Run

Code: Select all

sudo systemctl stop serial-getty@ttyS0.service
sudo systemctl disable serial-getty@ttyS0.service
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
4) REBOOT

5) Execute the daemon reset
sudo killall gpsd
sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock

5) Test gps NMEA data with
cat /dev/ttyS0
or
gpsmon /dev/ttyS0
or with
sudo cgps -s
Last edited by mastermushi on Fri Apr 15, 2016 5:41 pm, edited 1 time in total.

SunilRathod
Posts: 2
Joined: Wed Apr 06, 2016 5:42 pm

Re: UART GPS Device

Wed Apr 13, 2016 6:30 am

Thank you very much mastermushi. This worked like charm for me.

RichardL
Posts: 6
Joined: Sat Jul 09, 2016 10:36 am

Re: UART GPS Device

Sat Jul 09, 2016 10:39 am

Words can not express my appreciation, mastermushi! Your answer is the only valid answer I can find online. Thank you so much.

AsaltedPnut
Posts: 8
Joined: Fri Jul 22, 2016 3:46 pm

Re: UART GPS Device

Sun Aug 14, 2016 7:07 pm

mastermushi, does that impact in any way on the overall performance of the Pi? I currently use my Pi as a portable media centre, I however also want to use it in my car as a navigation device.

Currently I don't have the module, but ive been reading up on the issues revolving around the uart change on the Pi3.

Does this change limit the Pi to only run a certain frequency in order to run the gps module.

I am currently looking at one of these modules, which do you advise me to use in my situation.

https://www.robotics.org.za/index.php?r ... search=Gps

https://www.robotics.org.za/index.php?r ... search=Gps

Kind regards
Nathan

jerz
Posts: 6
Joined: Thu Aug 18, 2016 5:24 pm

Re: UART GPS Device

Thu Aug 18, 2016 6:11 pm

Is this thread still valid? I have started this new RasPi3 with a clean (NOOBS) Raspbian Gnu Linux 8 twice and followed the instructions for installing the GPS daemon to the letter. GPSD does not install. Most of the downloads from Instruction (1) return a "cannot be found" error. The U-Blox Neo-6M is working and outputting NMEA to the pi on ttyUSB0. What is up with all this? :shock:

jerz
Posts: 6
Joined: Thu Aug 18, 2016 5:24 pm

Re: UART GPS Device

Thu Aug 18, 2016 11:25 pm

for mastermushi,

I am fairly inept at Linux thus far, so need a bit of help here.
OK, I discovered that I wasn't connecting to the network. I found this solution:

Update your /etc/network/interfaces eth0 line to include (or update existing) to be (as last line of section)

Code: Select all

dns-nameservers 8.8.8.8  8.8.4.4
Once able to connect to the Jessie servers, I was able to follow the instructions down to REBOOT; however, upon reboot, using the /boot/cmdline.txt code as given in the above "fix", I get to :
"
Panic: VFS: Unable to mount root-fs on unknown-block(179,2)

Entering kdb (current=0xb9500000,pid 1) on processor 2 due to Keyboard Entry
[2]kdb> _
"
And there it hangs and does nothing, and is not controllable by the keyboard. If I go back and un-power the unit, then re-power it holding the shift key, go to the "edit config" on the NOOBS screen, and comment out the (my) new entry in /boot/cmdline.txt and uncomment the old code, the unit can restart and boot all the way (but not functional with gpsd running). I have not yet made it successfully to Step 5) Execute, or 5)Test. I know the gps works and can see some data using

Code: Select all

cat /dev/ttyUSB0
Help here, please!

User avatar
Ronaldlees
Posts: 294
Joined: Sat Apr 16, 2016 4:28 pm
Location: North Carolina, US
Contact: Website

Re: UART GPS Device

Fri Aug 19, 2016 1:36 pm

AsaltedPnut wrote:mastermushi, does that impact in any way on the overall performance of the Pi? I currently use my Pi as a portable media centre, I however also want to use it in my car as a navigation device.

Currently I don't have the module, but ive been reading up on the issues revolving around the uart change on the Pi3.

Does this change limit the Pi to only run a certain frequency in order to run the gps module.

I am currently looking at one of these modules, which do you advise me to use in my situation.

https://www.robotics.org.za/index.php?r ... search=Gps

https://www.robotics.org.za/index.php?r ... search=Gps

Kind regards
Nathan
I have the ublox unit, but I didn't make any frequency changes, so there's no performance difference. I did have to change the UART, otherwise it defaults to the serial console and is unavailable for the GPS.
I am the Umbrella man

AsaltedPnut
Posts: 8
Joined: Fri Jul 22, 2016 3:46 pm

Re: UART GPS Device

Fri Aug 19, 2016 1:45 pm

Ronaldlees wrote:
I have the ublox unit, but I didn't make any frequency changes, so there's no performance difference. I did have to change the UART, otherwise it defaults to the serial console and is unavailable for the GPS.

So you would advise that I get a gps hat, instead of using an arduino as a work around....

User avatar
bensimmo
Posts: 5534
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: UART GPS Device

Fri Aug 19, 2016 4:23 pm

No, the NMEA codes show it is working.
You just need to get gpsd to install if you want to use that or try gpsmon.

That has nothing to do with any GPS devices attached as you can install without them.


EDIT sorry, to many people in this thread.

From memory ist locks some bus down to a lower frequency though you can raise it to always be at the highest.
They say it's not noticeable.

Though if you don't use Bluetooth, just disable that and use the full UART and everything else should be the same speed.

Or for a fiver just buy a Zero and attach it to that and leave the other Pi to be a dedicated media centre.
(or a cheap 3G tablet/phone and use all the better apps on Android for navigation) link the Pi to that via Bluetooth and you then have a connected media centre.

Either way, grab a new SD card and have a play with the GPS, get that working then grab another SD card and try both solutions together.


Ronaldlees you did change the pi frequency with core_freq=250

jerz
Posts: 6
Joined: Thu Aug 18, 2016 5:24 pm

Re: UART GPS Device

Sun Aug 21, 2016 5:32 am

So far, no replies received to my inquiry. I started over with a clean SD card, installed Jessie, not NOOBS Jessie. The instructions given performed per expectations with the exception that I used ttyUSB0 in place of ttyS0 and received proper operation and proper display of the NMEA data...

I would admonish the moderator of this forum to remove double entries (same impertinent questions as their previous post) and information not related to the thread so that it does not become as cluttered as this one with offsides questions and unsolicited advice about what a user should purchase vs giving proper advice and helpful code to help those of us who are not 24/7 Linux nerds to try to cope.

User avatar
bensimmo
Posts: 5534
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: UART GPS Device

Sun Aug 21, 2016 7:52 am

jerz wrote:So far, no replies received to my inquiry. I started over with a clean SD card, installed Jessie, not NOOBS Jessie. The instructions given performed per expectations with the exception that I used ttyUSB0 in place of ttyS0 and received proper operation and proper display of the NMEA data...

I would admonish the moderator of this forum to remove double entries (same impertinent questions as their previous post) and information not related to the thread so that it does not become as cluttered as this one with offsides questions and unsolicited advice about what a user should purchase vs giving proper advice and helpful code to help those of us who are not 24/7 Linux nerds to try to cope.
I think you also need to start a fresh Topic as you are by the looks of it using a USB device, the original post was a serial device connected to the gpio pins, three years ago.

USB is quite different to the detail UART on the Pi3 and should not require any of the UART changes.

All that would normally be install are
sudo apt-get install gpsd gpsd-clients python-gps
The python part only for programming in python as far as I know.

Then the gpsmon it should work as is and detect a ublox.

If that's not working oost up a new topic.

It may be you need to add location of the usb into a good file but I don't have a usb device just direct gpio UART.

mrKrecik
Posts: 15
Joined: Sun Oct 12, 2014 5:33 pm

Re: UART GPS Device

Sun Oct 23, 2016 2:04 pm

Hey,

I have NEO-6M GPS connected via GPIO pins UART, and raspberry pi 3. Unfortunately cgps don't give me any information. :(

gpsmon: http://screencast.com/t/uFq7JeVt5m

cgps: http://screencast.com/t/rEV1pA4Wmy

sudo cat /dev/ttyS0: http://screencast.com/t/YJODoJoNj

stty: http://screencast.com/t/7pO1qRLDIEdL

/boot/config.txt

enable_uart=1
core_freq=250


/boot/cmdline.txt

dwc_otg.lpm_enable=0 console=tty2 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait logo.nologo loglevel=3 vt.global_cursor_default=0 fastboot noswap ro

User avatar
bensimmo
Posts: 5534
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: UART GPS Device

Sun Oct 23, 2016 5:25 pm

First, it can see it, given the GPS strings are there.

Have you given it plenty of time and a place to get a gps lock?

suukyx
Posts: 1
Joined: Sun Oct 23, 2016 8:19 pm

Re: UART GPS Device

Sun Oct 23, 2016 8:23 pm

Hi! Im just do all the steps in my raspberry pi 3, but GPS dont return latitude/longitude informations...
what can is be??

mrKrecik
Posts: 15
Joined: Sun Oct 12, 2014 5:33 pm

Re: UART GPS Device

Tue Oct 25, 2016 10:04 am

Yeap, I waited a long time. First 4 satelites, then 7, then 11 and still no lng and ltn. Strange that cgps doesn't work - I allways used that tool. Now, even if gpsmon sees 11 satelites, cgps doesn't work at all.

User avatar
bensimmo
Posts: 5534
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: UART GPS Device

Tue Oct 25, 2016 12:06 pm

Have you setup gpsd?

mrKrecik
Posts: 15
Joined: Sun Oct 12, 2014 5:33 pm

Re: UART GPS Device

Tue Oct 25, 2016 12:40 pm

Yes, I tried killall gpsd and turn it on again - the same effect.

I'm not sure how to even debug this. :/ cgps after a couple seconds give me information: gps timeout, but why?

Maybe there is some permission issue - I can't "cat" the /dev/ttyS0 file without sudo. Or maybe there is a problem with some stopbits or something similar?

User avatar
bensimmo
Posts: 5534
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: UART GPS Device

Tue Oct 25, 2016 1:13 pm

mrKrecik wrote:Yes, I tried killall gpsd and turn it on again - the same effect.

I'm not sure how to even debug this. :/ cgps after a couple seconds give me information: gps timeout, but why?

Maybe there is some permission issue - I can't "cat" the /dev/ttyS0 file without sudo. Or maybe there is a problem with some stopbits or something similar?
Try
/dev/serial0

You also need

sudo killall gpsd
sudo gpsd /dev/serial0 -F /var/run/gpsd.sock

I think.

To be honest honest I got so fed up getting it to work on a Pi3 back when they where faffing, I mean realising the problems they had caused adding Bluetooth, that I had given up and just have it run easily on the Zero, A+ and Pi2. I might have a go this week since I've just made a new SD card for the Pi3.

Return to “Interfacing (DSI, CSI, I2C, etc.)”