Re: Stress test of my Freerunner

2009-06-12 Thread Christian Rüb
 I attached my code. As said, it isn't much and not very user-friendly. 
 However, I was surprised how few code is needed to get the idea working.
 
 storeLocation.py:
 This script is called on the FR to store the current coordinates to 
 locations.dat
 E.g. storeLocation.py -t My Home -d This is where I live since 5 years
 Please modify http://myserver.org/; to your needs.
 
 sendLocations.sh:
 All locations stored in locations.dat can be send to the server with the 
 small sendLocations.sh script. I used the http-get method since there was no 
 urllib module in SHR.
 
 add.py:
 On the server side, add.py receives the coordinates as cgi script and stores 
 the information to locations.dat. (I should change the name, since the 
 content is different to locations.dat on the FR...)
 
 diary.kml:
 This is also a cgi script written in Python which creates the kml output from 
 the content of locations.dat.
 
 Have fun :-)
 Sven

Hi Sven,

is it OK to use your code and GPL it? I started building a little GUI for what 
you have done as a travel diary sounds like a pretty good idea to me.
You can see what I have done so far here:
http://git.senfdax.de/?p=travel-diary;a=summary

Currently it does nothing else than requesting GPS and diesplaying the fields.

bitbake recipe to follow as soon as it really does something.

Anyone interested in making an icon?

Cheers,
 Christian

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Stress test of my Freerunner

2009-06-12 Thread Sven Klomp
Hey Christian,

On Friday 12 June 2009 13:56:32 Christian Rüb wrote:
 is it OK to use your code and GPL it?
The license text would be longer than my source code, thus I didn't add 
anything ;-)
GPL2 or 3 is fine for me, thanks for asking...


 I started building a little GUI for
 what you have done as a travel diary sounds like a pretty good idea to me.
 You can see what I have done so far here:
 http://git.senfdax.de/?p=travel-diary;a=summary

 Currently it does nothing else than requesting GPS and diesplaying the
 fields.

 bitbake recipe to follow as soon as it really does something.

Great to hear that my code is somehow useful.

Sven

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Stress test of my Freerunner

2009-06-08 Thread Sven Klomp
On Sunday June 7 2009 16:18:48 Yogiz wrote:
 Thanks for the impressions. I really like the GPS diary idea. Perhaps
 you should release it to the public? As to alarms, try ffalarms (opkg
 install ffalarms).

I attached my code. As said, it isn't much and not very user-friendly. However, 
I was surprised how few code is needed to get the idea working.

storeLocation.py:
This script is called on the FR to store the current coordinates to 
locations.dat
E.g. storeLocation.py -t My Home -d This is where I live since 5 years
Please modify http://myserver.org/; to your needs.

sendLocations.sh:
All locations stored in locations.dat can be send to the server with the small 
sendLocations.sh script. I used the http-get method since there was no urllib 
module in SHR.

add.py:
On the server side, add.py receives the coordinates as cgi script and stores 
the information to locations.dat. (I should change the name, since the content 
is different to locations.dat on the FR...)

diary.kml:
This is also a cgi script written in Python which creates the kml output from 
the content of locations.dat.

Have fun :-)
Sven


diary.kml
Description: application/vnd.google-earth.kml
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import cgi
import cgitb
cgitb.enable()

print(Content-Type: text/html)   # Header-Info  
print() # Empty line needed

form = cgi.FieldStorage()
if not (form.has_key(latitude) and form.has_key(longitude) and form.has_key(date) and form.has_key(title)):
	print H1Error/H1
	print Please fill in the fields.
else:
	f = open('locations.dat', 'a')
	if (form.has_key(details)):
		f.write(form[date].value+ | + form[latitude].value+ |+form[longitude].value+|+form[title].value+|+ form[details].value+\n )
	else:
		f.write(form[date].value+ | + form[latitude].value+ |+form[longitude].value+|+form[title].value+|+\n )
	f.close()
	print OK


sendLocations.sh
Description: application/shellscript
#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Logging
import logging
import sys

mainlogger = logging.getLogger()
console = logging.StreamHandler(sys.stdout)
console_formatter = logging.Formatter(%(name)s - %(levelname)s - %(message)s)
console.setFormatter(console_formatter)
mainlogger.addHandler(console)

logger = logging.getLogger()
logger.setLevel(logging.DEBUG)

import optparse
import datetime
import dbus
#import urllib

