Mobile Urban Pollution: Prototype Two
Summary |
Modifications |
Software |
Critique
This is a 2nd prototype With a form factor and software that is
suitable for trials.
The following key modifications have been made:
- Replacement of consumer GPS device with a custom-boxed OEM part,
the Garmin GPS15-LW. This removes several issues to do with
interfacing, and powering up the device. The GPS15 has a very fast
power-on of around a second.
- External GPS aerial. We are using a Linksys component.
- The GPS unit now has an internal rechargeable battery. This means
that a device needs recharging at three points, but this removes needs
for external battery.
- The software has been enhanced to be much more robust on device
reseting, delayed power-up etc...
- A tray has been fabricated to securely carry the devices
- All cabling issues have been dealt with as best able. A wireless
solution would be very useful.
Downloads
The software and source code can be downloaded (project members only):
- PollutionReader_v1.zip (12/2003 - requires jeeps)
- PollutionReader_v1.1.zip (5/3/2003 - includes jeeps) Better diagnostics for invalid readings
- PollutionReader_v1.2.zip (11/3/2003 - includes jeeps) Minor fix to stop logging GPS sentences
- PollutionReader_v1.3.zip (12/3/2003 - includes jeeps) Minor fix to graph actual CO (reading - base) not the reading itself
- (8/4/2003) Parsable log file names. Audio feedback.
- (11/9/2007) Log GPS coords in main log file
If you don't have it, then you can also download a customised version
of Jeeps, that supports WinCE (PocketPC2002) jeeps-0.1.3.zip.
Pollution Reader PocketPC 2002 Manual
Installing WinCE Version on a New Device
- The device needs the correct date and a roughly correct time set.
- Connect the device to your Windows desktop. There is no need to
make a partneship. Browse the device (e.g. from "My Computer/Mobile
Device". Create a directory under the top directory on the device
called "pollutionreader" (at the same level as "My Documents").
- Copy the following files to "pollutionreader":
config.txt
config_com.txt
config_file.txt
pollution.txt
pre_iraq_short.txt
sounds/*.wav
- Copy pollutionreader.exe (it may be under wince/armbg) to
"pollutionreader". You can if you wish just put the executable on the
start menu or make a shortcut to it from the start menu.
Installing WinCE Version on Emulator
If you have the PocketPC 2002 emulator installed, you can build
PollutionReader to the "Win32 (WCE x86) Debug" or "Win32 (WCE x86)
Release" target. If you the platform to "Pocket PC 2002 Emulation",
then the default target for debugging will start the emulator and
download pollutionreader.exe to the start menu.
You need to run the emulator version in test mode. Getting the log
files onto the device is more complicated.
- On the Pocket PC 2002 Emulator, go to "Start" Menu, then
settings. Select the "System" tab and the "About" button. Select the
"Device ID" tab, and set the text box "Device name" to something
random. Click OK to set the new name. Click X to dismiss settings panel.
- On the desktop, share a directory. E.G. share the directory
"C:/tmp/share" as "share".
- On the Pocket PC 2002 Emulator, pop up the file browser under
"Start" menu, then "Programs" menu item, then "File Explorer" icon. Go
to "My Device" menu and create "pollutionreader" (it should be at the
same level as "My Documents".
- Still in the file browser, browse to
"\\\", e.g. for my machine
"\\shawn\share". You may have to type in a Windows network username,
password and domain name. Note the "\" key doesn't seem to work on
some keyboards - you may have to enter it from the tap-in keyboard on
the emulator. Copy the the files config.txt, config_com.txt,
config_file.txt, pollution.txt, pre_iraq_short.txt and sounds\* (pen down and hold
after selecting the files names), and paste them under the new
pollutionreader directory.
Config
pollutionreader.exe reads the file \\pollutionreader\config.txt to get
options for whether or not to read test files, and which COM ports to
use. You can mix test files and devices if you only have one COM
port. You might have to switch the COM ports if you install a serial
card into a pocket pc, or want to change the cabling and switch the
devices over. The config.txt is, by default a copy of
config_com.txt. If config.txt does not exist, then pollutionreader.exe
defaults to reading test files. You should copy config_com.txt or
config_file.txt to config.txt as required. NOTE that you can't
edit the config.txt file in PocketPC Word - it doesn't parse properly
afterwards.
Here is the contents of config.txt which explains the actual options.
-f \pollutionreader\pre_iraq_short.txt -g
\pollutionreader\pollution.txt
# Note only the first line of the config file is read, this simulates
# command line arguments.
#
# Some sample settings
#
# Default configuration of UCL prototype1&2 on a PDA reading com
ports:
-c COM2: -d COM1:
# -c specifies the COM port for the GPS device (NOTE the :)
# -d specifies the COM port for the pollution device
# Test version
-f \\pollutionreader\pre_iraq_short.txt -g
\\pollutionreader\pollution.txt
# -f specifies the sample GPS NMEA log
# -g specifies the sample pollution log
# You can not specify both -c and -f
# You can not specify both -d and -g
# The defaults (no arguments, no config.txt are equivalent to the test
# version above. If the program can't read your file or device, it
# defaults to trying to read the values as if set by test version. If
# that fails it disables reading. It will warn you through pop-ups
# that this is happening.
Main Screens
IMPORTANT NOTE as of 8/11/2003, do not click the (X) in the
top-right corner to exit the program. This buttons hibernates the
process and does not kill it. This is a problem because the log file
may not be terminated. Use the Main/Exit command on the menu.
The following figure shows the default screen which used for
diagnostics. All the user needs to do is power everything on, and
check that it read "Reading GPS OK" and "Reading pollution OK", both
of these text sections turn yellow if the reading is being received
but isn't valid, and turn red if nothing is being read from the
device. The software attemps to reset the devices if they are
unresponsive. The software also provides audio feedback for five
conditions: GPS sentence received and GPS fixed (high clap), GPS
sentence received and no GPS fix (low clap), CO high (high bell), CO
medium (medium bell), CO low (low bell). These sounds alternate once a
second.
The main menu allows you to switch to other visualisations and
importantly, turn off the screen to save power. The four visualisation
modes are Verbose (current screen), Pollution, Satellites and Map.
The pollution screen shows recent pollution levels. You can change the
time period using the Time menu (not shown expanded). NOTE that the
graphs may appear to jump around since the software does not calculate
averages, but just samples points from earlier time periods. The
maximum pollution value is 20ppm, you should expect the reading to
peak and drop rapidly after turning the ICOM on. It should settle
after 20 seconds.
The map screens shows recent OSGB coordinates. You can change the time
scale as with the pollution screen. You can also move the map using
View menu (E,S,W,N, zoom in, zoom out, re-center). Again the graphs
will appear to jump because they only sample a few representative
points from the log history.
The satellite screen shows the current positions of satellites. Green
are strong enough to use.
Log File Format
Log files now have the PDA start time. An additional column has been
dded, which is the PDA's time as well as the GPS time.
Pollution Reader Win32 Manual
The Win32 version is very simple. It supports command line argument as
are simulated in the PocketPC version. The only visuals in the program
are satellite positions, and it also reports the raw values of the GPS
and pollution device.
Source
In released versions (currently v1, 8/11/2003), the projects have been
rearranged. PocketGL has been dropped on WinCE. The WinCE project is
now much more advanced in its device handling and rendering, though
the Win32/OpenGL version is still useful for testing devices.
There are two main workspaces
- Win32/PollutionReader.sln for Visual Studio.Net
- WinCE/PollutionReader. for Embedded Visual Studio
In PollutionReader.sln there are two projects:
- PollutionReader.vcproj - demonstration of GPS reading using pre-recorded or direct serial access
- jeeps.vcproj - library to read NMEA strings from GPS and convert between coordinate systems
In PollutionReader.vcw there are a similar two projects:
- PollutionReader.vcp - Pocket PC executable (ARMDbg and X86Dbg
platforms are supported)
- jeeps.vcp - library to read NMEA strings from GPS and convert between coordinate systems
Notes
Compared to prototype one, all timing issues have been resolved. The
log file now contains both GPS time and PDA time for further analysis.
Uploading
Currently log files are uploaded by hand.
This device is robust enough for trials. We are finishing the
fabrication of five devices.
- Cabling 1. Has mostly been solved, though the remaining short
cables do need to be treated with care and need taping down.
- Cabling 2. The cable to the ICOM is probably the weakest
point. This will not be solved until Learian change to using a more
robust plug/socket connector.
- Power. Device needs charging at three points. These are all
cable connections though, so this is not such an issue.
- Size. The tray with three devices is not suitable for carrying by
hand, it needs mounting on a bike-rack or similar surface. It could be
placed in a back pack, if the ICOM could be fixed outside.