Skip navigation
2015

I was quite happy to get the Pi LCD display working by following the blog posts, but was disappointed to find that when I had both the MicroStack GPS module and the Display Board connected, the GPS Board stopped working. By a few elementary tests this was found to be caused by the shim board power connections (and probably data as well) not making positive connection on the side connector (the one to which the GPS was connected).

 

A number of others have commented on this and the solution seems to be to solder the shim onto a 2x20 pin header. I duly went out and procured same, soldered on the shim and, voila.. working GPS on the side connector. On reflection the shim idea is probably OK if it works for people, but I think it is a solution that relies too much on the vagaries of the mechanical setup of the boards on the Pi. Supplying the shim kit with the aforementioned header would resolve the problem.

 

Now I can progress with writing some software - however an idea occurred to me that in addition to the display, you could also utilise a LED bar graph that is slaved to the distance from the cache point - a kind of 'getting hot, getting cold' indicator that might be more fun for the junior cachers rather than reading GPS coordinates. I'll think about adding that a bit later and see how well it works.

Today was spent soldering the Pi Shim and finding out exactly how bad my soldering skills were. Overall though not too bad and once completed it was time to mount the GPS on the microstack and the subassembly onto the Pi.

 

Once powered up I followed Charles Mao's second Geocaching blog post (link)  and updated the O/S, PI firmware and installed app software. Unfortunately I missed a step which was to cause some pain later...

 

After configuring the GPS Daemon and rebooting the system I looked at the port the GPS was supposed to be outputing text on (/dev/ttyAMA0) and found nothing. Not to be deterred I powered down, removed the shim and tried again... nothing. Powered down again, looked carefully at the config, ensured the microstack was located correctly and the GPS daughter board mounted correctly and tried again... nothing.

 

Hmmmm. At this point I remembered reading the MicroStack documentation about the GPS Board. I went back and followed their instructions to see if there was anything there that might shed light on the problem. Their instructions included using the config utility to turn off serial port access to the Pi ( the step I had missed earlier). I did that and rebooted the Pi and ... voila... NMEA strings pouring out of the serial port...

 

So the moral of this story is (1) follow the posts of others more carefully and (2) sometimes looking at other documentation can give you a lead on what you might have missed.

 

20150823_215522.jpg

 

Anyhow the GPS hardware is now up and running (with the patch antenna) and the software loaded for a Python dev environment, next step (for me as a non-Python person) is to run through the dev process with some simple apps to read the GPS data.

In Part II: OS Configuration and Software Installation & Update, I showed how I configured the OS and installed software. In this part III, I will show the problem of SHIM and how I made it work.

 

To test the kit, I first tried cgps program a few times and each time the program timed out and quit in a couple of seconds. Basically there was no GPS fix at all.

IMG_0935.JPGIMG_0936.JPG

 

Then I tried to print GPS message but still no luck. I issued poweroff command to brought down the kit and started trouble-shooting.

IMG_0937.JPGIMG_0938.JPGIMG_0939.JPG

 

The first thing I did for trouble-shooting was remove the PiFace and still didn't get a fix.

IMG_0969.JPGIMG_0970.JPG

 

Next, I directly plugged Microstack baseboard onto GPIO pins. And I got the first GPS fix after powering up the kit for a while.

IMG_0940.JPGIMG_0821.JPGIMG_0965.JPG

 

At this point, I was convinced that I had the same SHIM issue like others had. To solve the problem but not touch the Pi2, I ordered a connector (ESW-120-14-G-D from Samtec) and soldered the connector on the SHIM board.

IMG_0971.jpgIMG_0972.jpgIMG_0973.jpgIMG_0974.jpg

 

Put all things together and powered the kit up and got GPS fix in a few seconds.

IMG_0975.jpgIMG_0979.jpgIMG_0978.jpg

 

Next, a quick test with the PiFace

IMG_0981.jpgIMG_0980.jpg

 

Up to this point, I am confident my kit is ready for the fun of programming. If you have any question or comments about my step by step building process, please post below. Thanks for your reading.

dmedlow

Getting Started

Posted by dmedlow Aug 16, 2015

