• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Sensorpedia iPhone Application
 

Sensorpedia iPhone Application

on

  • 3,598 views

The goal of the Sensorpedia Mobile Platform was to develop a software application which can be run on a mobile computing device and used to transmit distributed data readings from citizens in ...

The goal of the Sensorpedia Mobile Platform was to develop a software application which can be run on a mobile computing device and used to transmit distributed data readings from citizens in near-real time. This application permits citizens to rapidly report event information, such as disaster occurrences, security anomalies, and accounts of emergencies.

Statistics

Views

Total Views
3,598
Views on SlideShare
2,638
Embed Views
960

Actions

Likes
3
Downloads
0
Comments
0

7 Embeds 960

http://www.christomkinstinch.com 498
http://www.sensorpedia.com 349
http://christomkinstinch.com 64
http://www.sensorpedia.org 34
http://www.slideshare.net 12
http://webcache.googleusercontent.com 2
http://youtia.selfip.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Sensorpedia iPhone Application Sensorpedia iPhone Application Presentation Transcript

    • The Mobile Platform: Enabling citizen sensors Christopher H.Tomkins-Tinch RIT BS, Imaging Science (2011) tomkinstinch at ornl dot gov cht(nine-three-three-nine) at rit dot edu Hi, Iʼm Chris Tomkins-Tinch from the Rochester Institute of Technology. This summer, I worked on creating an iPhone application interface to Sensorpedia and an associated backend web service.
    • What are sensors? We encounter sensors every day, but what are sensors.
    • http://weblogs.newsday.com/news/local/longisland/politics/blog/anemometer.jpg http://biosingularity.files.wordpress.com/2006/03/cantilever.jpg http://www.kenrockwell.com/nikon/d40/images/d40-sensor.jpg We might think of an a weather station--an anemometer, or maybe a camera sensor. These are largely stationary sensors designed for specific tasks.
    • What about us?
    • We too are sensors. We too then, are sensors. We can respond in ways static sensors cannot. We can notice things that autonomous systems may miss. We can frame readings with relevant context, and quickly capture what matters.
    • http://www.flickr.com/photos/jasonwhite/890732541/sizes/o/ Here are a few photos selected from Flickr. Each shows the various items the photographer carries around with them every day. I think you will notice something common to each of them. Itʼs really quite striking.
    • http://www.flickr.com/photos/andreanna/2750799391/sizes/l/
    • http://www.flickr.com/photos/lenny_montana/842733/sizes/o/
    • http://www.flickr.com/photos/clanlife/2968645593/sizes/l/
    • http://www.flickr.com/photos/cr03/280133157/sizes/o/
    • Mobile phones are ubiquitous. Almost everyone in this country has a cell phone. In the decade following 1996, cell phone adoption jumped from thirty-four to two-hundred three million. Thatʼs a significant increase. http://www.post-gazette.com/pg/06075/671034-294.stm
    • http://www.flickr.com/photos/howieluvzus/389163804/ This photo of tornado damage was taken in 2007 outside New Orleans. It was taken not by a news crew or a photographer, but by an ordinary citizen with a pocket camera and a data connection.
    • http://www.flickr.com/photos/davidwatts1978/3199405401/ This photo of US Flight 1549 was taken by Janis Krums on January 15, 2009 while standing on the bank of the Hudson River. It was captured with an iPhone, and distributed by Twitter before any news agency of record had reached the scene.
    • http://www.fulana.org/images/if-you-see-something.JPG http://www.flickr.com/photos/usgeologicalsurvey/2593475733/ http://www.narragansett.k12.ri.us/nes/images/citizen.gif Whether acting in response to natural disasters, in the service of national security, or for curiosity, citizens are are a powerful source of data. The question then is, “How do we leverage this power in an organized way?”
    • I wonʼt go into detail on what Sensorpedia is; that is outside the scope of this presentation. In short, it is a way to aggregate and index sensor data.
    • Here we have a screenshot of the BETA Sensorpedia interface. The popup window in the middle shows a stationary traffic camera in South Carolina.
    • Sensorpedia is currently indexing many different types of in-situ sensors. Here we can see numerous weather and buoy sensors.
    • Imagine if Sensorpedia included near-real-time human Sensor readings. Here is a screenshot of Flickrvision. As photographs are uploaded to Flickr, this service shows a thumbnail on Google Maps. What if we could leverage the same functionality with Sensorpedia?
    • How do we get human readings into ? The question then, is “How do we get readings from distributed users into Sensorpedia?”
    • Create a mobile application. We can do it with a mobile phone application--something to interface with the native device hardware and serve data to Sensorpedia in an intuitive way. This summer I targeted the iPhone for this task.
    • Initially, I began with a sketch-based interface design. This is something Iʼve learned to embrace from working with David Resseguie. Itʼs a low-risk and quick way to think about how prototypes should work. Sketching on a tablet pc is especially helpful because it makes the iterative design process simple.
    • The main idea is to give each iPhone owner a feed on Sensorpedia. They can then capture the deviceʼs senses--accelerometer, camera, and position. They can also provide an optional comment. A more generic data field is also included, anticipating sensors that interface through the iPhoneʼs dock connector.
    • Users experience native iPhone user interface controls, and will be able to review post-capture entries.
    • The app provides a historical backlog. From the Sensorpedia web interface, the API, or the Sensorpedia mobile app itself, users will be able to review past entries.
    • Rather than talk directly to Sensorpedia, the mobile application will send data to an associated web service which will then in turn generate feeds to be later consumed by Sensorpedia.
    • Left as an exercise for the reader. http://www.flickr.com/photos/austinevan/1225274637/ This was an educational program after all, and I needed to learn. Dave Markʼs iPhone book, and Stephan Kockanʼs Objective-C books were invaluable for gaining knowledge of how to develop for Appleʼs mobile platform.
    • After getting comfortable with Objective-C and Appleʼs way of doing mobile development, I had an early Sensorpedia application running on the iPhone simulator.
    • It presents an interface that makes capturing the iPhoneʼs senses simple and quick.
    • This historical backlog is a work in progress.
    • In addition to being able to capture using the large button on the first tab, users can opt to have the app capture immediately upon load. This makes it easy to catch time-sensitive events.
    • Each user of the application will need a username and password. Having this credential obviates the need to tie the app to specific devices, and permits fleet deployment. Data from any device will make it to the same feed, as long as it comes from the same user.
    • The app handles errors gracefully, using windows according to Appleʼs user interface guidelines.
    • In accordance with Appleʼs user interface guidelines, the app also ties in to the iPhoneʼs global settings pane.
    • The Sensorpedia iPhone app settings are available from a global location familiar to the user.
    • All of the options are included here.
    • The transition from sketch to implementation.
    • Making the mobile application does not complete the system. Creating the mobile application does not get information from field users into Sensorpedia, however. A web service is needed to complete the system.
    • You may remember this diagram from earlier in the presentation. Weʼve covered the iPhone side of things, and the Sensorpedia side remains largely complete. The “Third party web service” in the middle of this diagram is needed collect data from iPhones and provide it to Sensorpedia as a compatible ATOM feed.
    • To the web service...
    • (it’s all code) Thereʼs not much to see for the web interface. Itʼs about a thousand lines of Python code, executing through Apache with mod_wsgi. It makes use of existing libraries for JSON, database interaction, and wsgi. It uses webpy.
    • It has a RESTful interface. 'http://baseurl/auth' 'http://baseurl/submit' 'http://baseurl/query/(userId)/[returnCount]/[offset]' 'http://baseurl/delete' 'http://baseurl/image/(imageId)' 'http://baseurl/imagethumb/(imageId)/[maxSize]' Link Sensorpedia itself, the web service has a RESTful interface, and responds to normal HTTP operations like GET and POST. It collects data in JSON format, stores it locally in a SQLite database, and serves it in varying ways, depending on content type.
    • Readings Users id id user_id api_key image password_hash image_thumb username accel_x date_registered accel_y date_last_seen accel_z sp_uuid magnetometer altitude comment lon lat altitude generic_content timestamp The data model is quite simple, and provides tables for users and readings. Each of the iPhoneʼs sensors is given a column, along with a generic_content column for extensibility.
    • One of the resources I used in creating the web backend for the Sensorpedia iPhone app is the Sensorpedia Python Library, or spylib as weʼve been calling it. Tim Garvin created it during his time here at ORNL. Spylib takes the raw data and transforms them into a Sensorpedia-compatible ATOM feed.
    • What’s next? So whatʼs next?
    • http://www.flickr.com/photos/howieluvzus/389163804/ The next thing to do is to test get the app fully working actual hardware. Eighty percent of the application was developed using the iPhone simulator. This works well. The simulator provides constant canned values for the GPS and magnetometer. A photo album can be used to simulate taking a picture, and a hack allows one to simulate the accelerometer on a MacBook Pro. Simulating the phone accelerometer with the MacBook Pro's Sudden Motion Sensors can be accomplished using http://bit.ly/18uGq8 to send data via UDP to a waiting accelerometer override http://bit.ly/m6E7E . It is especially neat because it's transparent to the developer. Deploying to ARM swaps in the native accelerometer thanks to #if !TARGET_CPU_ARM ; no changes to the interface. Once the application is complete and running on the device, it can be submitted to Apple for entry to the App Store.
    • The mobile platform Enabling citizen sensors Christopher H. Tomkins-Tinch David R. Resseguie Rochester Institute of Technology Oak Ridge National Laboratory Imaging Science (BS 2011) Computational Sciences and Engineering tomkinsc@gmail.com resseguiedr@ornl.gov We too are sensors. The Application Prior work - Interface design Sharing information from sensors and other real-time data systems The Sensorpedia mobile application was designed to capture data is critical for situational awareness, knowledge discovery, and from the iPhone's sensors and relevant context as quickly as possible. simulation. Current proprietary systems and ad-hoc interoperability This timely situational awareness is critical. User interaction for the solutions increase sensing system integration time and delay Sensorpedia mobile application was prototyped with sketch-based decision-making and data analysis. interfaces. This technique allowed for rapid iterative design, and greatly accelerated the development process. Sensorpedia is a program initiated by Oak Ridge National Laboratory (ORNL) to utilize "Web 2.0" social networking principles and lightweight data portability standards to organize and provide rapid access to online sensor network data and related data sets. Sensorpedia has leveraged established industry best practices for information dissemination, and provides an accessible application programming interface (API) for retrieving data in standardized forms such as JavaScript Object Notation (JSON), and the Atom Syndication Format. Data feeds can be tagged with keywords and indexed in the spatial and temporal domains. Sensorpedia enables decision makers to pull in many different types of information sources and view them on a common operating picture. Intention - citizen sensors The goal of the Sensorpedia Mobile Platform was to develop a software application which can be run on a mobile computing device and used to transmit distributed data readings from citizens in near-real time. This application permits citizens to rapidly report event information, such as disaster occurrences, security anomalies, and accounts of emergencies. This photo of US Flight 1549 was taken by Janis Krums on January 15, 2009 while standing on a ferry crossing the Hudson River. It was captured with an iPhone, and distributed by Twitter before any news agency of record had reached the scene. http://www.flickr.com/photos/davidwatts1978/3199405401/ Implementation The Sensorpedia mobile application is implemented in Objective-C, and utilizes native Apple Foundation and Cocoa classes. It adheres to Architecture the model-view-controller paradigm for software development. The associated web service is implemented in Python and utilizes existing libraries for its web server gateway interface (WSGI), image Web Service processing, JavaScript Object Notation (JSON), and database interaction. Data are stored in a relational SQLite database and can be The creation of the mobile application necessitated an associated retreived through a Representational State Transfer (REST) interface. web service, which collects and registers data with Sensorpedia. Data flow ATOM JSON Data model Users maintain accounts to allow Users Readings web each user to be associated with magnetometer service multiple devices. Data are id id altitude api_key user_id associated with users through an password_hash image comment API key. Each of the sensors lon username image_thumb lat The web service communicates with devices using JavaScript present in the device and a date_registered accel_x altitude generic content block are date_last_seen accel_y Object Notation (JSON) and publishes data using the Atom sp_uuid accel_z generic_content Syndication Format (ATOM). represented in the data model. timestamp Sensorpedia is funded by the Department of Homeland Security’s Southeast Region Research Initiative (SERRI) and is supported in part by the U.S. Department of Energy under DOE Project No. 2367-T103-06. For more information about Sensorpedia and related efforts at ORNL, please contact Bryan Gorman at gormanbl@ornl.gov or visit Sensorpedia online at http://www.sensorpedia.com This is the poster presented on the application at the 2009 ORNL Summer Student Poster Session. on August 5, 2009.
    • The Mobile Platform: Enabling citizen sensors Christopher H.Tomkins-Tinch RIT BS, Imaging Science (2011) tomkinstinch at ornl dot gov cht(nine-three-three-nine) at rit dot edu Hi, Iʼm Chris Tomkins-Tinch from the Rochester Institute of Technology. This summer, Iʼve worked on creating an iPhone application and an associated backend server to interface with Sensorpedia.