Sensorbase.org, Campaignr and Symbian Signing
My research looks like it will involve using mobile phones to collect sensor data, and I have recently been involved in a project that uses a piece of software for the Nokia N95, called Campaignr. This is a nice little application that will log data from all of the various sensors on the N95, and upload them to a server, however, there are a number of issues that prevent a researcher like me from downloading it and running it easily.
So, I've worked around these problems as follows:
Problem 1: The installation .SIS file, is not signed for all phones, and therefore cannot be installed.
I guess this was something that didn't matter too much before the software was released, as it was being used for research by the developers, and they only signed the .SIS package for a small set of phones.
So, the workaround - Download the non-signed version from the site, get a hold of your phones IEMI number (*#06#) and then follow the instructions on the Symbian Open Signed website. This will give you an application signed for your phone, and will allow access to all of the resources required.
Problem 2: There is no way of over-riding the hard coded username and password, from the xml campaignr settings file. This means that there is no way to upload data directly to SensorBase.org, without editing the campaignr source code.
I didn't want to delve into the C++ code, edit the lines and recompile, mostly because I haven't written in C++. So, I wrote a proxy script, that sits on my server, receives the Slog data from the campaignr app, strips out the username and password fields, and replaces them with the correct data.
<?php
$ch = curl_init("http://sensorbase.org/upload.php");
// strip slashes to datastring if the local server adds them
$datastring = $_REQUEST['data_string'];
if(get_magic_quotes_gpc()){
$datastring = stripslashes($datastring);
}
// set post
curl_setopt($ch, CURLOPT_POST, 1);
// dont show headers
curl_setopt($ch, CURLOPT_HEADER, 0);
// get the output as a var not echo
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// set the useragent to that of the calling user agent :)
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
// add the post variables
curl_setopt($ch, CURLOPT_POSTFIELDS,
array(
"email"=>"EMAIL_ADDRESS",
"password"=>"PASSWORD",
"project_id"=>$_REQUEST['project_id'],
"type"=>$_REQUEST['type'],
"data_string"=>$datastring,
"table_name"=>$_REQUEST['table_name']
));
// execute
$data = curl_exec($ch);
curl_close($ch);
// echo the output from SensorBase.org
echo $data;
?>