class MyOptionParser(optparse.OptionParser):
	def __init__(self):
		optparse.OptionParser.__init__(self,usage: %prog -t title [-d \more details\ | ... ])
		self.add_option(-t,
		--title,
		action=store,
		type=string,
		dest=title,
		help=Title of this location)

		self.add_option(-d,
		--details,
		action=store,
		type=string,
		dest=details,
		help=Detailed information of this location)

		self.add_option(--longitude,
		action=store,
		type=string,
		dest=longitude,
		help=Set longitude manually)

		self.add_option(--latitude,
		action=store,
		type=string,
		dest=latitude,
		help=Set latitude manually)

		self.add_option(--date,
		action=store,
		type=string,
		dest=date,
		help=Set date manually)

		self.set_defaults(date=datetime.date.today().isoformat())


def getCoordinates():
	system_bus = dbus.SystemBus()
	gps_object = system_bus.get_object('org.freesmartphone.ogpsd', '/org/freedesktop/Gypsy')
	gps_interface = dbus.Interface(gps_object, dbus_interface='org.freesmartphone.Resource')
	gps_interface.Enable()

	gps_interface = dbus.Interface(gps_object, dbus_interface='org.freedesktop.Gypsy.Position')
	position=gps_interface.GetPosition()
	print(position)
#	gps_interface = dbus.Interface(gps_object, dbus_interface='org.freesmartphone.Resource')
#	gps_interface.Disable()

	if (position[0]==0):
		logger.warning(No GPS data)
		return None, None
	return str(position[2]), str(position[3])


def saveLocation(latitude, longitude, date, title, details):
	url=http://myserver.org/add.py?;
	url=url+date=+date
	url=url+latitude=+latitude
	url=url+longitude=+longitude
	url=url+title=+UrlEncode(title)
	if (details!=None):
		url=url+details=+UrlEncode(details)
	print(url)
	f=open(locations.dat,a)
	f.write(url+\n)


# SHR doesn't have the urlib module, therefore I used the code snippet from
# http://blog.affien.com/archives/2005/06/25/python-url-encoding/comment-page-1/

HexCharacters = 0123456789abcdef
def UrlEncode(s):
	r = ''
	for c in s:
		o = ord(c)
		if (o = 48 and o = 57) or \
			(o = 97 and o = 122) or \
			(o = 65 and o = 90) or \
			o == 36 or o == 45 or o == 95 or \
			o == 46 or o == 43 or o == 33 or \
			o == 42 or o == 39 or o == 40 or \
			o == 41 or o == 44:
			r += c
		else:
			r += '%' + CleanCharHex(c)
	return r

def CleanCharHex(c):
	o = ord(c)
	r = HexCharacters[o / 16]
	r += HexCharacters[o % 16]
	return r



if __name__ == __main__:
	parser= MyOptionParser()
	options, args = 

Stress test of my Freerunner

2009-06-07 Thread Sven Klomp
As you already noticed from my last mail (Visit at Openmoko), I was traveling 
through Taiwan. I didn't want to blame anyone, but share my feelings with 
people that are also thrilled by this project. Nevertheless as several people 
already mentioned, we have an open phone! and there is a future!

I use my Freerunner for several weeks as my daily phone now (started after the 
buzz was fixed by Daniel, thanks). However, the last two weeks I stretched my 
FR to the limit and it did it well:
Few days before I started traveling Taiwan, I decided to make some GPS based 
diary for my friends at home. Thanks to the very easy API of FSO, I was able to 
write a basic application in Python within three evenings. The applications 
sends the current coordinates and some text to my server, where a KML file is 
created which can be downloaded by my friends. At the airport, I bought a cheap 
Taiwan SIM card and I started to transmit my position via GPRS (which also 
worked out-of-the-box). Furthermore, the timezone changed automagically based 
on GSM (my old Sony Ericsson wasn't able to do so).

I had a lot of fun during the last weeks tracking my travel. Of course, I had 
some problems but I could solve all of them more or less. E.g. the SHR alarm 
application doesn't worked. So I did the alarm the bash way: sleep 28800  
aplay alarm.wav :-) With this solution, the phone couldn't suspend. Luckily, 
the wall charger has Taiwan connections below the European adaptor :-)
Furthermore, I was that adventurous to make an opkg upgrade during the travel 
:-) Thereafter, I couldn't suspend after I started GPRS. Annoying, but not a 
serious problem.

I love my FR
Sven

P.S.: Now I start to fill some bug reports :-)

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Stress test of my Freerunner

