Raspi-Riscy Rehab (5)

josm-tracker-test-raspi-riscy-gps2Figure 1: First test run of the GPS module in the Raspi-Riscy “tablet” (click to enlarge).

Getting back to the GPS

Since discovering that the placement of the GPS module was very critical, and having moved all the wiring away from the little corner of the box where the module was relocated,  I was in good position to perform the first test of the GPS module “on the road” …

Figure 1 shows the little trek I made to the grocery store and back, to test the map-making capability of the device.  Variously, I walked on one side of the street on the trip to the store, and on the opposite side of the street on the return trip, just to make things more readily apparent.  The new tracking device didn’t do too badly, IMO, with the exception of a stretch of the return track, some of which very closely borders a line of tall trees.

I didn’t think I’d fared too badly for a first test.  The procedure was extremely primitive. I booted Raspbian before leaving the house, and used the command:

cat /dev/ttyAMA0 > first-test-gps1.nmea

When I reached the grocery, I picked up a few items (hey – I was hungry by that time!) – and reset the line to:

cat /dev/ttyAMA0 > first-test-gps2.nmea

Back at home, I started JOSM (Open Street Maps) on my NetBSD desktop, clicked the menu item open->file, selected the .nmea files in the file dialog that appeared, and clicked the OK button.  The result is what is shown in figure 1.  With the 5.5 hour battery time the new NiMH AA cells are delivering, I should be able to map the city now.

What I like about JOSM is that you don’t need to be connected to the internet. My Raspi-Riscy “tablet” has WiFi, but no cellular, so I could not use real-time Google maps or some other web oriented service to create map tracks.  JOSM caches all map info locally, so I’m able to go build maps without any other connections, so long as I’ve previously grabbed an area at least as large as the one I intend to explore.

The GPS is a U-blox unit with a four wire serial connection (3.3VDC, TX, RX, and GND).  It is about a square inch in size (microcontroller/gps board) and the associated active antenna is also a square inch in size. There is a two inch long micro-coaxial cable between the GPS controller and the antenna.  The 3.3VDC hookup is very convenient, because no adapter is needed on the Pi.  It’s a direct solder job from the GPS to the J8 header on the Pi2:

  • Pi2  U-blox
  • P1 – 3.3 Power (meaning P1/J8 on the Pi2 to 3.3 VDC power on U-blox)
  • P8 – RX (meaning P8/J8 on the Pi2 to RX on U-blox)
  • P10 TX (meaning P10/J8 on the Pi2 to TX on U-blox)
  • P6 – GND (meaning P6/J8 on the Pi2 to GND on U-blox)

(Note: I soldered to the female header pins, and NOT directly to the J8 pins! I’m pretty sure the Pi3 has the same numbering scheme for the connections).

I needed four female header wires, in order to make the connection to the J8 male header on the Raspberry Pi2. I had exhausted my supply of female ends, so I submitted another email order to BGMicro (they are great!)  In the meantime, what was I to do?  Well, I had a bunch of old 3.5 inch floppy drive cables laying around (I tend to hang onto stuff)!  I used a large dikes tool to cut off enough of the cable socket for the job at hand.  These old cables often have internal shorts across specific connection points, for things like GND connections, so I always test the cables with a volt-ohmeter before use!  That may just  save my Pi!  In my case I pulled the floppy cable off of the header end, and soldered my own small gauge wires directly to that header.  Such old cables as these use pinch-pins (they are not soldered), but the pinch pins can be soldered.  I just take care to use only a little solder, and check to be sure it’s not shorted afterwards. I also check that I have a sound electrical and mechanical attachment.

Note the cross-over between the Pi2 and the GPS board relative to TX and RX. The Pi2’s RX is connected to the GPS’s TX, and the GPS’s TX is connected to the Pi2’s RX. Sort of like an ethernet CAT5 crossover cable.

One may wonder why I sometimes refer to my “homemade” tablet as the Raspi-Riscy, and then use Raspbian?  Well, I intend to use RISC OS with the tablet, and make that work with the GPS as well as it does on Raspbian (here’s hoping!) I have already downloaded the third party serial communications software module that is needed for RISC OS, but haven’t yet tried to run a GPS with it.  That’ll be fodder for another post!

josm-on-pi2Figure 2: I thought JOSM would be slow on the Pi2, but I found it tolerable

In the figure (above) one can see both cgps and JOSM running on the little seven inch screen of the Pi2 powered “tablet”.  I thought JOSM would be too slow to be useful actually running on the Pi, but I found it was tolerable to use. Not snappy, mind you (it’s a java program).  This fortuitous event has saved me from having to continually trek back to the house to see map results!  I’m all for that.

Note: the screenshot license for this shot is shown at bottom of screen.

It seems that a good candidate for a simple “home brew” app would be something that can display the tracks without Java.

For more info on the GPS testing, see:

Read More about the GPS …

Go to the next page of article

Screenshot licenses: The screenshot at the top of the article is of a program that has been released under a free software license (JOSM, located at http://www.openstreetmap.org and josm.openstreetmap.de). As a derivative work of that program, this screenshot falls under the same license. Full Text License Source: http://josm.openstreetmap.de/browser/trunk/LICENSE.  Any contributed OSM data shown is licensed under the OdbL: opendatacommons.org/licenses/odbl/

The screenshot in Figure 2 is of a program that has been released under a free software license (Copyright: LXDE team: http://lxde.org). As a derivative work of that program, the screenshot in Figure 2 falls under the same license. The full text of the licences (GPL 2.0+ and LGPL 2.1+) may be found at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html and http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.  Cgps is believed to be under a BSD two clause license.

Note: This author and site is not affiliated with the Raspberry Pi in any way. For information about those projects visit  http://www.raspberrypi.org. This author and site is not affiliated with JOSM in any form whatsoever. “Raspberry Pi” is a trademark of the Raspberry Pi Foundation.

NetBSD is trademarked by the NetBSD Foundation, Inc, and the operating system can be found at http://www.netbsd.org. 


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.