dio1970
Posts: 2
Joined: Fri Feb 14, 2020 10:16 pm

Problem with the Ublox neo 6M gps

Sat Feb 15, 2020 10:47 am

Hello everyone,

I am a beginner in Raspberry and Python and I am trying to connect my Raspberry Pi Zero W with the Ublox neo 6M gps for a school project.

I am using Rasbian (a port of Debian with the Pi Desktop) Python 3.7.3 and I have tried to follow some tutorials such as:

https://sparklers-the-makers.github.io/ ... pberry-pi/
https://pimylifeup.com/raspberry-pi-serial/
https://tutorials-raspberrypi.com/build ... on-device/

but none of them works :cry: .

To be more specific:
1)The Gps led is not blinking at all (I have moved near the window)
2) I have installed pynea2 with the command : pip install pynmea2 , but when I try to import pynmea2 in the code I get an error message "ModuleNotFoundError: No module named 'pynmea2'".
3) The worst thing is that when I try to edit the cmdline.txt and write
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
everything corrupts after booting. I get a kernel panic message and I have no access to the raspberry. In that case I format my sd and write again the Rasbian on it.

I would appreciate any help!

Dio.

User avatar
topguy
Posts: 6269
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 12:32 am

1) could be power problem are there other led indicating the device is powered.. ?

2) sounds like you mey have installed a Python2 module but are mayne running Python3 as default. maybe use pip3 to install.

3) Exactly why are you editing this file ? I think is should be enough to use "raspi-config" command to disable the serial console.
I am using Rasbian (a port of Debian with the Pi Desktop)
We know what Raspbian is... :D

ElEscalador
Posts: 786
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 12:47 am

Once you get it bootable again, as topguy suggested trying using only the raspi-config to disable the serial console. When that's done, plug in your gps to the uart pins 14 and 15, as well as supplying it 3.3v and ground from the pi. It should show signs of life... in any case, before you mess with software use

Code: Select all

ls /dev/tty*
from the command line and look for one that is ttyACM0 or ttyAMA0 (I can never remen=mber which is which). Whichever one is present (or even try the next part with both - cant hurt), go back to the command line and enter

Code: Select all

cat /dev/ttyAMA0    (or /dev/tty_whichever yours is) 
If the gps is on, it should automatically start streaming NEMA sentences even if it doesn't have a satellite fix (that will be evident by all zeros).

hit ctrl-c to stop. That much at least tests the gps and that you access to the port - you needn't worry about other software until you get that far.
Robotics tips, hacks, book extras https://youtube.com/c/practicalrobotics

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

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 6:56 am

look at /dev/serial0 and not the ttyAMA0 or ttyS0
It will point to the correct place if you use raspi-config's (or the desktop version) settings to enable the serial port and disable the serial console.


You need to use
pip3 and not pip to install pynmea2.
You'll come across this a few times as you program.
You are using Python3 (like you should :-) ) but that means using pip3
pip is currently for python2.

Once you do that, it'll find the module.

User avatar
DougieLawson
Posts: 37455
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 9:17 am

Unplug the GPS and plug it back in. Then run a dmesg command to see what device is created when it's attached.

You should get something like

Code: Select all

[602661.664847] usb 1-1.5: USB disconnect, device number 5
[602667.078927] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
[602667.221822] usb 1-1.5: New USB device found, idVendor=1546, idProduct=01a7, bcdDevice= 1.00
[602667.221849] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[602667.221862] usb 1-1.5: Product: u-blox 7 - GPS/GNSS Receiver
[602667.221874] usb 1-1.5: Manufacturer: u-blox AG - www.u-blox.com
[602667.228119] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 10:54 am

DougieLawson wrote:
Sun Feb 16, 2020 9:17 am
Unplug the GPS and plug it back in. Then run a dmesg command to see what device is created when it's attached.

You should get something like

Code: Select all

[602661.664847] usb 1-1.5: USB disconnect, device number 5
[602667.078927] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
[602667.221822] usb 1-1.5: New USB device found, idVendor=1546, idProduct=01a7, bcdDevice= 1.00
[602667.221849] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[602667.221862] usb 1-1.5: Product: u-blox 7 - GPS/GNSS Receiver
[602667.221874] usb 1-1.5: Manufacturer: u-blox AG - www.u-blox.com
[602667.228119] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device
Only if it is a USB version, then setup is different and automatic.

But with serial ports mentioned, I think we're assuming it is using the serial GPIO connection. Which is normal for Ublox6m, the ublox7 and 8 are more common in usb form as they built it in if I remember correctly. (My 8 style can do either.)

ElEscalador
Posts: 786
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 2:27 pm

bensimmo wrote:
Sun Feb 16, 2020 6:56 am
look at /dev/serial0 and not the ttyAMA0 or ttyS0
It will point to the correct place if you use raspi-config's (or the desktop version) settings to enable the serial port and disable the serial console.
Ah right. I haven't used Raspian flavors in forever.
Robotics tips, hacks, book extras https://youtube.com/c/practicalrobotics

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