Finally got to unboxing the hardware and seeing what was supplied for the geocaching build.

 

The Pi2 looks good, particularly with the additional USBs and the reduced footprint with the micro-SD card. I mounted the Raspberry on a board that I can use as a prototyping platform until I decide what the physical packaging of the end result is. Using a wireless keyboard/mouse (logitech) allows more physical flexibility. Its awesome how much processing capability is now available in the platform of that size.

 

The Pi is very easy to set up with the supplied SD software. Charles Mao has documented this very well (see http://www.element14.com/community/community/raspberry-pi/raspberrypi_projects/geocaching/blog/2015/08/14/step-by-step-building-the-raspberry-pi-2-gps-geocaching-kit). It all fired up first time without a problem...

 

First time the PI Powers up.

 

In addition to his steps I added a spare WiPi USB 802.3 dongle to enable wireless comms. This requires you to edit the interfaces file in Linux which takes about 5 minutes and restart the networking processes. Once up I was on the net and able to update the Raspberian software (only 173 MB). This is clearly a faster platform than the previous P'is I've owned.

 

I initially wasn't sure which way to solder the Pi Face Shim (but the other blog posts have made this clearer) and will be looking at this job next, along with mounting the GPS & Display and loading the necessary drivers for the display & GPS. I will be looking at other postings for guidance on the best dev environment to use. The final application for the kit is still not clear, but now that I am clear on the hardware supplied I can start to consider the options.

In the first part Step by Step Building the Raspberry Pi 2 GPS Geocaching Kit - Part I: Put Hardware Together, I recorded how I put the hardware together step by step. In this part, I will show the basic OS configuration and software installation & update.

 

After the first time boot-up completes, the Pi 2 will automatically run raspi-config program (you can always run this program again after first time boot-up by typing command sudo raspi-config). In this configuration interface, you can customize the locale settings, password, enable/disable some peripherals, etc.

IMG_0890.JPG



I think Raspbian has been installed on the MicroSD card came with the kit, so you don't need to expand file system. If you try to do it, it will give you a message like this

IMG_0891.JPG



The default user name is "pi" and password is "raspberry" (without the quote signs). You can change the default password by typing new password twice as shown in the bottom left corner of the second picture below.
IMG_0892.JPGIMG_0893.JPGIMG_0894.JPG


You can choose the OS boot into Desktop or Console interface. I chose Desktop option as shown below.

IMG_0895.JPG


You can customize your locale, timezone and keyboard layout (entering items 4 in the first picture of this blog).

IMG_0897.JPG


I did overclock to Pi 2 option.

IMG_0899.JPGIMG_0900.JPG


I also customized a few advanced options. First, enable SSH

IMG_0901.JPGIMG_0902.JPG


Next, I enabled kernel automatically load SPI module

IMG_0903.JPGIMG_0904.JPG


I also enabled automatically load I2C module

i2c1.JPGi2c2.JPGi2c3.JPGi2c4.JPG


The last OS configuration was disable login shell on serial port

IMG_0905.JPG


After OS configuration, the program will ask for a reboot.

IMG_0906.JPGIMG_0907.JPG


After reboot, the desktop showed up. If you chose boot into console mode, the desktop won't show up. Instead, a login console shows up.

IMG_0908.JPGIMG_0909.JPG


Next, I opened a terminal window and started upgrading the OS by typing the following commands in sequence (some commands may take a long period of time to complete).

sudo apt-get update

sudo apt-get upgrade -y

sudo apt-get dist-upgrade -y

sudo rpi-update

sudo reboot

IMG_0910.JPGIMG_0912.JPGIMG_0917.JPGIMG_0918.JPGIMG_0923.JPG

 

After reboot, I installed python3 and other GPS support software, etc. Then reboot again after the software installation completed.

IMG_0926.JPGIMG_0927.JPG

 

Next, configure gpsd and reboot again.

IMG_0928.JPGIMG_0929.JPGIMG_0930.JPGIMG_0931.JPGIMG_0932.JPGIMG_0933.JPG

IMG_0934.JPG

 

Up to this point, all software installation and update is completed. In part III Step by Step Building the Raspberry Pi 2 GPS Geocaching Kit - Part III: Trouble-shooting and Get It Work, I will show how I test, trouble-shoot and get it work.

Thanks to the Geocaching community and Christopher Stanton. I am one of the Winners of  10 Raspberry Pi 2 GPS kit. The kit arrived at my front door on Aug. 7th, 2015. Since then, I followed Chris' blog Putting Together the Pieces - Raspberry Pi 2 GPS Geocaching Project and built up my kit. In general, it's a quite smooth process except like many others, I ran into the SHIM connection problem as well. In this blog, I will show my procedure step by step with lots of pictures and screen captures (I don't have a HDMI monitor, so I used my HDTV as the display).

 

The kit came in within a neat package.

IMG_0744.JPGIMG_0745.JPGIMG_0746.JPG

 

A white 5V 2A output power adapter with changeable world-wide plugs is included. I changed the plug to North American version (push down the cutout section to release the plug from the adapter).

IMG_0747.JPGIMG_0748.JPG

 

Raspberry Pi 2 has a printed manual in 16 different languages.

IMG_0750.JPG

 

The kit includes a SHIM board which can be used to connect a Microstack GPS module (on top of a Microstack Baseboard) to the GPIO pins with a male-to-male connector.

IMG_0875.JPG

 

I soldered the male-to-male connector on the SHIM board and plug the SHIM onto GPIO pins. Like other people reported, the connections between SHIM and GPIOs weren't reliable. Keep reading and I will provide a solution.

IMG_0876.JPGIMG_0881.JPG

 

Plug the GPS module on top of Microstack baseboard and plug the baseboard into the male-to-male connector.

IMG_0880.JPGIMG_0882.JPG

 

Plug the PiFace on top of Pi 2

IMG_0883.JPGIMG_0884.JPG

 

Check the UFL to SMA RF cable - conductivity for both shield and center (I have seen factory problem on this type of cable) and carefully plug the UFL end (UFL connector is very fragile) to the GPS module. Then screw the SMA end to the GPS antenna cable. Please rotate the connectors instead of the wire when you screw two SMA together. Otherwise, too much tension on the wire may damage the UFL connector at the other end.

IMG_0885.JPGIMG_0749.JPGIMG_0887.JPG

 

Plug USB adapter for wireless keyboard and mouse, HDMI cable, Ethernet cable and microUSB power plug. Then power it up.

IMG_0889.JPG

 

Continue on Step by Step Building the Raspberry Pi 2 GPS Geocaching Kit - Part II: OS Configuration and Software Installation & Update

For those of you who want to get into lower level programming and high speed applications, c++ is a magnitude faster than Python.  Especially when it comes to parsing NMEA strings.  At 1hz 9600 baud the performance gain isn't noticeable, but going up to 115200 baud with updates 2-3 time per second I think python will start lagging.

 

I have written a C++ library by porting the TinyGPS++ from arduino over to the Pi.  I used PThreads so that the library is multithreaded and will take advantage of all those cores the Pi 2 has.

 

Please have a look at my blog and I am glad to help with tech support.  I am using the library for my quadcop_project in the sci fi your pi contest.  Basically create a GPS object, start it, and off it goes.  It reads directly from the Serial port, not GPSD.  it is currently In the beta stage and some parameters have to be changed in the code such as baud rate, but when finished this will be easily changeable.

 

Microstack GPS - A Multi-threaded approach for GPS users.

http://www.element14.com/community/community/design-challenges/sci-fi-your-pi/blog/2015/05/20/quad-cop-with-microstack-gps--a-multi-threaded-approach-for-c-users

 

Also check out bobalexander's post here for setting up the Micrstack and changing the settings.

http://www.element14.com/community/community/raspberry-pi/raspberrypi_projects/geocaching/blog/2015/08/14/setting-up-the-raspberry-pi-for-high-speed-gps-5hz-10hz-etc

If you want to use your GPS for more real time applications or for doing some software accuracy improvement you will most likely need a higher output speed.

To get a higher output speed from the L80 GPS module you need to increase the rate/frequency. The default is 1Hz or 1 PPS (pulse per second - for timing applications).

This gives you 1 NMEA coordinate sentence per second (GPGLL - Lat/Lon).


All of these echo commands are performed from the Linux shell/bash prompt.


First, Set Baud Rate

To be able to go above 1Hz you will need to switch to a higher baud rate:

echo -e "\$PMTK251,57600*2C\r\n" > /dev/ttyAMA0

Supported speeds are:

4800,9600,14400,19200,38400,57600,115200


Don't forget to update your tools connection speed to 57600!

    For example /usr/lib/python3/dist-packages/microstacknode/gps/l80gps.py (line 47)

 

To go back to 9600bps:

echo -e "\$PMTK251,9600*17\r\n" > /dev/ttyAMA0

 

Second, Set NMEA Update Speed

This will set the GPS to send 5 pulses per second (5Hz):

echo -e "\$PMTK220,200*2C\r\n" > /dev/ttyAMA0

For some reason I didn't need to change my TTY speed to execute this command even though the GPS should now be in 57.6kbps mode and the terminal *should be* at 9600.

To confirm the change, you can watch the data in Minicom both before and after; just make sure you change the baud rate or you will just see garbage.


If you are having problems perhaps you will need to change the baud on your console?

stty -F /dev/ttyAMA0 57600 clocal cread cs8 -cstopb -parenb

 

For reading serial port settings use:

stty -F /dev/ttyAMA0 -a

Mine reads this:

speed 57600 baud; rows 0; columns 0; line = 0;

intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 0; time = 0;

-parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts

-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8

-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0

-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke

I have no idea what it was set to before I started. Perhaps it is auto detecting? I doubt it.

 

 

 

Note: According to the datasheet a cold boot (if the GPS loses power and the backup battery is dead or not present) the baud rate and output frequency will go back to the default.

To do this right and make it permanent/reliable, the commands should probably be written into your program or added to the library and ran as part of the initialization/setup routine.

The fact that this is a volatile setting makes me think this is only written to RAM and therefore setting it each time the program runs (once) shouldn't do anything adverse such as prematurely wear out an EEPROM/flash chip.

 


Other update rates:

100mHz  "$PMTK220,10000*2F" // Once every 10 seconds, 100 millihertz

200mHz  "$PMTK220,5000*1B"  // Once every 5 seconds, 200 millihertz

1HZ  "$PMTK220,1000*1F"

5HZ  "$PMTK220,200*2C"

10HZ "$PMTK220,100*2F"


If you want to keep a lower baud rate and still increase the frequency you can try removing some of the unneeded NMEA sentences and just spit out the relevant position data.

These are the default messages the L80 is spitting out:

GPGGA

GPGSA

GPGSV

GPGSV

GPGSV

GPGSV

GPGLL

GPTXT

GPRMC

GPVTG

 

References:

Microstack™ GPS Reference

PMTK command packet reference

Handy Adafruit GPS.h file

NMEA data

Raspberry Pi Geocaching System (Pi Hiker)

Author: Bob Alexander


A kid friendly, high accuracy geocaching platform.

  • Accuracy of the GPS location could be improved by putting the L80 into 10Hz mode and then performing an averaging and filtering function such as outlined in this paper:

          An Effective Approach to Improving Low-Cost GPS Positioning Accuracy in Real-Time Navigation

  • With the addition of a magnetometer, a direction indicator could be added that would not be dependent upon movement to show the target azimuth.
  • We would utilize our Makerspace's 3D printer to print an enclosure for this platform to sit in such that it could be used by children.
  • I think the Pi 2 is a good candidate for this project as it should have the horsepower to perform the averaging function and be able to utilize a database of geocaches downloaded before the trip.


Journal:

Received notification that I won a Raspberry Pi 2 GPS kit from Christopher Stanton on July 17th 2015.

Received kit in mail August 4th 2015.

20150804_213133.jpg

20150804_213146.jpg20150804_213205.jpg

20150804_213347.jpg

Look at all the goodies!!

20150804_213940.jpg

Starting to assemble...

20150804_232208.jpg

I soldered the right angle header pins to the PiFace GPIO Duplication Board Shim and tacked the shim in place on the Raspberry Pi 40 pin header board by soldering the four outermost pads as I applied pressure against the shim. It was a little loose and didn’t maintain good contact without this. Yes, I soldered the pins on the wrong side and the silk screen is backwards. Oh well. A quick assembly sheet would be nice to prevent this as it wasn’t obvious to me - NOOB!

20150804_232902.jpg

The footprint is a lot bigger than I expected! How am I going to house all this?!

The Microstack is definitely a nice system for prototyping but I don’t think it will work for a ‘finished’ project.

Ben Heck style chopping/hacking in store?

20150804_232913.jpg

Maybe a game pad style case will accommodate the assembly as is? It will need to accommodate a 1S 3.7V battery - perhaps a 5,000mAh.

G910-gamepad-bluetooth-controller-side-android-racing.jpg

20150804_233259.jpg

Connected to GPS antenna sitting on the window sill. Retractable reel for the GPS antenna?

20150804_233902.jpg

Ready to power up! Note the DVI-HDMI adaptor for my DVI only monitor.

20150804_233913.jpg

It works!

20150805_001330.jpg

After downloading the PiFace Control and Display software and enabling the SPI bus I ran the sysinfo demo.

20150805_002419.jpg

Just a quick tweak and it displays my local weather!

August 5th 2015: GPS testing

Following along with Christopher Stanton’s blog:

Putting Together the Pieces - Raspberry Pi 2 GPS Geocaching Project


After not having luck with

cat /dev/ttyAMA0

and ‘cgps -s’ just returning “cgps: GPS timeout”

I unplugged the PiFace CAD and moved the GPS Microstack to the direct connection instead of going through the shim (after powering off the pi).

20150805_222748.jpg


After booting back up and waiting for the GPS to initialize, I reran ‘cgps -s’ and BINGO!

┌───────────────────────────────────────────┐┌─────────────────────────────────┐

│    Time:       2015-08-06T02:07:10.000Z   ││PRN:   Elev:  Azim:  SNR:  Used: │

│    Latitude:    3X.650558 N               ││  15    78    169    41      Y   │

│    Longitude:   7Y.667636 W               ││  20    71    001    32      Y   │

│    Altitude:   214.9 m                    ││  21    45    311    29      Y   │

│    Speed:      0.4 kph                    ││  29    44    220    36      Y   │

│    Heading:    252.9 deg (true)           ││  18    26    274    36      Y   │

│    Climb:      0.0 m/min                  ││  24    08    163    00      N   │

│    Status:     3D FIX (1 secs)            ││  43    00    000    00      N   │

│    Longitude Err:   +/- 173 m             ││                                 │

│    Latitude Err:    +/- 20 m              ││                                 │

│    Altitude Err:    +/- 478 m             ││                                 │

│    Course Err:      n/a                   ││                                 │

│    Speed Err:       +/- 1251 kph          ││                                 │

│    Time offset:     -0.511                ││                                 │

│    Grid Square:     FM08pp                ││                                 │

└───────────────────────────────────────────┘└─────────────────────────────────┘


Now, I just need to troubleshoot the shim…

Even though I soldered the connector on backwards shouldn’t the one for one pinout be the same? Or, maybe the serial port connections are not making contact?

Time to ohm it out and check!

20150805_232650.jpg


Nope, pinout is fine - but the gap around the solder pads on the shim and the pins themselves seems to be too big and is not making a connection with the board.

20150805_233338.jpg

This is probably a symptom of me soldering the right angle pins on the wrong side of the shim. Perhaps the holes drilled and plated on the other side of the shim (where the right angle pins are now) are smaller? Rather than desolder the shim/header pins and do it all over again (never have had much luck desoldering right angle pins without destroying the board and the pins) I just soldered the shim VERY carefully to the Pi’s headers with a tiny amount of solder so as to not interfere with the rest of the GPIO pin on the board itself. I want it to be reliable and at least somewhat durable anyways! A quick run through with the continuity tester verified this fixed the problem.

20150805_235154.jpg20150805_235034.jpg

Reassemble and power back up the system and continue with the testing!


The cgps command checks out - I get a fix! 

Running the weather python script displays the data to the screen but it isn’t acting the same. The buttons/city toggle aren’t working now! 

Unplugging the microstack/GPS module doesn’t seem to help matters any.

Looks like more troubleshooting is needed. Perhaps the shim/my soldering is preventing the CAD from seating all the way? It looks fully seated.


Running through the print(cad.switches[x].value) in Python while toggling the switches seems to be working fine. I’m not sure what has changed at this point as all of the buttons seem to be working but the weather.py demo program is not.  Moving on!



August 6th 2015: GPS output to LCD screen

Referencing:

Microstack GPS and Piface Control and Display Geocaching by callum smith

This code will simply get the coordinates and time from the GPS and display them on the LCD:

#!/usr/bin/env python3
"""
Grab data from GPS and spit it out to LCD
"""


import sys
PY3 = sys.version_info[0] >= 3
if not PY3:
    print("Please use `python3`.")
    sys.exit(1)


###import libraries and set up gps
from time import sleep
import pifacecommon
import pifacecad
import sys,math,time,microstacknode.gps.l80gps
gps=microstacknode.gps.l80gps.L80GPS()
cad=pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
cad.lcd.cursor_off()
cad.lcd.blink_off()
cad.lcd
cad.lcd.home()
cad.lcd.write("Obtaining pos...")


while True:
    cad.lcd.home()
    current_pos=False
    while current_pos==False:
      try:          # try command used to prevent crash when no response from GPS
          current_pos=gps.gpgll          # gets current GPS position
      except (microstacknode.gps.l80gps.DataInvalidError, microstacknode.gps.l80gps.NMEAPacketNotFoundError):          # if no GPS response or if response is invalid
          time.sleep(1)                    #pauses before retry to connect to GPS
          cad.lcd.write("No GPS Lock\nTry moving or check ant")
    cad.lcd.write(str(current_pos["latitude"])[:7]+","+str(current_pos["longitude"])[:8]+"\n"+str(current_pos["utc"]))
    time.sleep(1)                    #pauses before looping to allow user to read output
    #cad.lcd.clear()  #will cause flickering but will ensure no mess is left on screen





August 12th 2015:

This code will grab the coordinates from the GPS and stick them into an array. Once 10 values have been accumulated it will spit out the average and standard deviation.

This is a VERY basic averaging and not the permanent or intended method of obtaining a 'high accuracy' reading. In this mode it takes 10 seconds for the averaging, I intend to speed up the GPS output to 10Hz which will give a simple average once per second.

The goal of this method is to provide a baseline (which will be logged to a CSV file by the Pi) to compare methods of obtaining a highly accurate location.

This method will be called 'Simple Averaging' and will be compared with 'Recursive Averaging', the Kalman filter, the Wiener filter, autoregressive-moving average (ARMA), and the method outlined in the paper referenced above which improves position while moving. Once the data from these methods is graphed I will decide which method to implement for the geocaching tool.

#!/usr/bin/env python3
"""
Grab data from GPS and average it
ToDo: Log to csv for processing
"""


import sys
PY3 = sys.version_info[0] >= 3
if not PY3:
    print("Please use `python3`.")
    sys.exit(1)


###import libraries and set up gps
from time import sleep
#from threading import Barrier
import numpy
import sys,math,time,microstacknode.gps.l80gps
gps=microstacknode.gps.l80gps.L80GPS()
lat_pos = numpy.zeros(10)
lon_pos = numpy.zeros(10)


current_pos=False
while current_pos==False:
    try:          # try command used to prevent crash when no response from GPS
        current_pos=gps.gpgll          # gets current GPS position
    except (microstacknode.gps.l80gps.DataInvalidError, microstacknode.gps.l80gps.NMEAPacketNotFoundError):          # if no GPS response or if response is invalid
            time.sleep(1)                    #pauses before retry to connect to GPS
#print(current_pos)                                # for debugging
count=0
lat_pos.itemset((count),current_pos["latitude"])
lon_pos.itemset((count),current_pos["longitude"])
while True:
    if count == 9:
        print(lat_pos)#+" STD: "+numpy.std(lat_pos)                                # for debugging
        print(lon_pos)#+" STD: "+numpy.std(lon_pos)                                # for debugging
        print(numpy.mean(lat_pos, dtype=numpy.float64),numpy.std(lat_pos))                                # for debugging
        print(numpy.mean(lon_pos, dtype=numpy.float64),numpy.std(lon_pos))                                # for debugging
        count=0
    else:
         count += 1
    try:          # try command used to prevent crash when no response from GPS
        current_pos=gps.gpgll          # gets current GPS position
    except (microstacknode.gps.l80gps.DataInvalidError, microstacknode.gps.l80gps.NMEAPacketNotFoundError):          # if no GPS response or if response is invalid
            time.sleep(1)                    #pauses before retry to connect to GPS
#    print(count)
    lat_pos[count]=current_pos["latitude"]
    lon_pos[count]=current_pos["longitude"]

 

 

Next step is to implement data logging and then the other methods of improving position.

  Getting excited to let this TB loose in the big wide

Open world. Here it is all dressed up. Have set the

Goal to travel to Wanaka to experience the beauty

Of New Zealand. Maybe I can meet it there one

Day.......

 

20150809_091049-1_1.jpg

I was thinking this little kit might make an excellent ground station for my model aircraft.

I have a little 900MHz telemetry system that could be connected over serial to the Pi and I should be able to use the Pi to send commands to the UAV...

 

What kind of features could I add with this? Maybe a GPS based antenna tracker, or a simplified control system for changing way points?

Simple things like reporting distance to current (or last known) position would be helpful, especially in locating a crashed craft.

 

Some possible roadblocks:

Does the Pi have more than one serial port?

Can it handle processing high speed input from two GPS sources?

Just a simple Python script to display the location data to the LCD (PiFace CAD):

*This is not by any means a clean program - I haven't removed unneeded imports and the display portion includes a counter I was intending to use but haven't implemented yet*

*This is just a simple demo to show it is working*

#!/usr/bin/env python3
"""
Grab data from GPS and spit it out to LCD
"""


import sys
PY3 = sys.version_info[0] >= 3
if not PY3:
    print("Please use `python3`.")
    sys.exit(1)


###import libraries and set up gps
import urllib.request
import xml.etree.ElementTree
from time import sleep
from threading import Barrier
import pifacecommon
import pifacecad
import sys,math,time,microstacknode.gps.l80gps
gps=microstacknode.gps.l80gps.L80GPS()


current_pos=False
while current_pos==False:
    try:          # try command used to prevent crash when no response from GPS
        current_pos=gps.gpgll          # gets current GPS position
    except (microstacknode.gps.l80gps.DataInvalidError, microstacknode.gps.l80gps.NMEAPacketNotFoundError):          # if no GPS response or if response is invalid
            time.sleep(1)                    #pauses before retry to connect to GPS
#print(current_pos)                                # for debugging
cad=pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
cad.lcd.cursor_off()
cad.lcd.blink_off()
cad.lcd
count=0
last_pos=0
while True:
    try:          # try command used to prevent crash when no response from GPS
        current_pos=gps.gpgll          # gets current GPS position
    except (microstacknode.gps.l80gps.DataInvalidError, microstacknode.gps.l80gps.NMEAPacketNotFoundError):          # if no GPS response or if response is invalid
            time.sleep(1)                    #pauses before retry to connect to GPS
    cad.lcd.home()
#    cad.lcd.write(str(count))
    if last_pos != current_pos:
        last_pos = current_pos
#        cad.lcd.write(str(count)+", "+str(current_pos["latitude"])+"\n"+str(current_pos["longitude"]))
        cad.lcd.write(str(current_pos["latitude"])+"\n"+str(current_pos["longitude"]))
        count += 1
    else:
        count = 1

After a bit of trouble, I was able to get the basic GPS functions working!

┌───────────────────────────────────────────┐┌─────────────────────────────────┐

│    Time:       2015-08-06T02:07:10.000Z   ││PRN:   Elev:  Azim:  SNR:  Used: │

│    Latitude:    3X.650558 N               ││  15    78    169    41      Y   │

│    Longitude:   7Y.667636 W               ││  20    71    001    32      Y   │

│    Altitude:   214.9 m                    ││  21    45    311    29      Y   │

│    Speed:      0.4 kph                    ││  29    44    220    36      Y   │

│    Heading:    252.9 deg (true)           ││  18    26    274    36      Y   │

│    Climb:      0.0 m/min                  ││  24    08    163    00      N   │

│    Status:     3D FIX (1 secs)            ││  43    00    000    00      N   │

│    Longitude Err:   +/- 173 m             ││                                 │

│    Latitude Err:    +/- 20 m              ││                                 │

│    Altitude Err:    +/- 478 m             ││                                 │

│    Course Err:      n/a                   ││                                 │

│    Speed Err:       +/- 1251 kph          ││                                 │

│    Time offset:     -0.511                ││                                 │

│    Grid Square:     FM08pp                ││                                 │

└───────────────────────────────────────────┘└─────────────────────────────────┘


Now to tie the LCD screen and GPS output together.


 

Detailed build log here:

Pi Hiker Doc

I won a Raspberry Pi 2 GPS kit!


My intent is to create a kid friendly, high accuracy geocaching platform that my daughters can use when hiking.

Technical specs:

  • Accuracy of the GPS location could be improved by putting the L80 into 10Hz mode and then performing an averaging function such as outlined in this paper:

          An Effective Approach to Improving Low-Cost GPS Positioning Accuracy in Real-Time Navigation

  • With the addition of a magnetometer, a direction indicator could be added that would not be dependent upon movement to show the target azimuth.
  • We would utilize our Makerspace's 3D printer to print an enclosure for this platform to sit in such that it could be used by children.
  • I think the Pi 2 is a good candidate for this project as it should have the horsepower to perform the averaging function and be able to utilize a database of geocaches downloaded before the trip.

 

Yesterday I received my kit in the mail and got it assembled and running the PiFace CAD Weather demo:


20150805_002419.jpg


Tonight I plan to get the basic GPS functions running.  

 

Detailed build log here:

Pi Hiker Doc

The element14 trackables are running free around the world, and scurrying into the far corners of the global geocaching arena thanks to a legion of members who've set them loose. To celebrate our treasure-hunting helpers we've put together a Geocaching Badge, so you can pin your globe-roaming achievements to your virtual chest here on element14.com.

 

trackable

Blog Your Geocaching Journeys

Much like geocaching itself, bagging this new badge is very simple in principle, but demands a degree of perseverance and endeavour if you want to acquire it. Anyone who's ever found themselves within a few feet of a cache that simply won't reveal itself from a cunning hiding place will understand that mentality quite profoundly.

 

In fact, that's what we want to hear all about in order to hand over the Geocaching Badge. Open up a blog here in the Geocaching space, and tell the world all about your adventures in launching your element14 trackable. Or, if you were out in the wilds and happened across one of these elusive electronic dog tags, we want to hear about that, too.

 

Hunting for Science

Our very own Sagar "bluescreen" Jethani put together a fascinating crowd-sourced map that pinpoints places of scientific discovery around the world, which we're hoping many of our trackables -- and therefore the people who secretly ferry them from cache to cache -- will get to see and connect with these important locations.

Atlas

You've been helping us to add new and interesting places to the list, and we're always looking for cool new geo-locations where science and tech history happened; whether quietly, explosively or controversially, so let us know of any hot spots of creative discovery you're aware of, and we'll add it to the atlas.

 

Raspberry Flavoured Caching

And while we're busy promoting the new Geocaching Badge, let's give another round of applause to the winners of our Raspberry Pi 2 GPS kit, which cstanton has been hacking together to help you hunt those science-loving trackables down. These 10 tech-touting treasure hunters are the first recipients of the Geocaching Badge, whose proud ranks you'll be joining when you blog up your location-based adventures here on element14.

 

Cache, and be merry, members!

GPS kit