User avatar
Raiders13
Posts: 5
Joined: Fri May 08, 2015 7:42 pm
Location: South Africa

GPS get wrong time and no satellites

Fri May 08, 2015 8:05 pm

Hi

I've downloaded the latest 2015-02-16-raspbian-wheezy
The GPS is returning the date as 2008-09-28

I've now tried multiple times to setup the GPS on th Raspberry Pi

Commands used to setup...

Code: Select all

sudo apt-get install gpsd -y
sudo apt-get install gpsd-clients python-gps -y
sudo apt-get install libgps-dev -y
sudo killall gpsd
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
sudo dpkg-reconfigure gpsd
cgps -s
Image

XGPS
Image

lsusb -v -d 067b:2303

Code: Select all

Bus 001 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            4.00
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Last edited by Raiders13 on Mon May 11, 2015 10:02 am, edited 1 time in total.

drgeoff
Posts: 9618
Joined: Wed Jan 25, 2012 6:39 pm

Re: GPS get wrong time and no satellites

Fri May 08, 2015 10:07 pm

Three possibilities spring to mind.

1. The RPi and GPS are not communicating.

2. The GPS is broken.

3. The GPS cannot 'see' any satellites.

Do you get a different date if you run the software without the GPS plugged in?

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

Re: GPS get wrong time and no satellites

Fri May 08, 2015 10:51 pm

Before you start gpsd you should check if the GPS is actually sending data:

Code: Select all

stty -F /dev/ttyUSB0 4800
cat /dev/ttyUSB0
The first line sets the speed of the serialport to 4800 bps. And the second just prints everything that is incomoung on the port. (break with ctrl-c)
Try also with speed of 9600, to find out if speed is important or if 9600 is actually the correct speed.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: GPS get wrong time and no satellites

Sat May 09, 2015 12:00 am

Put your GPS next to a window so that it can receive satellite signals.

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

Re: GPS get wrong time and no satellites

Sat May 09, 2015 9:44 am

Have you wired the GPS correctly? TX on RPi connected to RX on GPS, RX on RPi connected to TX on GPS (with level shifters if needed).

Have you disabled the Linux serial console on the UART? There's an option in sudo raspi-config to do that.

Can your GPS see at least one satellite? It needs that to get the ephemeris data for all satellites in view of your location. GPS does NOT work well indoors, it's not that good on a window sill. Ideally you need an external antenna.

The predefined standard baud rate and protocol for NMEA data is 4800, 8, N, 1.
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.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: GPS get wrong time and no satellites

Sat May 09, 2015 11:28 am

I think his GPS is having an usb connection as it seems to use the prolific chipset and is accessed using ttyUSBx.

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

Re: GPS get wrong time and no satellites

Sat May 09, 2015 11:47 am

obcd wrote:I think his GPS is having an usb connection as it seems to use the prolific chipset and is accessed using ttyUSBx.
There's still the TX/RX cross-over even with a USB serial adapter.
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
rpdom
Posts: 14759
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: GPS get wrong time and no satellites

Sat May 09, 2015 12:35 pm

It may be that the GPS device has a built-in USB Serial Adaptor, which is a common hack to update serial devices to support USB. In that case the PL2302 will be on the same PCB as the GPS unit and no TX/RX to connect.

User avatar
Raiders13
Posts: 5
Joined: Fri May 08, 2015 7:42 pm
Location: South Africa

Re: GPS get wrong time and no satellites

Sun May 10, 2015 6:26 am

Thanks for the quick responding to the problem...

The GPS is a USB GPS.
I have tested the GPS on my Windows Laptop and it does work. Getting position from the satellites.
Not moving the GPS, I plugged it into the the Raspberry Pi, and are unable to get anything right.

As for the "stty -F /dev/ttyUSB0 4800" command. My GPS is 9600 rated. Printed on the back of the GPS.
ImageImage

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

Re: GPS get wrong time and no satellites

Sun May 10, 2015 8:37 am

It should work if you use
stty -F /dev/ttyUSB0 9600; cat /dev/ttyUSB0
you should see NMEA data (as long as the GPS is configured to send that on the serial interface).
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
B.Goode
Posts: 8051
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GPS get wrong time and no satellites