Re: Problem with the Ublox neo 6M gps

Sun Feb 16, 2020 2:54 pm

ElEscalador wrote:
Sun Feb 16, 2020 2:27 pm
bensimmo wrote:
Sun Feb 16, 2020 6:56 am
look at /dev/serial0 and not the ttyAMA0 or ttyS0
It will point to the correct place if you use raspi-config's (or the desktop version) settings to enable the serial port and disable the serial console.
Ah right. I haven't used Raspian flavors in forever.
They added it a few month after the first Pi3 came out so you can just point it at that and it'll work on the Pi2 or Zero or older at the time.

It also allows easier switching if you disabled the BT using the Full UART (ttyAMA0) as by default the Pi3, ZeroW and later used ttyS0 a mini UART.

emma1997
Posts: 581
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Problem with the Ublox neo 6M gps

Tue Feb 18, 2020 2:34 am

dio1970 wrote:
Sat Feb 15, 2020 10:47 am
1)The Gps led is not blinking at all (I have moved near the window)
Window is not good specially with a Pi nearby. Out in the open is better at least starting out.

You might find moving the module far away from the Pi helps finding satellites much quicker (or at all). Neo6m is one of my favorites but will not work when too close to most MCU due to radiated noise. My Pi4 is exceptionally bad in that respect. If anything at all is plugged into USB3 it never locks.

Specially during initial almanac acquisition stage. I need to extend at least 20cm away with STM32 or ESP and 2 meters or more with Pi w/o extreme shielding/antenna measures. Arduino not too bad running from 8mhz internal clock. Otherwise prepare for a long wait.

I suggest connecting to just a battery and nothing else then go out to a wide open field to get first lock or for diagnostics. Blink should start in 5-10 minutes depending on location and weather.

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

Re: Problem with the Ublox neo 6M gps

Tue Feb 18, 2020 10:00 pm

emma1997 wrote:
Tue Feb 18, 2020 2:34 am
dio1970 wrote:
Sat Feb 15, 2020 10:47 am
1)The Gps led is not blinking at all (I have moved near the window)
Window is not good specially with a Pi nearby. Out in the open is better at least starting out.

You might find moving the module far away from the Pi helps finding satellites much quicker (or at all). Neo6m is one of my favorites but will not work when too close to most MCU due to radiated noise. My Pi4 is exceptionally bad in that respect. If anything at all is plugged into USB3 it never locks.

Specially during initial almanac acquisition stage. I need to extend at least 20cm away with STM32 or ESP and 2 meters or more with Pi w/o extreme shielding/antenna measures. Arduino not too bad running from 8mhz internal clock. Otherwise prepare for a long wait.

I suggest connecting to just a battery and nothing else then go out to a wide open field to get first lock or for diagnostics. Blink should start in 5-10 minutes depending on location and weather.
If.younhabe lock problems, move the the newer and much better Ublox 8 (mk8030 iirc)
Much better all round. I'll not go back to Ublox6m now.

emma1997
Posts: 581
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Problem with the Ublox neo 6M gps

Wed Feb 19, 2020 6:12 pm

I don't personally have unusual lock problems like OP because I'm experienced and know what to expect but it's true Neo8 are considerably more selective. I have a couple and they do have advantages over older versions specially for my GPSDO timing applications.

However not a huge advantage with horrible noise floor from nearby computers. I find the type of antenna (active vs passive, half patch vs full patch, etc) far more important for quick lock and stability. And of course, as I mentioned, relative position of the devices themselves.

Also note they cost about 8x more than those cheap $3 Neo6 modules. I mean we can buy 8 of them for the price of one Neo8. I buy quite a large number for an economy product line so it's a no brainer in my case. YMMV

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

Re: Problem with the Ublox neo 6M gps

Wed Feb 19, 2020 7:29 pm

My last M8030-KT (ublox 8) where £3.97 to £4.30 from Aliexpress, USB version and serial version was oddly about £2 more (since you didn't get the casing and usb cable, but the module was the same bar a resistor position).

Which isn't a lot, they look to be about £7 at teh moment. For teh extra cost I would still always buy them, I gain the extra GNSS satellites and faster lock and not just GPS. But each to their own, I'll not go back for the few pound it saves.

Also I don't use them with Pi4, for my mobile GNSS devices I use Zero's or NodeMCU's

emma1997
Posts: 581
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Problem with the Ublox neo 6M gps

Wed Feb 19, 2020 8:16 pm

Not sure about pounds/euros or Ali but just checking short time ago on Ebay buy-it-now the Neo6 was $3.19 free shipping. Similar module for Neo8 $22.95, and I am VERY good at hunting down best prices there. So maybe different elsewhere.

I agree they are better but for me UART only with no interest in USB and needing hundreds the 6 works best. I saved enough money going that route in 2018 to buy a car. True story. No matter what
any Ublox beats Mediatek or Globalsat in both cost and performance which were my old favorites.

I doubt choice of engine is OPs problem. As mentioned IMO better to hook up a battery and go outside. At least to get started and check for satellites.

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