
This article is for people who would like to know more details about the technical aspects of iSeismometer. I implemented the server side program in PHP + MySQL but if you have webserver which can accept HTTP request, you can implement the program any environment. I’m also attaching the sample code at the bottom of this article.
In “data” section, this is what’s happen behind the scene:
1. iPhone takes GPS location data
2. Attach x,y,z motion signal data with your current location data
3. Send HTTP POST request on the url in the text box.
As the default, we provide our server for free, but please note that we do not guarantee how long we keep the data in our server depend on our storage space (since it’s text data only, we do not have any plan to delete them anyway. We have GIGABYTES HDD whoofoo!).
Here is the specification of posting data:
[GET parameters in the url]
I’m listing values here with description
device_id – 40 characters unique id from your iPhone
lat – float
lon – float
alt – float
sampling – I’m just taking sampling frequency which is fixed right now. Just put 100.
version – iPhone client version. (Just put 1.0.0) might be useful later when the spec has been changed
action – specify “add”
comment – free text
local_datetime - local date time in ISO format
The actual url will be looks like this
http://(your website)/index.php?device_id=xyz&lat=123&lon=123&alt=123&sampling=100&version=1.0.0&action=add&comment=none&local_datetime=000-00-00 00:00:00
[POST parameter]
signal – format is csv.
e.g.
1.026298,-0.640581,-0.766560
1.338053,-0.216916,-0.335511
0.782834,-0.195438,-0.302473
0.701869,-0.176067,0.100588
0.629521,0.219003,0.477647
this goes HTTP POST section. Very simple and lines are separated by new line characters (\n)
When you are retrieving data (when you click “Download” link on the website), it uses parameters below:
signal_id - specify identical database table’s row number
action – specify “download”
As you can see, i’m using same program by distinguishing user action in the parameter. “action” can have “add”, “download”, or anything else will be viewer mode (list posting history).
Here is the entire source code of the server side program. It’s only 100 lines of code, so please check the source code for more details. I also included the table create sql inside.
Related posts:
- iSeismometer Released [iPhone App] – Free! [caption id="attachment_237" align="alignnone" width="200" caption="Main screen"][/caption] Start iSeismometer, leave...
- ObjectGraph Approved for Apple Developer Program Cool news today!! After sending apple all our company’s documents,...
- ObjectGraph Approved for Apple Developer Program – Take 2 After a little struggle, got my iPhone changed to version...
- [How to use iSeismometer] Part2 – Play with Spectrum “Spectrum” is an experimental portion of this iSeismometer. Waves of...
- iSeismometer Published In A Technology Book Today a friend of mine discovered a book while browsing...
Related posts brought to you by Yet Another Related Posts Plugin.
























4 Responses
This is a very cool app. I love that you included the export-to-URL feature which makes it quite handy and useful for real-world work.
This looks like it could be handy for the public to send earthquake data to the USGS on earthquakes. Currently, whenever I feel an earthquake, I log in to the USGS reporting site:
http://earthquake.usgs.gov/earthquakes/dyfi/
and fill out their form.
But with this app, I could send in a quantitative record, stamped with the time, GPS coordinates, and orientation of the accelerometer axes based on the compass and accelerometer.
Of course, with the main quake, I usually would not have time to get out the iPhone and turn it on. Also, the first priority is personal safety. However, it usually takes me only a few seconds to relocate under my desk (we get a lot of quakes in Southern California).
When I”m at home, though, my current phone (not an iPhone) is usually on the charger anyway – if it made sense to leave this app running in “triggered mode” while the iPhone was on charge, then I might catch something.
In any event, after the main quake, I could leave it running for the next 12 hours or so – there are usually aftershocks.
I expect the USGS would like a longer time record, though – the last one earthquake here in southern california was 30 seconds (though that’s rather long).
I also suspect they might be okay with less than 100 Hz for the upload record – my impression is that most of the interesting content is at 1Hz or lower (but I’m no seismologist).
If memory space for the data record is an issue, one other thought besides filtering the data down to a 10 Hz sample rate or so is on-the-fly data compression. I wrote a paper on a suitable (lossy) algorithm:
“Faster Plots by Fan Data Compression”
http://portal.acm.org/citation.cfm?id=617475
Hi Richard,
Thank you for the information. Let me check it with my ACM account!
Kiichi
Your Comments
Hi Kiichi
have just visited Samoa where tsunami created huge devastation and loss of life last sept. Death toll would have been 5 times greater if occured at night!
Had this great idea to build a Iphone App to provide warning for tourists and others in low lying areas of impending tsunami. Idea is to turn it on at night while asleep.
At home and discovered your work – great
I am not a techie so couple of queries
1. How do I ( can it be changed) so alarm only goes off with say a 7.0 earthquake?
Not worried by small ones or people moving around beach fale
2. It seems to keep iphone window showing and does not go into quiet mode, so battery will run down quickly – is that right?
look fwd to hearing from you soon
rod mckenzie in New Zealand