Sun May 10, 2015 8:44 am

DougieLawson wrote:It should work if you use
stty -F /dev/ttyUSB0 9600; cat /dev/ttyUSB0
you should see NMEA data (as long as the GPS is configured to send that on the serial interface).
I think the immediately previous post from @Raiders13 shows that does work...

@Raiders13: do you have a usb extension cable to hand, so that you can have the usb dongle a short distance from the RPi, although still in the location where it can get a satellite fix?

(I think I recall previous similar threads where radiation/interference from the RPi was rumoured to be swamping the very weak signals from the GPS satellites... )

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

Re: GPS get wrong time and no satellites

Sun May 10, 2015 8:53 am

B.Goode wrote: I think the immediately previous post from @Raiders13 shows that does work...
Not when the two photos are posted at wildly different resolutions.

The configuration for GPSD will need to be updated for the non-default baud rate.
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
Raiders13
Posts: 5
Joined: Fri May 08, 2015 7:42 pm
Location: South Africa

Re: GPS get wrong time and no satellites

Sun May 10, 2015 12:34 pm

@B.Goode
U plugged in an USB extension cord. It had no effect on what was displayed.

@DougieLawson
The images are the same resolution. It are scaled by the forum.
If you open the image on it's own page it shows the correct size. In firefox, right click and select view image"

I have run the command stty -F /dev/ttyUSB0 9600; cat /dev/ttyUSB0
Image

drgeoff
Posts: 9618
Joined: Wed Jan 25, 2012 6:39 pm

Re: GPS get wrong time and no satellites

Sun May 10, 2015 5:05 pm

That looks like data from the GPS but the GPS hasn't locked to any satellites.

User avatar
Raiders13
Posts: 5
Joined: Fri May 08, 2015 7:42 pm
Location: South Africa

Re: GPS get wrong time and no satellites

Sun May 10, 2015 6:23 pm

@ drgeoff
I left it running for 4 hours after I read somewhere that for the 1st time it can take up to 30 minutes to get a lock as it's building a list or something. But no luck.
On windows it locks within a minute or two.

Someone mentioned that it might be that I'm in the southern hemisphere but they ruled it out as the GPS was working on Windows.
Something about different satellites as in the northern hemisphere.

gordon77
Posts: 4077
Joined: Sun Aug 05, 2012 3:12 pm

Re: GPS get wrong time and no satellites

Sun May 10, 2015 6:56 pm

Have you got the gps directly in the pi or on a usb extension?

Could you try and extend it further from the Pi? Could the pi be interfering with it?

I think gps is on 1.6ghz which is twice the pi's 800mhz.

drgeoff
Posts: 9618
Joined: Wed Jan 25, 2012 6:39 pm

Re: GPS get wrong time and no satellites

Sun May 10, 2015 7:15 pm

Raiders13 wrote: Someone mentioned that it might be that I'm in the southern hemisphere but they ruled it out as the GPS was working on Windows.
Something about different satellites as in the northern hemisphere.
That someone was talking nonsense. The satellites are not in synchronous orbit. Each one is continuously moving and is not confined to one hemisphere.

It shouldn't take anywhere near 4 hours.

Can you test again with Windows with the GPS in the same place as when you try with the RPi and with the RPI running and the USB cable from the RPi right beside the RPi?

User avatar
Raiders13
Posts: 5
Joined: Fri May 08, 2015 7:42 pm
Location: South Africa

Re: GPS get wrong time and no satellites

Mon May 11, 2015 3:50 pm

Problem solved...

When I connected it to the Windows PC for the 5th time to test for interference as gordon77 suggested. The windows PC also stopped receiving position.
Opening up the GPS box, and found a loose wire. Solder it back into position, where I assume it was supposed to be and its working.
Seems the way the wire bent caused it to connect when connected to the PC and disconnect when connected to the Pi.

Proofs that even brand new stuff might have loose wires within.

Thanks all.

gordon77
Posts: 4077
Joined: Sun Aug 05, 2012 3:12 pm

Re: GPS get wrong time and no satellites

Mon May 11, 2015 5:29 pm

I'm pleased you found the answer, not an obvious fault from the symptoms.

Return to “Troubleshooting”