Raspberry Pi GIS Tablet: GIS-Pi
Raspberry Pi GIS Tablet: GIS-Pi
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.
Functions:
* be project based, so I can call up and add data to previous projects or areas of interest
* display and record where I have walked
* display and track up to 3 waypoints around me
* allow me to enter GIS metadata and notes about a waypoint (plant sighting)
* display GPS error, distance from last data entry
* possibly display a simple georeferenced map/aerial photo under the breadcrumb based tracked walk
* save all data directly into a Shapefile format to allow for easy uploading into http://qgis.org/en/site/
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 Spring season, Sept/Oct 2015
Another interesting GIS Tablet project is the QGIS Roam projecti: https://github.com/DMS-Aus/Roam Maybe one day it might run on a RPi?
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.
Functions:
* be project based, so I can call up and add data to previous projects or areas of interest
* display and record where I have walked
* display and track up to 3 waypoints around me
* allow me to enter GIS metadata and notes about a waypoint (plant sighting)
* display GPS error, distance from last data entry
* possibly display a simple georeferenced map/aerial photo under the breadcrumb based tracked walk
* save all data directly into a Shapefile format to allow for easy uploading into http://qgis.org/en/site/
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 Spring season, Sept/Oct 2015
Another interesting GIS Tablet project is the QGIS Roam projecti: https://github.com/DMS-Aus/Roam Maybe one day it might run on a RPi?
Re: Raspberry Pi GIS Tablet: GIS-Pi
So where am I up to so far?
yesterday I could:
* 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.
yesterday I could:
* 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.
Re: Raspberry Pi GIS Tablet: GIS-Pi
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:
The 1st WP is the red dot, in the LH top quadrant, the 2nd WP is off the screen (top RH corner), so it's white and located on the border, same with the 3rd WP: bottom LH corner. The last track fix is at the bcenter bottom, unfortunately over a dark area, so it's hard to see. I might look at being able to fade out the background image via the images alpha channel.
Here is an overall look from a QGIS screenshot. The arbitrary waypoints are in green and GPS window data is in purple and the last 61st fix is in yellow. The top LH green waypoint is the location of the GPS receiver placed on the window sill:
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:
The 1st WP is the red dot, in the LH top quadrant, the 2nd WP is off the screen (top RH corner), so it's white and located on the border, same with the 3rd WP: bottom LH corner. The last track fix is at the bcenter bottom, unfortunately over a dark area, so it's hard to see. I might look at being able to fade out the background image via the images alpha channel.
Here is an overall look from a QGIS screenshot. The arbitrary waypoints are in green and GPS window data is in purple and the last 61st fix is in yellow. The top LH green waypoint is the location of the GPS receiver placed on the window sill:
Re: Raspberry Pi GIS Tablet: GIS-Pi
Great work there Paul! I have been dabbling in Pygame for my latest project. It has a great feature set for anything graphical... More on that soon!
Re: Raspberry Pi GIS Tablet: GIS-Pi
Yes, pygame is awesome. Well Python is so powerful and elegant at the same time. The other day I wrote some crappy code calling a shell program to do read/write to a Shapefile. Later I went out side to do something I realised I had never tried searching for a suitable Python module, and sure enough someone has written the 'pyshp' module. There is also the Shapely and Fiona modules as well. I love it!
Looking fwd to the forum post about your new project! Obviously it's going to involve a display
Looking fwd to the forum post about your new project! Obviously it's going to involve a display
Re: Raspberry Pi GIS Tablet: GIS-Pi
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
I still have to provide a geo-referenced background image, but then I can (still via code), till 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.
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.
I still have to provide a geo-referenced background image, but then I can (still via code), till 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.
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.
Re: Raspberry Pi GIS Tablet: GIS-Pi
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!
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 upright at 0 deg, I then use the '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.
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!
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 upright at 0 deg, I then use the '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.
Re: Raspberry Pi GIS Tablet: GIS-Pi
Looks like it's coming along nicely Paul
I missed your post about what I was doing with PyGame....
Well It's a 40" LCD as a "splashback" behind 8mm glass. I'm going to use in our kitchen renos to replace all of the other things I've bolted to the walls in the past.
I'm using Pygame natively without Xwindows.. and it so far has:
* weather stats
* power stats
* incoming call notification (from asterisk)
* CCTV camera overlay on doorbell press
* Radio song info for current channel
* Random changing HD Backgrounds from a URL folder
I'm still tinkering with it, but need to finalise the new weather station / logger first
I missed your post about what I was doing with PyGame....
Well It's a 40" LCD as a "splashback" behind 8mm glass. I'm going to use in our kitchen renos to replace all of the other things I've bolted to the walls in the past.
I'm using Pygame natively without Xwindows.. and it so far has:
* weather stats
* power stats
* incoming call notification (from asterisk)
* CCTV camera overlay on doorbell press
* Radio song info for current channel
* Random changing HD Backgrounds from a URL folder
I'm still tinkering with it, but need to finalise the new weather station / logger first
Re: Raspberry Pi GIS Tablet: GIS-Pi
Nice one there BeJay. I like the way your displaying the info along the top. Yes, mine too will run natively, but at the moment, I do Dev. work remotely via VNC, hence xwindows. Are you drawing the graph in pygame, or via something else?
Re: Raspberry Pi GIS Tablet: GIS-Pi
The graph is already made using gnuplot on my logger machine (soon to be a pi), so all this needs to do is load into pygame as a png on the splashback.
I like how easy it is no make transparent backgrounds just by using a 70% png and layering the other stuff on top. Here is a snip using urllib to load the pic from the logger web server, and display it, not that much to it really:
Something you might find useful is I found how to prevent screen blanking (screen saver) on the pi, by calling this as least every 5 minutes or so:
The cool parts of the splashback so far are the AMI asterisk console python interface, and the iceast stream puller using "Beautiful Soap" bs4 that really makes python so nice to work with!
I like how easy it is no make transparent backgrounds just by using a 70% png and layering the other stuff on top. Here is a snip using urllib to load the pic from the logger web server, and display it, not that much to it really:
Code: Select all
urllib.urlretrieve(http_path+"acpower24hr-splash.png", "acpower24hr-splash.png")
banner16 = pygame.image.load("acpower24hr-splash.png")
#Transperent Bar
tbar = pygame.image.load("tbar.png")
screen.fill(black)
#Background
screen.blit(background, [0, 0])
#Unlay Transparent Bar
screen.blit(tbar, [0, 0])
screen.blit(banner16, [1200 + overscan_offset_left, -15 + overscan_offset_top])
# refresh display
pygame.display.flip()
# Increment Background Change Counter
background_change = background_change + 1
# Prevent Screen Blanking
pygame.event.get()
Something you might find useful is I found how to prevent screen blanking (screen saver) on the pi, by calling this as least every 5 minutes or so:
Code: Select all
# Prevent Screen Blanking
pygame.event.get()
The cool parts of the splashback so far are the AMI asterisk console python interface, and the iceast stream puller using "Beautiful Soap" bs4 that really makes python so nice to work with!
Re: Raspberry Pi GIS Tablet: GIS-Pi
Hi BeJay,
thanks for the tips. I can see that coming in handy, as I haven't really used the 7" screen yet. I am doing my Dev. work via VNC
I was pondering screens on my way to work this morning. The 7" screen is a 1280x 768, but really I only need a 640x480 scree. At the moment, all my Dev work is on a 400x400 screen, but I am trying to write it so that it can (sort of), be easily adapted to any sized screen, well, within reason anyway.
I spent an hour last night playing around with the eSpeak and pyttsx software. Very nice. Hopefully, I will be able to walk along with the screen off, just listening and navigating by voice commands: 'one hundred and fifty metres, thirty five degrees'
thanks for the tips. I can see that coming in handy, as I haven't really used the 7" screen yet. I am doing my Dev. work via VNC
I was pondering screens on my way to work this morning. The 7" screen is a 1280x 768, but really I only need a 640x480 scree. At the moment, all my Dev work is on a 400x400 screen, but I am trying to write it so that it can (sort of), be easily adapted to any sized screen, well, within reason anyway.
I spent an hour last night playing around with the eSpeak and pyttsx software. Very nice. Hopefully, I will be able to walk along with the screen off, just listening and navigating by voice commands: 'one hundred and fifty metres, thirty five degrees'
Re: Raspberry Pi GIS Tablet: GIS-Pi
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:
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 inputbox.py 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
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 inputbox.py 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
Re: Raspberry Pi GIS Tablet: GIS-Pi
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.
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. Yes, the colors suck at the moment. It's not one of my strong points
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. Yes, the colors suck at the moment. It's not one of my strong points
Re: Raspberry Pi GIS Tablet: GIS-Pi
Not much work over the last weekend, but I did get a few specky things done.
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:
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?
- 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)
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:
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?
Re: Raspberry Pi GIS Tablet: GIS-Pi
I'm surrounded by sooo many inspiring people. where can I get some of this time thing.
Re: Raspberry Pi GIS Tablet: GIS-Pi
I picked it up via a special order from dx.com!
Re: Raspberry Pi GIS Tablet: GIS-Pi
Other projects are starting to call out to me for attention, but I must remain focused. Well, that's what I tried saying over and over to my self last 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:
As I 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. Apparently this cable acting as antenna has held up the world wide certification process. 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!
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:
As I 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. Apparently this cable acting as antenna has held up the world wide certification process. 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!
Re: Raspberry Pi GIS Tablet: GIS-Pi
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 inputbox.py 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:
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.
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 inputbox.py 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:
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.
Re: Raspberry Pi GIS Tablet: GIS-Pi
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.
in a shade. It's hard to photograph the screen in full sunlight, but it is viewable. A redacted debug window running behind GIS-Pi window.
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.
in a shade. It's hard to photograph the screen in full sunlight, but it is viewable. A redacted debug window running behind GIS-Pi window.
Re: Raspberry Pi GIS Tablet: GIS-Pi
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 problem. Thanks to BJ, for helping out with some of the troubleshootiong for me.
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:
NOTE: 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.
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 https://github.com/GeospatialPython/pyshp
configure: samba, gspd, NTP for gpsd, screen font size, copy over GIS-Pi files and directory structure
reboot
NOTE: 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.