Raspberry Pi GIS Tablet: GIS-Pi

Tell us about your projects. Update us regularly.
User avatar
Jubbp
Master Maker
Posts: 209
Joined: Sun Jun 22, 2014 8:15 pm
Location: Bunbury WA
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by Jubbp » Thu Mar 19, 2015 9:31 pm

Good to see this project moving along. It looked almost professional on Saturday.

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Thu Mar 19, 2015 9:58 pm

apart from lugging a 2.6Kg Lead Acid battery around ;)

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sun Mar 22, 2015 9:46 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.

gis-pi_screenshot_2015-03-21_1654.jpg
A wondering GPS signal
gis-pi_screenshot_2015-03-21_1654.jpg (24.09 KiB) Viewed 25621 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.

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Fri Apr 03, 2015 11:54 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 https://www.adafruit.com/products/904current/voltage (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: https://www.adafruit.com/products/2109 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?

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sat Apr 04, 2015 9:22 pm

GIS-Pi now comes with a System STATUS screen, that hangs off the SETUP screen:

setup_status1.jpg
setup_status1.jpg (38.72 KiB) Viewed 25616 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
gis-pi_screenshot_2015-04-04_2105.jpg (24.94 KiB) Viewed 25616 times

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sun Apr 05, 2015 3:46 pm

To start GIS-Pi, I have to start xwindows: startx then double click on LXTerminal icon, change directory and type in: python gis-pi.py 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]
    Name=GIS-Pi
    Comment=My comment
    Icon=gispi.png
    Exec=lxterminal -t "GIS-Pi" -e /home/pi/gis-app/run_gis-pi.sh
    Type=Application
    Encoding=UTF-8
    Terminal=false
    Categories=None;
  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: run_gis-pi.sh:

    Code: Select all

    #!/bin/bash
    #
    # this is just a wrapper script to run the GIS-Pi.py script
    #
    #  Parkview  2015-04-05

    /usr/bin/python2.7 /home/pi/gis-app/gis-pi.py

    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
desktop_icon.jpg (7.81 KiB) Viewed 25615 times

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by BeJay » Sun Apr 12, 2015 9:54 pm

Nice work Paul! I like the Wh intergration ;)

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Mon Apr 27, 2015 10:21 pm

After a bit of a hiatus, this weekend, I started working on the physical layout of the boards. I started with cardboard:
Cardboard_Layout2.jpg
Cardboard_Layout2.jpg (199.13 KiB) Viewed 25603 times


Ok, so I have a rough layout worked out, now the top:
Cardboard_Layout2.jpg
Cardboard_Layout2.jpg (199.13 KiB) Viewed 25603 times


I also started on the RPi board to hold all the components together:
RPi_Board.jpg
RPi_Board.jpg (160.03 KiB) Viewed 25603 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 and instead I ordered one of these: http://www.dx.com/p/greenconnection-20102-hdmi-male-to-male-adapter-black-golden-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.
Attachments
Cardboard_Layout1.jpg
Cardboard_Layout1.jpg (221.75 KiB) Viewed 25603 times

User avatar
seaton
Master Maker
Posts: 222
Joined: Tue Jun 24, 2014 11:41 am
Location: Bunbury, WA
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by seaton » Tue Apr 28, 2015 12:40 pm

The Pi Phablet is coming along nicely :)

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Tue Apr 28, 2015 6:43 pm

Looking at the last photo, do you mean the cardboard box with a few holes in it? What has it all been for :lol:

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sun May 10, 2015 7:32 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 want to rewrite it all, I would start with designing it all around Classes. Still lots to learn about using them though.

On the hardware side, I have moved beyond cardboard and build a MDF wood based prototype housing:

prototype_base.jpg
prototype_base.jpg (99.78 KiB) Viewed 25624 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 batter 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 run.

electronics_board.jpg
electronics_board.jpg (90.96 KiB) Viewed 25624 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
batterydata_2015-05-09_205324.jpg (33.79 KiB) Viewed 25624 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.

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sun May 10, 2015 9:55 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: https://www.adafruit.com/products/2110. 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 Screen2.jpg
LCD Screen2.jpg (111.78 KiB) Viewed 25624 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 25611 times
Last edited by parkview on Sun May 24, 2015 8:37 pm, edited 1 time in total.

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by BeJay » Wed May 13, 2015 9:17 pm

Progressing well I see :)

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Wed May 13, 2015 10:01 pm

Yes, having fun! Just been out in the shed fitting power switch, LCD on/off button and LED etc to the top cover.

This week, it has occurred to me that having a unshielded ribbon cables for the camera and LCD display board might over power the GPS antenna. Having a wooden housing doesn't help.

Did you say you tracked down some shielded cables, or did you just make your own via grounded al-foil cover etc?

I don't really want to go down the route of fitting the GPS on top of my hat and trailing the cable down my arm :lol:

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by BeJay » Thu May 14, 2015 5:41 pm

Yep, I used ali tape from ebay. Works a treat. GPSs are so touchy to EMI Stray RF.

Image

Sorry it's slow to load, kids have shaped my internet!

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Thu May 14, 2015 10:14 pm

nice find. I see Dx.com has some winging it's way to me now :)
Thanks.
Last edited by parkview on Fri May 15, 2015 11:12 am, edited 1 time in total.

User avatar
seaton
Master Maker
Posts: 222
Joined: Tue Jun 24, 2014 11:41 am
Location: Bunbury, WA
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by seaton » Fri May 15, 2015 9:40 am

I'd been looking from some locally for a while, didn't even think of DX, now have some headed my way as well :)

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sun May 24, 2015 8:23 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 25611 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
gis-pi_screenshot_2015-05-17_1712a.jpg (50.37 KiB) Viewed 25611 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 25611 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. 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?

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Tue Jun 02, 2015 10:22 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 25606 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 25606 times


Here is the unit all dressed up and ready to go:
GIS-Pi_bling.jpg
GIS-Pi_bling.jpg (44.6 KiB) Viewed 25606 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?

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Raspberry Pi GIS Tablet: GIS-Pi

Post by parkview » Sun Jun 07, 2015 8:22 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 25603 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 25603 times

Post Reply