Page 1 of 1

GPS get wrong time and no satellites

Posted: Fri May 08, 2015 8:05 pm
by Raiders13
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

Re: GPS get wrong time and no satellites

Posted: Fri May 08, 2015 10:07 pm
by drgeoff
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?

Re: GPS get wrong time and no satellites

Posted: Fri May 08, 2015 10:51 pm
by topguy
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.

Re: GPS get wrong time and no satellites

Posted: Sat May 09, 2015 12:00 am
by ame
Put your GPS next to a window so that it can receive satellite signals.

Re: GPS get wrong time and no satellites

Posted: Sat May 09, 2015 9:44 am
by DougieLawson
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.

Re: GPS get wrong time and no satellites

Posted: Sat May 09, 2015 11:28 am
by obcd
I think his GPS is having an usb connection as it seems to use the prolific chipset and is accessed using ttyUSBx.

Re: GPS get wrong time and no satellites

Posted: Sat May 09, 2015 11:47 am
by DougieLawson
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.

Re: GPS get wrong time and no satellites

Posted: Sat May 09, 2015 12:35 pm
by rpdom
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.

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 6:26 am
by Raiders13
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

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 8:37 am
by DougieLawson
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).

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 8:44 am
by B.Goode
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... )

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 8:53 am
by DougieLawson
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.

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 12:34 pm
by Raiders13
@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

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 5:05 pm
by drgeoff
That looks like data from the GPS but the GPS hasn't locked to any satellites.

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 6:23 pm
by Raiders13
@ 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.

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 6:56 pm
by gordon77
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.

Re: GPS get wrong time and no satellites

Posted: Sun May 10, 2015 7:15 pm
by drgeoff
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?

Re: GPS get wrong time and no satellites

Posted: Mon May 11, 2015 3:50 pm
by Raiders13
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.

Re: GPS get wrong time and no satellites

Posted: Mon May 11, 2015 5:29 pm
by gordon77
I'm pleased you found the answer, not an obvious fault from the symptoms.