2009-06-07 Thread Yogiz
Thanks for the impressions. I really like the GPS diary idea. Perhaps
you should release it to the public? As to alarms, try ffalarms (opkg
install ffalarms).

Yogiz

On Sun, 7 Jun 2009 21:55:37 +0800
Sven Klomp s...@klomp.de wrote:

 As you already noticed from my last mail (Visit at Openmoko), I was
 traveling through Taiwan. I didn't want to blame anyone, but share my
 feelings with people that are also thrilled by this project.
 Nevertheless as several people already mentioned, we have an open
 phone! and there is a future!
 
 I use my Freerunner for several weeks as my daily phone now (started
 after the buzz was fixed by Daniel, thanks). However, the last two
 weeks I stretched my FR to the limit and it did it well: Few days
 before I started traveling Taiwan, I decided to make some GPS based
 diary for my friends at home. Thanks to the very easy API of FSO, I
 was able to write a basic application in Python within three
 evenings. The applications sends the current coordinates and some
 text to my server, where a KML file is created which can be
 downloaded by my friends. At the airport, I bought a cheap Taiwan SIM
 card and I started to transmit my position via GPRS (which also
 worked out-of-the-box). Furthermore, the timezone changed
 automagically based on GSM (my old Sony Ericsson wasn't able to do
 so).
 
 I had a lot of fun during the last weeks tracking my travel. Of
 course, I had some problems but I could solve all of them more or
 less. E.g. the SHR alarm application doesn't worked. So I did the
 alarm the bash way: sleep 28800  aplay alarm.wav :-) With this
 solution, the phone couldn't suspend. Luckily, the wall charger has
 Taiwan connections below the European adaptor :-) Furthermore, I was
 that adventurous to make an opkg upgrade during the travel :-)
 Thereafter, I couldn't suspend after I started GPRS. Annoying, but
 not a serious problem.
 
 I love my FR
 Sven
 
 P.S.: Now I start to fill some bug reports :-)
 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Stress test of my Freerunner

2009-06-07 Thread Steve Mosher
Thanks Sven,

  Sorry I was not there on Monday when you visited the office. I left 
TPE the previous friday.
  Glad to hear you love you FR, keep up the good work and best of luck 
on your project.


Sven Klomp wrote:
 As you already noticed from my last mail (Visit at Openmoko), I was traveling 
 through Taiwan. I didn't want to blame anyone, but share my feelings with 
 people that are also thrilled by this project. Nevertheless as several people 
 already mentioned, we have an open phone! and there is a future!

 I use my Freerunner for several weeks as my daily phone now (started after 
 the buzz was fixed by Daniel, thanks). However, the last two weeks I 
 stretched my FR to the limit and it did it well:
 Few days before I started traveling Taiwan, I decided to make some GPS based 
 diary for my friends at home. Thanks to the very easy API of FSO, I was able 
 to write a basic application in Python within three evenings. The 
 applications sends the current coordinates and some text to my server, where 
 a KML file is created which can be downloaded by my friends. At the airport, 
 I bought a cheap Taiwan SIM card and I started to transmit my position via 
 GPRS (which also worked out-of-the-box). Furthermore, the timezone changed 
 automagically based on GSM (my old Sony Ericsson wasn't able to do so).

 I had a lot of fun during the last weeks tracking my travel. Of course, I had 
 some problems but I could solve all of them more or less. E.g. the SHR alarm 
 application doesn't worked. So I did the alarm the bash way: sleep 28800  
 aplay alarm.wav :-) With this solution, the phone couldn't suspend. Luckily, 
 the wall charger has Taiwan connections below the European adaptor :-)
 Furthermore, I was that adventurous to make an opkg upgrade during the travel 
 :-) Thereafter, I couldn't suspend after I started GPRS. Annoying, but not a 
 serious problem.

 I love my FR
 Sven

 P.S.: Now I start to fill some bug reports :-)

 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community
   


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Stress test of my Freerunner

2009-06-07 Thread Risto H. Kurppa
Great, this is encouraging!

Please share your blogging script, I'm sure there are people interested in it!

r

-- 
| risto h. kurppa
| risto at kurppa dot fi
| http://risto.kurppa.fi

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Stress test of my Freerunner!

2009-06-07 Thread Michael 'Mickey' Lauer
Great post, good vibrations!

Thanks for sharing... and keep the bug reports coming!

Cheers,

:M:


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community