Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Building a RPi based GIS Tablet

Fri Jan 23, 2015 3:24 pm


I am interested in Australian terrestrial orchids and carnivorous plants. I like to count and record data about them. At the moment I use a combination of 'Waypoint' (is there a better one than this?), 'GPS Hiker' and the 'LogGPS' iPhone Apps to handle this, but while they are ok, it would be nice to have a proper GIS tablet to handle the process. I can't justify a $2,000 - $20,000 commercial GIS tablet, so I thought I would have a go at making my own. You get lots of time to ponder these things as you walk around in the bush!

I am having a go at expanding what very little I know about Python to write and building hardware for my own prototype GIS Tablet: GIS-Pi.

* be project based, so I can call up and add data to previous projects or areas of interest
* Done: press the keyboard 'P' to take a photograph via RPi Camera
* Done: display and record where I have walked
* Done: display and track up to 3 waypoints around me
* Done: allow me to enter GIS metadata and notes about a waypoint (plant sighting)
* Done: display GPS error, distance from last data entry
* Done: possibly display a simple georeferenced map/aerial photo under the breadcrumb based tracked walk
* Done: save all data directly into a Shapefile format to allow for easy uploading into

Hardware Specifications:
* RPi A+
* Adafruit Ultimate GPS V3 board
* an i2c 3D compass board (haven't selected on yet)
* HDMIPi screen, or a smaller 5" HDMI board with touch screen. When is the official RPi touch screen being released?
* audio output for audio feedback, via sounds and the festival speech synthesis
* on screen keyboard, or an arm mounted Bluetooth based keyboard
* DS18B20 Temperature sensor, cheap and easy to integrate
* RPi camera, while not the best for close up photography, it's better than nothing and it's cheap and easy to integrate and georeference the photographs
* 18650 Li-ion batteries
* maybe a i2c based voltage/current monitor board for power management
* 3D printed ABS housing

Time frame? It would be nice to have something usable for the Australian Spring season, Sept/Oct 2015

Just out of interest to anyone else interested in playing around with GIS on a RPi, there is this Digital Geology thread that mentions GIS tablets as well: ... =41&t=3859 and some link to other software and non-RPi projects. I was particularly interested in the QGIS Roam project, if it could run on a RPi:

Love to hear about what other people have built or played around on the RPi platform.
Last edited by Parkview on Sun Apr 05, 2015 1:30 am, edited 4 times in total.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Fri Jan 23, 2015 3:37 pm

So where am I up to so far?

I can now:
* read and write data via Python to Shapefiles
* collect and record GPS data to CSV or Shapefiles
* auto set the RPi NTP service via the GPS data stream
* add GPS coordinates to a RPi camera photo
* collect temperature from a DS18B20
* have some test code and playing around with pygame and displaying GPS data (see attached demo screenshot)
* can read the Adafruit INA219 DC current sensor
* can play text msgs via Festival out the audio port

most of the above comes from different RPi projects I done done in the past, but now I have to integrate all the code. There is much more to learn.
Test display for the waypoint/map screen
Plotting_GPS_Data.jpg (24.29 KiB) Viewed 10189 times

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sat Jan 24, 2015 10:38 am

So far I have been pulling GPS data from a fixed Shapefile, ie: not directly form the GPS unit. This has allowed me to compare and make sure the data is what it's meant to look like.

I am not plotting waypoints (WP) on the screen (red dots), and WP outside the screen boundaries will be displayed at the closest edge in a difference color (white).

The GPS track fades out to a light blue over the last three fixes.

The screen can now display a kind of georeferenced aerial image. To test out the display, I took a QGIS plot of the track shapefile and I manually cut out the relevant section of the image, saved it to a file, and loaded it into the GIS-Pi program. After transforming the image and a bit of playing around, I found I could plot the incoming shapefile data pretty well on top of the old QGIS image dots.

The WP dials now displays an arrow that points to the relevant waypoint and the distance to it. These move around for each GPS track point.

Next up I have to figure out how to deal with incoming data direct form the GPS unit. At the moment, I have had it easy, as I can query the shapefile and have it report back it's boundary box. The shapefile boundary box will change and grow as I walk further along a track, ie: not curling back on myself. This means that the displayed map is continually going to change in size and resolution. I might not want this, maybe I might just want my current position to stick to the center of the screen, and let the map move about. Lots to ponder on this issue.

I am presuming that out in the field I might record the GPS every 5 or 10 seconds while I am working around. It might auto pause if I am not moving. I will have to work on cutting down on the SD card reads, so i can speed up the program? More testing needed later on regarding this.

I haven't written any mouse functions yet, so the black zoom in/out buttons don't work at the moment.

Below is a screenshot of how it looks as at the moment:
Plotting GPS Data and WP and WP Dials working.jpg
todays screenshot
Plotting GPS Data and WP and WP Dials working.jpg (31.55 KiB) Viewed 10113 times

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sat Jan 31, 2015 9:33 am

It's been a week of staring at spaghetti Python code. Over the week, I have moved the linear code into functions and fixed a number of troublesome bugs along the way. Isn't that's what coding is all about :lol:

I still have to provide a geo-referenced background image, but then I can (still via code), tell it how many GPS fixes I want to collect, and away it goes, plotting away. Below is a recent screen shot of 15 GPS fixes taken 1 second apart.
Live tracking1.jpg
Tracking Live GPS Fixes
Live tracking1.jpg (32.06 KiB) Viewed 10018 times
As per usual, the background image is taken from QGIS. I left the green waypoints on the image to see how well the GIS-Pi red waypoints line up. Yes, they are a bit out, that means I didn't georeference it correctly, but good enough for the moment.

You can see the blue GPS fix dots doing a runner as they sweep off to the left hand side.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Feb 01, 2015 1:42 pm

It's been a productive programming session. Now that I had the code functionised, I could get on with some fun things. Previously GIS-Pi would just record xx number (set via a for loop), of fixes. That's fine for testing, but not so handy out in the field.

I have had a win with implementing some mouse and keyboard pygame events. I can now turn on recording, pause the recording, or stop the recording. The buttons change color and symbols depending on what's going on.

I have partially implemented a boundary check on the GPS fixes, in that if they wander outside the map area, they will stick to the nearest boundary and should be displayed in white (this will change down the road, because the WP's could be white too if they are outside the map display area). It's still not working 100% as the white dot is later over ridden.

As you can see from today's screenshot below, I have added some info on the GSP fix error, and the number of Satellites in the sky, along with the number of used satellites. Handy when your walking around and wondering why you can't get a good fix!
Live tracking2.jpg
Recording Buttons and satellite info
Live tracking2.jpg (34.14 KiB) Viewed 9947 times
I haven't mentioned this before, but every now and then one of the WP dial red arrows looks a bit wonky. This is because in a function, I draw the arrow at 0deg, then use pygame.transform.rotate function to rotate the WP surface/sprite to the required angle. I tried other approaches, but this seems to work out the easiest for me.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sat Feb 07, 2015 2:29 pm

I managed to get some time in on the project during the week. I have separated out out more code so that I can now run multiple screens and I have added in a set of buttons across the top so that I can flip between them. The MAP screen (images above) is back up and working again and I have started working on the DATA screen:
The beginnings of a data entry screen
Data_Screen1.jpg (9.29 KiB) Viewed 9827 times
This screen will allow me to enter a GPS fix for the current location and enter some text about the location, ie: 2 x Purple Enamel orchids. There isn't much on it yet. The PYGame module is pretty low level, and last week I wondered how I was going to present a textbox, or a textarea box. Nice and easy in a high level programming language, but it turns out it's not so easy in PYGame. Different people have written different modules to scratch their itch. I ended up investigating: extext, textarea (looks promising, but a lot of learning to do, as it relied on a separate pgu gui module) and inputbox. I went with editing the simple module so that I can display text as well as editing it. It's a start and will keep the project moving, even if I have to replace it later on.

The above DATA screen, will eventually have an edit box and display a list of previous entered data on the screen. Ideally, it would be nice to implement an on-board keyboard, just like a smartphone, but I might not have enough screen real estate for that. I have yet to investigate the one the Adafruit listed for their PiTFT LCD screen. The manual GPS fix data will go into a separate Shapefile for later use and display.

Disregard the colors, I will fix them all up towards the end. At the moment, they are what ever comes to mind at the time

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Feb 08, 2015 1:36 pm

Managed to get some further work done on recording a manual GPS fix via the DATA screen. The screen will pop up two fields where I can record a quantity (count) of something and then some notes against the fix. These two items, along with a subset of GPS available info: datetime, Latitude, Longitude, Altitude, EPX, EPY, HDOP (worked out from EPX & EPY), Number of visible satellites, number of used satellites (handy to know the quality of the signal), are all written to a different Shapefile.
Data entry
Data_Screen2.jpg (15.4 KiB) Viewed 9782 times
The white text listed out below the input box field are previous data I have entered in. the line consists of: item no: distance from last manual fix - Count Notes.

The white text at the top keeps updating as well. This allows me to wait to try and get a better signal and feed back on why it might be bad, ie: low number of used satellites. The iPhone doesn't give me data! Once I am happy with the data, I can press the 'o' key, or click on the OK button to save the data to the Shapefile.

The OK button label will be changed to SAVE. The buttons appear contextually, ie: as needed. It would be nice to display the manual GPS fixes on the MAP screen. It's on my todo list.

The white text near the top RH side, is: E = HDOP, SAT: [no satellites / used satellites ]. It's interesting to see that if I have nine+ used satellites, then the GPS signal is pretty stable and doesn't wander as much as if there is only five. So much so, that at one stage it wouldn't move at all and for a while I thought my code was broken.

The above is all pretty rudimentary, but as long as it work acceptably, then it's scratching my itch for the moment. Next up will be the WayPoint screen. I need to be able to add in new waypoints, and select up to three for use on the MAP screen.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Tue Feb 17, 2015 1:35 pm

Not much work over the last weekend, but I did get a few specky things done.
  • I added a Waypoint data screen. This allows me to Add, Edit and Select the three waypoints that are going to be displayed on the Map dials
  • Used WP's are highlights in a different colour
  • Manual GPS fixes are now displayed on the MAP screen. I can handily see what things I have collected
  • Added some handy notes about each Waypoint. Kind of handy as I won't remember what the Lat/Long record is about! Text is good.
  • I figured out how to add a line (underscore) to the relevant keyboard shortcut
  • Changed the Total Satellites/Used Satellites around (thanks Stephen)
I spent way too much time trying to debug the PYSHP modules Shapefile.Editor function. It's slowing me down, so I might have to create a workaround function, as at the moment, I can't add WP's to an existing shapefile.

Today's screenshot is the MAP page showing an added WayPoint (middle red dot), and the Green dots are some manual GPS fixes. You can also se the top buttons now have a character underlined:
Live tracking3.jpg
Live tracking3.jpg (37.31 KiB) Viewed 9626 times
One day, I will get around to setting each WP dial to a different color that matches the MAP dot. At the moment, one of the white WP dials matches one of the Red WP dots on the MAP screen, but which one is which?

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Feb 22, 2015 1:27 pm

This weekend, I looked over the L O N G projects ToDo list, and just picked off a few of the easy ones.

When using python to talk to the GPSD service, and with pygame in general, if there is an exception causing programming bug, it will hang the program, causing me to have to run: 'ps ax | grep python' and then 'kill -9 <python process id>' It finally got to me and so I setup an outer: try/except/finally statement, that prints out the error and then pauses waiting for a 'y' to be entered in to cleanly close the program down. I love python!

Mindful that by pressing the <ESC> keyboard key, that the program would automatically exit and close down. I have added a popup msg box to make sure I really want to close the program down. I will re-use this pop-up msg box technique for other sections of the program.

I figured out (not really that hard), to load the background image at 50% transparency. That didn't really look that great against a blue background, so I changed it to a white-ish color. Ideally I should only colorise just the top half of the MAP screen as opposed to the entire surface. It's on the ToDo list.

The fun one was to finally getting around to colorising the WayPoint dials and matching MAP dots. Now I can kind of see which dial matches which dot. Of course I should really come up with a better color scheme, but that's on the ToDo list as well. I one day I could concoct some different 'Themes' that could be loaded via the SETUP page. The colors on the dials and way cool, but the MAP dots are a bit hard to make out:
Live tracking4 - coloredWP.jpg
Colorised WayPoint dials
Live tracking4 - coloredWP.jpg (28.69 KiB) Viewed 9504 times
As Eben recently mentioned elsewhere, it's looking like the RPi touch screen display will be released by April. It's going to have a resolution of 800 x 480 and cost around US$69. It will connect to the RPi via a DSI ribbon cable. GIS-Pi will eventually be redesigned to operate using this display. Moving from 400x400 to the RPi display will seem luxurious with all those lovely extra pixels to light up. Bring it on!

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Mar 01, 2015 3:47 pm

It was a bit of a quiet week, but I managed to get some quality geek time over Sat/Sun to work on a few things. I had a play with pyDoc and run pylint over the gis-pi project code files. I installed 'autopep8' python script and had it fix all the whitespace warnings. Very cool piece of code.

I had a quick play with the new release of Tangram-ES 2D/3D tile viewer, but I can't see it working for me, so moving on...

Got the code reading keyboard shift characters. I can now input keyboard Uppercase and symbols - very cool.

I have been putting it off for a while, but on Sat. afternoon, I got the code to edit Shapefiles working correctly, so I can now append records to a shapefile. As per one of the previous blogs above, I can also add in new WP's and select entered WP's from the shapefile.

I have been wondering how to import and use new background images. I have still to automate the process, but basically, I can use the QGIS | Raster | Extraction | Clipper tool to save a section of a ECW Raster file into a Geotiff file. I then manually convert the EPSG:28350 GeoTiff to a EPSG:4326 (Lat/Long) file and store it onto the import/ folder on the RPi SD card.

GeoTiff files are very large compared to jpg files. in fact, a jpg file is less than 7% the size of a GeoTiff! For example, a 1.3km x 950m section of imagery is 14.4MB and is slow to process on a 700MHz RPi. By installing the GDAL and it's python wrappers, I can run: gdal_translate -of jpeg test_block3_4326.tif ../imagery/test_block3_4326.jpg and it will convert the 14.4MB GeoTiff into a 0.9MB JPEG file.

I also need to find and extract the GeoTiff image corner Lat/long's. There is a neat GDAL utility that can grab a folder of GeoTiffs, extract the file extents and store them away in a Shapefile: gdaltindex ../shapefiles/imagery.shp *.tif Essentially the imagery.shp Shapefile has become my imagery DB, as it contains the Lat/Long of the file corners and the file name. I need this data to be able to adjust the MAP display and corresponding GPS tracks and WP's on the fly.

The picture of the day is a simple/ugly SETUP screen that is listing all the image files (names have been partially redacted), that I can load into the MAP screen:
Pick a map image file to load
setup_image1.jpg (13.75 KiB) Viewed 9360 times
This works really well, and the WP's and blue GPS tracking dots adjust to match the new image pixel resolution. At the moment though, I don't replay the GPS track dots, so they just carry on fresh on the new MAP screen.

Posts: 2
Joined: Tue Mar 10, 2015 6:34 pm

Re: Building a RPi based GIS Tablet

Tue Mar 10, 2015 6:52 pm

First off, I find this project really interesting and I commend your work. Secondly, how are you or are you offloading your prior GPS coordinates? I have seen a few projects where people overlaid GPS coordinates onto a Raspberry Pi to have maps available to them in remote locations but it appears that you are gathering new data. Do you simply start over when you are done or are you offloading the information to an outside source or database? You may have already mentioned this and if I missed it, I do apologize. Are you creating shape/kml files to export so you can add them as an overlay to places that you have already visited? Basically, I would like to be able to create and export shape/kml files in the opposite way from which they where imported to a Raspberry Pi as shown here: . I want to export data from the Raspberry Pi to create my own map overlays.

Thank you again for this interesting project. It is amazing what the Raspberry Pi can do and how much fun it is.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Tue Mar 10, 2015 11:39 pm


I currently am using QGIS to export the background imagery raster files. QGIS can also export a set of waypoints, or I can manually enter them in from the keyboard, or use the current location.

Yes, the major use of a GIS tablet is for data collection. While I have yet to setup a project based framework, I hope to be able to load a past set of data and continue on with data collection.

Yes, all data that's collected can be imported into QGIS (or any other commercial and OSS [free $] GIS package, ie: ArcGIS, MapInfo, MapWindows etc), for proper/easy viewing.

As per usual with computers, there are many ways of doing things. I have been using this project to learn more about programming in Python, so I have been using the wonderful: pyshp module to handle my shapefile data. To install: sudo git clone so yes, you should be able to do that with a RPi.

Posts: 2
Joined: Tue Mar 10, 2015 6:34 pm

Re: Building a RPi based GIS Tablet

Wed Mar 11, 2015 12:18 am

Thank you very much for all of the information. Sadly, it wasn't until after I had posted that I noticed that you had already answered many of the questions that I had. Sorry for that. I work in IT and I need to remember to read the manual or the forum completely before posting a question. I guess I got overly excited. Again thank you. This gives me a good starting point and way forward.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Mar 15, 2015 3:10 am

Let’s get physical. At the moment, the weight budget GIS-Pi consists of:

2456g - SLA Battery 12V 7Ahr
685g - HDMIPi + RPi B + RPi Camera
106g - wireless keyboard/mouse unit
100g - breadboard + GPS & volt/current modules
31g - external GPS antenna
~50g - misc cables (not measured)

212g - 4 x 18650 Li-ion UltraFire 3.7V 3600mAHr (really 2200mAhr) batteries

12V Power Measurements:

720mA - Booting up HDMIPi + RPi B
700mA - command line idling
760mA - peak while running xWindows and GIS-Pi
270mA - peak while running xWindows and GIS-Pi and HDMIPi screen switched off

The above was measured while the GIS-Pi gear was running from a 12.26V Sealed Lead Acid (SLA) Battery. I haven't been able to find out what the actual voltage specifications or tolerances of a HDMIPi is, but mine has run with a input voltage as high as 12.85V. Just to be safe, I will have a go at running the Li-ion battery stack via a LM1085-12 low drop voltage regulator. The minimum voltage input for it is 13.5V, it too will help protect the Li-ion batteries from being run too low.

I would expect that I should be able to run the GIS-Pi unit with the screen switched off for some of the time. At the moment it's quite easy to turn the screen on/off, which is nice. The HDMIPi screen is a 9" IPS display. While nice and it's viewable outside, I don't really need something that large. A 7" or maybe even 5" screen should suffice. This would also cut down on the current draw.

The HDMIPi unit is quite heavy, so if I am going to stick with that, I will have to look at designing a lighter 3D printed ABS case for it all. At the
moment, I run the unit off a 12V 7Ahr SLA battery. I have ordered another set of four 18650 UltraFire 3.7V 2200mAhr batteries and some holders. This will give me 4400mAhr capacity. With a full current draw of 760mAHr, they should last: 4400 / 760 = 5.78Hrs or 5:47Hrs or run time, more if I run it with the screen switched off.

My current plan is to use a Adafruit INA219 to keep tabs on the current draw and to subtract the running current from the total amount. This will give me a very approximate battery life. By monitoring the voltage, it will be able to see when it's close to being fully discharged and should therefore be auto-shutdown to protect the batteries.
GIS-Pi_outside1.jpg (44.68 KiB) Viewed 9045 times
GIS-Pi_screen1.jpg (62.08 KiB) Viewed 9045 times
Photo taken in the shade. It's hard to photograph the screen in full sunlight, but it is viewable. A redacted debug window running behind GIS-Pi window.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Mar 15, 2015 3:36 am

Two weeks ago, I discovered that GIS-Pi would no longer run native form the CLI. All I get is a blank screen when being run from the CLI. It will only work when it's run via xWindows. I have spent a lot of time trying to troubleshoot the issue. At the moment, I am putting it down to a driver issue, as I have problems even trying to draw a simple colored pygame surface, so it's not a GIS-Pi issue, its a pygame driver problem.

I have tested many things over the last two weeks, and rebuilt the SD card many times, but I still haven't isolated where it's going wrong, or what third party apt module is interfering with pygame. I have spent way too much time on this and as it's running ok in xWindows, so I will stick with that for the moment and keep developing.

By the way, here is a rough install procedure that I am currently using to build a development base for GIS-Pi:
  • Burn SD card

    Boot SD Card, auto run Raspi-config: expand drive, set Hostname: gis-pi, enable SSH, enable camera, reboot

    sudo apt-get update && sudo apt-get upgrade

    sudo apt-get install git python-scipy espeak python-setuptools gpsd gpsd-clients python-gps tightvncserver subversion samba samba-common-bin locate -y

    sudo easy_install pip

    sudo pip install pyttsx ; python wrapper for espeak

    sudo git clone

    configure: samba, gspd, NTP for gpsd, screen font size, copy over GIS-Pi files and directory structure

NOTE: python-picamera, python-pygame and python-numpy are already installed. Of course, tightvncserver, samba, locate and subversion are not needed to run GIS-Pi, they just aid in the software development side of things. I will update the above list if other modules are added at a later date.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Mar 22, 2015 1:49 pm

I added in a few extra functions recently:
  • I can now press the ‘PrtScn’ keyboard button to save a screenshot of the MAP display. No more taking manual screen shots of the VNC screen and cropping the image down to the GIS-Pi screen.
  • Pressing ‘p’ on the keyboard will take a photo using the RPi camera that’s currently mounted on the HDMIPi display. I have set it for a few seconds of preview time before it takes the photo. All done via the now built in picamera python module. Before I take the photo I read gpsd for the current GPS settings and add them into the JPEG EXIF metadata. Both this and the above screen shots are automatically saved with the current gpsd datetime in the filename.
  • A few weeks ago, I wrote a routine to import GeoTagged TIFF images into GIS-Pi. The routine now is that before I go outside I use QGIS to cut out any raster images I might need from a Georeferenced image of the work area I am going to be in. I save those directly to the GIS-Pi Import directory on the RPi SD card via a Samba share. I then go to the GIS-Pi SETUP screen and select the Import button, and it will convert the GeoTiffs from one coordinate system and save it as a non georeferenced JPEG, but store the filename and georeference coordinates into a shapefile. It can import a bunch of these images in one go. Larger images (1km x 1km) will take quite a while to process on the RPi B. I have yet to compare this function with the newly arrived RPi 2. I am waiting on the new HDMIPi backing plate so I can mount it properly.
  • I saw that the pygame.fill function has a rectangle option, so I can now just fill in the top section of the screen and leave the bottom map section clear. I have been able to bring the map image alpha channel up to be 70% full brightness, as opposed to the previous 50%.
I have also ordered some 3.7V 2200mA 18650 Li-ion batteries and holders for the project. This will make it a lot more portable than lumping around a 2.4Kg lead based battery!

When I start recording my walking track, the code use to record every fix to the SD card. This happened at about once per second, which isn’t really needed as generally I walk rather slow while I am searching of things to record etc. I have now implemented a small routine that forces it to only record once every nn seconds. By default that is every 10 seconds, but I will eventually have a SETUP page where I can adjust it. I could have a distance based setting as well, but that would require the RPi to do a lot of maths each second to figure out if I have walked further than xx number of metres. Seconds will do it for the moment.

When I change screens away from the MAP screen, the program would over write the screen surface with the new screen and I would lose all the old user track data. WayPoints and User data where ok, as they are redrawn fresh, as there are only a few of them. I found a quick way around that issue was to backup the screen image and restore it when the user changes back to the MAP screen. There are around two screens where that isn’t possible, so I will look at setting up a Python Class to help record the last 100? or 200? GPS track data points (lat/long) and replay them onto the screen as needed. It will be interesting to see how long this will take. This will help when I load a new map Raster images to the MAP screen. One of iPhone Apps does this, and you can see there is a bit of a delay while the previous track dots are written back out to the screen.

I am concerned about running out of RAM while using the RPi B. I do have the RPi 2, which comes with a faster CPU and 1GB of RAM, so that will help a lot and I would say RAM issues won’t be a problem. . In the meantime, I have written a few functions to help display the free RAM and disk space. These will eventually show up on a SETUP screen. At the moment, they are just being Printed out to the console display. It shows I have around 15MB free. Yes, there is most probably more that it can claw back, but it is a yard stick to measure against. The GPU has been allocated 128GB RAM, so I could also try cutting that down to 64MB to see how it all performs.
A wondering GPS signal!
gis-pi_screenshot_2015-03-21_1654.jpg (24.09 KiB) Viewed 8878 times
I don't have an interesting screen shot this week, however, here is a screenshot I took while I was testing out the 10 second recording function. Sometimes the GPS signal is rock solid and it can sit on one place for a l o n g time. So much so, that I have to cover up the window based antenna to get the track display to move. Other times it's whipping across the screen ~70m in only a few seconds. I have had a instances where there is no reliable signal at all and I can't even start GIS-Pi up properly. That is a bug that I will have to work on soon.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Fri Apr 03, 2015 3:55 pm

The updated HDMIPi backing plate (fits the RPi 2/B+) turned up recently, so I changed out the old RPi B and fitted the new RPi 2 Model B. What a difference in speed! It boots up faster, remote SSH connections logs in faster and it uses less power! Now, if only they would come out with a 1GB RPi 2 Model A...

It was about time I fitted the Adafruit INA219 (up to 26V @ 3.2A) monitoring board.

What a wonderful device, being i2c based, it's sort of easy to use with Python: I can now monitor the Li-ion battery stack voltage and the power being used. At the moment, my thinking is that I will start up a separate python script that will monitor the power consumption every 1/2 second and the voltage once every 60 seconds. I will roughly know what a fully charged battery stack can supply, ie: 2.2AHr. I hope to roughly be able to work out the consumption by the power being used and or the current battery voltage. I will see how further tests go with this.

The GIS-Pi with a RPi 2 Model B uses around 7.7W with the HDMIPi screen switched on and only 2.5W with the screen switched off.

I have ordered the Adafruit 5" 800x480 touchscreen to have a play with it: It should be here in 2-3 weeks time. It will use less power than the HDMIPi screen, but how well will it display in direct sunshine?

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sat Apr 04, 2015 1:26 pm

GIS-Pi now comes with a System STATUS screen, that hangs off the SETUP screen:
setup_status1.jpg (38.72 KiB) Viewed 8626 times
This is just a quick way of keeping tabs on various settings. It's interesting that so far everything runs in around 200MB of RAM.

I have set the MAP screen to display the battery voltage over in the LH side. The font turns red when the battery voltage falls below the set minimum. At the moment this is set as a system variable, but one day it will be able to be able to be adjusted via a SETUP screen. Here the minimum has been arbitrarily set to 12.3 volts so I could test out the red font:
gis-pi_screenshot_2015-04-04_2105.jpg (24.94 KiB) Viewed 8626 times

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Apr 05, 2015 7:49 am

To start GIS-Pi, I have to start xwindows: startx then double click on LXTerminal icon, change directory and type in: python There has to be a better way right?

Googling around I see that I can auto-run a command when the LXTerminal is opening. I can also create a new shortcut for to do this:
  1. create a new file called: /home/pi/Desktop/gis-pi.desktop
  2. and add in the following inside:

    Code: Select all

    [Desktop Entry]
    Comment=My comment
    Exec=lxterminal -t "GIS-Pi" -e /home/pi/gis-app/
  3. For a customised icon, I just shrunk a screenshot of GIS-Pi running down to 48 pixels x 48 pixels and lowered the color count down to 256 (all via the free Irfanview software)
  4. I saved the image as a png into this RPi icon folder: /usr/share/pixmaps/
  5. The shortcut can only run one command, so I created a simple shell script to start my GIS-Pi python script. Here is the contents of:

    Code: Select all

    # this is just a wrapper script to run the script
    #  Parkview  2015-04-05
    /usr/bin/python2.7 /home/pi/gis-app/
    echo Paused - Press ENTER to continue
    read INPUT
I now have a nice temporary GIS-Pi icon on my desktop shortcut. Having the terminal open first, allows me to see the debug print statements on the screen behind the GIS-Pi GUI.
desktop_icon.jpg (7.81 KiB) Viewed 8574 times

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Mon Apr 27, 2015 2:30 pm

After a bit of a hiatus, this weekend, I started working on the physical layout of the boards. I started with cardboard:
Cardboard_Layout1_sml.jpg (50.35 KiB) Viewed 8354 times
Ok, so I have a rough layout worked out, now the top:
Cardboard_Layout2_sml.jpg (45.93 KiB) Viewed 8354 times
I also started on the RPi board to hold all the components together:
RPi_Board_sml.jpg (61.2 KiB) Viewed 8354 times
For my first prototype, I settled on size of around 180mm wide, 260mm long and 38mm thick. The 10cm HDMI cable had to go as it was difficult to fold and instead I ordered one of these: ... den-202264 That helped make the unit thinner and shorter. Because of the size, the prototype will be made out of MDF wood, with a bit of 3D printed bling here and there

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun May 10, 2015 12:47 pm

Time for a bit of an update on the project. I have updated the code so that I am using three sets of python Classes. I like how neat they make the main body of code. Of course, if I ever wanted to rewrite it all, I would start with designing it all around Classes. Still lots to learn about using them first though.

On the hardware side, I have moved beyond cardboard and build a MDF wood based prototype housing:
prototype_base1.jpg (59.08 KiB) Viewed 8223 times
The housing turned out to be a bit thicker than I had hoped, but it's not too bad. It currently measures up as:

Length = 260mm
Width = 180mm
Height = 44mm

I ripped apart an old Canon ink jet printer and scored 2 x 5 core plugs that fitted into LCD controller board's button/LED socket. I added my own Adafruit LED/Button. This allows me to turn off the LCD screen when it's not in use. This halves the operating current, therefore doubling the battery run time.

Finally got around to creating moving the breadboard gear onto a vero board. It's bigger than the one I was testing out above, but it leaves me a bit of room to mount a small audio amplifier, so I can walk to a way point via audio guidance and the screen turned off. I designed the unit so I could run it on two sets of four 18650 battery packs. To save having to run them in parallel, I added in a 1N8522 schottky diodes in series with each battery pack. At full load, this adds a 0.33V voltage drop. Yes, I lose some available power, but I am kind of using it as a buffer, so that I don't discharge the batteries all the way down to zero. I have also ordered a set of three 32650 Li-ion batteries, so see how they test out as well.
electronics_board1.jpg (59.61 KiB) Viewed 8223 times
Talking about batteries and power usage, during last week I thought it would be interesting to track the battery usage via a graph. I created a separate python script that runs every five minutes via cron. When the script notices a large jump in voltage, it starts a new csv data file and graphs the battery run. Initially I was going to do it in trusty gnuplot, but I decided to learn how to create graphs via python and matplotlib. It's not as fast as gnuplot, but it does get the job done, and for this application, speed isn't an issue. I think it turned out rather well:
batterydata_2015-05-09_205324.jpg (33.79 KiB) Viewed 8223 times
Above you can clearly see the difference in turning on/off the LCD screen! Note: the battery voltage is measured after the diode, so the real battery voltage is 0.33V higher.
Last edited by Parkview on Sun May 24, 2015 12:33 pm, edited 1 time in total.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun May 10, 2015 1:57 pm

I forgot to mention that I have moved on from using the HDMPi screen. It drew too much power while the screen was on and it wasn't a touch screen. My current screen is this Adafruit 5" resistive touch screen: There has been a bit of an issue with the touch controller not working, but this is being sorted out.

It has a large input operating voltage range or 5V to 13V. While on my desk, I have been running it at 16.4V without any issues (so far). At 12.5V, the screen draws 194mA or 2.4W. This is around the same power usage as the RPi 2 (with a USB Bluetooth adaptor).

I just had to change a few variables to adapt the gis-pi program to the screens 800 x 480 resolution. Having started with an initial arbitrary 400 x 400 resolution, the new screen has given me some extra real-estate to play with down the road:
LCD Screen3.jpg
LCD Screen3.jpg (55.35 KiB) Viewed 8210 times
The LCD controller handily remembers the current settings, so I can set the screen rotation, brightness level, on/off etc and it then stores the settings in it's internal memory. This is handy, as I have removed the LCD menu button board.

As an extra bonus, I found that pygame now works natively and directly from the CLI. No more having to run it via x-windows!

Below is a basic block diagram of the GIS-Pi electronics:
GIS-Pi Block Diagram v3a.jpg
GIS-Pi Block Diagram v3a.jpg (25.92 KiB) Viewed 8072 times
Last edited by Parkview on Sun May 24, 2015 12:37 pm, edited 1 time in total.

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun May 24, 2015 12:28 pm

Time to put it all together.

Yes, it did all fit into the housing, but only just. I did have to move one of the central LCD supports so that a 'feature creep' 90 deg. 3.5mm audio output plug could be fitted:
Assembling the GIS-Pi_3a.jpg
Assembling the GIS-Pi_3a.jpg (47.72 KiB) Viewed 8079 times
It's a tight squeeze, but it all fits in. I still have to 3D print the RPi camera mount for it and fit a loud speaker for the audio output, but apart from that the electronics are pretty much completed. I will eventually give it a few coats of paint to add a bit of water proofing.

GIS-Pi went for a walk around the block and I recorded the Telstra comms pits (green dots) as I went. You can work out where I am standing from the Waypoint (WP) dials that are displaying how many metres to each coloured WP:
gis-pi_screenshot_2015-05-17_1712a.jpg (50.37 KiB) Viewed 8079 times
I managed a quick photo of the unit before the sun set. Yes, the screen still has the protective covering on it:
gis-pi out on a walk -1b.jpg
gis-pi out on a walk -1b.jpg (61.97 KiB) Viewed 8079 times
As I suspected, having the external GPS antenna so close to the unshielded LCD screen cable meant that the GPS error rate went for the normal 3.5m2 to 11m2! Hmm, that's no good. While I have some shielding tape coming in from China, I did pop into Bunnings for a quick look around, but apart from a 0.3mm thick x 150mm x 10m roll of Aluminium there wasn't much around.

The main issue was the weight of the unit. GIS-Pi with 2 x 4 18650 battery packs weighs in at 1.385Kg [~3lb]. It doesn't sound like much, but I wouldn't want to carry that around in my hands all day long. Maybe I could add a shoulder sling for when it's not in use. I am wondering whether GIS-Pi Mark II could be split into two sections, 1) RPi, battery pack and GPS antenna (on a pole) mounted in a back-pack and 2) a hand held LCD screen and a keyboard with a HDMI & power cable running between the two. If I go down that path, I will have to experiment with shielding and GPS antenna mounting distances. This is all part of prototyping right?

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Tue Jun 02, 2015 2:26 pm

There is nothing like really needing something to drive one to get around to fixing something. Last weekend it was time to dig down and get the Felix 3D printer working again, as I had a slew of things that I needed printed. Yes, GIS-Pi needed some good old plastic bling!

Here is a white LCD bezel, stylus tie down ring, a RPi Camera mount and an external camera sun shield:
3D bling.jpg
3D bling.jpg (25.78 KiB) Viewed 7986 times
In one of the photos above, you can see a 5m roll of spare GPS cable. I don't want to walk around in the bush having to carry it around and there is no room inside the case for it. I ended up (over) designing a simple cable tray that is bolted on underneath. It worked out quite well. I will be keeping an eye open for shorter active GPS antennas as well. One thing I like about 3D design/printing, is that a design can take into account the materials you have at hand, eg: I have some 15mm M3 bolts. I just designed the legs to cater for their length
GPS cable holder.jpg
GPS cable holder.jpg (28.22 KiB) Viewed 7986 times
Here is the unit all dressed up and ready to go:
GIS-Pi_bling.jpg (44.6 KiB) Viewed 7986 times
I still have to design up and print a mount for the active GPS antenna. I might be able to get to that later in the week, or the coming weekend.

I struggled to get a GPS sync from my window sill. I found a simple sheet of Alfoil (thin aluminium cooking sheet) on top of the case worked ok and the GPS quickly had an error rate of +-6m. I am still waiting on the other shielding tape to arrive. In the mean time, maybe I could just coat the inside top surface and sides with alfoil?

Posts: 62
Joined: Sun Feb 17, 2013 1:51 pm

Re: Building a RPi based GIS Tablet

Sun Jun 07, 2015 12:24 pm

Friday night I designed up and printed out the final version of the external GPS antenna:
GIS-Pi - GPS Antenna Mount.jpg
GIS-Pi - GPS Antenna Mount.jpg (26.05 KiB) Viewed 7910 times
MDF doesn't like being wet, so this weekend I have spent painting the outside of the housing. While down at Bunnings, I spied a spray can of zinc cold galvanisation. It's not cheap, but I wondered if it might be able to help act as a Faraday shield. As it takes 8 hours to dry before another coat can be applied, I only managed three coats on Sat. Early Sunday morning, I dug out the trusty multimeter to find... nope, nothing registers. My skin has a lower reading than the coating. It does look nice though, giving it a nice metallic look.

While waiting for paint to dry, I had a bit of a hunt around on Thingiverse for resistive styluses. I ended up designing my own based on someone else's Sony Stylus. It turned out really well:
LCD resistive stylus.jpg
LCD resistive stylus.jpg (7.83 KiB) Viewed 7910 times

Return to “Automation, sensing and robotics”