maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [ANNOUNCE] pygeotrack: a simple N900-tracking client/server (https://talk.maemo.org/showthread.php?t=57425)

weißelstone 2010-06-29 19:54

[ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
1 Attachment(s)
As I found no real software for the N900 which allows you to easily find your N900 over the internet I wrote some simple scripts which allow exactly this. I heard that the minigpsd has support for some commercial tracking website but it needs packages which are not on the extras repo and you never know what they do with your data so here is my current concept:
  • geotrack.py: A really simple script which connects the N900 the internet if it is not already connected and sends it's location to the pygeotrack server via a simple http-get-request. At the moment it's completely invisible unless you list the running processes (to hide it if the phone gets stolen), a status bar applet and GUI will follow if the important features are polished
  • The pygeotrack-server: Two simple .php scripts. A upload script which the phone connects to like geoupload.php?lat=XXX&lon=XXX&id=XXX and a kml.php script which provides a kml-file which auto updates itself in Google-Earth. The locations are stored in a mysql table.
  • Low requirement: Everyone can get a php/mysql server for free, even servers like funpic should be enough. Only needs python-conix and python-location on the N900
  • Simple language/code: The client is in python and can be modified within seconds if you know a little python, the server is in php which is also widely known. All scripts together have less then 100 lines of code at the moment

Already done:
  • geotrack.py connects to the internet and sends the location every n seconds
  • php server stores the locations with timestamps into a sql table
  • php server sends out a simple kml displaying only the last location or the last n ones
  • Use custom icons for the location in Google Earth (a bike in the example picture)
  • Using keys to either track multiple devices or to show the location only to specific people. You can give a link with ?key=XXX to person 1 and ?key=YYY to person 2 and only update with key=XXX if you want that person 1 can see you or key=YYY so that person 2 sees you.
  • show speed at the moment of the last location
  • set up a SVN
  • create Google Map on the server

TODO ideas:
  • put the python-script into a debian package
  • add autostart
  • add GUI for configuration
  • status bar support
  • more advanced .kml-files
    • show speed at the moment of the last location
    • show the last points as a track with time-line (already works) and center the view on the latest one (for real time tracking, has problems with centering the view automatically on the latest point, Google Earth always centers the whole track)
  • set up a SVN if others are interested
  • support multiple keys when updating the location
  • create Google Map on the server
  • add setting to only upload when internet connection is available
  • configure the N900 script from the server (e.g. when updating put new settings into the answer from the server, could be used to change update intervall and other things).

Updates get different colors to get them in one look

The project is now located here with a very simple first version: https://garage.maemo.org/projects/pygeotrack/


So, is there any interest in this application? If some people would be interested I'd package it up and set up a svn (or garage page, didn't look into the whole garage thing yet). I'd also be happy if someone wants to work on it together with me (that's where the SVN comes into the game).

digitalvoid 2010-06-29 20:18

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Yeah, I would like this script. I have also made it myself, but I like to how you did it.

My software:

- Python script on n900 connects to my web server (cgi-bin python script) where coordinates are stored in a file.
- Made also a UI webpage in python/html with use of googlemaps which reads this stored file and shows coordinate list and auto-loads googlemap pictures.

It works very well...

handaxe 2010-06-29 20:24

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
"I am here" - it does some of what you describe, except when prompted to by a trigger sms. AFAIK, it is no longer developed or that was the case when I last looked.

http://talk.maemo.org/showthread.php?t=50246

weißelstone 2010-06-29 20:37

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
@digitalviod: In short it is like this:
python script:
Code:

*snip the whole gps and internet stuff*
    if device.fix:
        if device.fix[1] & location.GPS_DEVICE_LATLONG_SET:
            print "lat = %f, long = %f" % device.fix[4:6]
            url= "http://server.de/gps/upload.php?lat=%f&lon=%f&key=XXX" % device.fix[4:6]
            print url
            req = urllib2.Request(url)
            reply = urllib2.urlopen(req)

PHP script stores to SQL:
PHP Code:

<?php
$db
= new mysqli('localhost''root''root''test');
if (
mysqli_connect_errno()) {
    die (
'Konnte keine Verbindung zur Datenbank aufbauen: '.mysqli_connect_error().'('.mysqli_connect_errno().')');
}

$sql='INSERT INTO
    gps(lat, lon, date)
VALUES
    ('
.$_GET['lat'].',
     '
.$_GET['lon'].',
    NOW());'
;
$result $db->query($sql);
if (!
$result) {
    die (
'Etwas stimmte mit dem Query nicht: '.$db->error);
}
?>

kml-php-script:
PHP Code:

<?php
$db
= new mysqli('localhost''root''root''test');
if (
mysqli_connect_errno()) {
    die (
'Konnte keine Verbindung zur Datenbank aufbauen: '.mysqli_connect_error().'('.mysqli_connect_errno().')');
}

$sql="SELECT
    lat,
    lon,
    DATE_FORMAT(date, '%Y-%m-%dT%H:%i:%sZ') as newdate
FROM
    gps
ORDER BY date DESC LIMIT 1"
;
$result $db->query($sql);
if (!
$result) {
    die (
'Etwas stimmte mit dem Query nicht: '.$db->error);
}
$row $result->fetch_assoc();
echo 
'<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
    <name>KmlFile</name>
     <Style id="bike-icon">
      <IconStyle>
        <Icon>
          <href>http://server.de/gps/bike.png</href>
        </Icon>
      </IconStyle>
    </Style>'
;
$sql="SELECT
    lat,
    lon,
    DATE_FORMAT(date, '%Y-%m-%dT%H:%i:%sZ') as newdate
FROM
    gps
ORDER BY date DESC LIMIT 1"
;
$result $db->query($sql);
if (!
$result) {
    die (
'Etwas stimmte mit dem Query nicht: '.$db->error);
}
while (
$row $result->fetch_assoc()) {
echo 
'<Placemark>
    <name>'
.$row['newdate'].'</name>
    <description>Hier wurde die letzte Position gesendet.</description>
    <Point>
      <coordinates>'
.$row['lon'].','.$row['lat'].',0</coordinates>
    </Point>
        <!--<TimeStamp>
        <when>'
.$row['newdate'].'</when>
        </TimeStamp>-->
        <styleUrl>#bike-icon</styleUrl>
  </Placemark>
  '
;
}
echo 
'</Document>
</kml>'
;
?>

The sql query is double because I had other stuff in this file before which I removed and I forgot the second query. The TimeStamp is commented because the timeline was a bit annoying when new data came in. So this script creates a xml-compatible file which is referenced by the following .kml-file on the local-harddrive:
Code:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <NetworkLink>
      <name>Mein N900</name>
      <visibility>1</visibility>
      <open>1</open>
      <description>N900 On Tour</description>
      <refreshVisibility>0</refreshVisibility>
      <flyToView>1</flyToView>
      <Link>
        <href>http://server.de/gps/lastpos.php?key=XXX</href>
                <refreshMode>onInterval</refreshMode>
                <refreshInterval>30</refreshInterval>
      </Link>
    </NetworkLink>
</kml>

This structure could also be used to display a embedded Google Map on the webserver as they can parse kml files, too. I know the code is messy but my first goal was to get the information from my phone to Google Earth. Outsourcing the SQL functions into include files and a general cleanup will follow.
So you are using python on the server, too. Is this available on many hosters? I'm only used to php on servers and have zero experience with anything else.

@handaxe: I searched for Iamhere but couldn't find any reliable (recent) info at all. Also I don't want it with SMS as you'd need the phone's number and this script will upload the location as soon as it is connected to any internet connection no matter which sim is inserted. It's still mostly a simple project to learn something about python, maemo, php and the kml files ;)

fpp 2010-06-29 21:00

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Perhaps instead of connecting all by itself at fixed intervals (which might be troublesome), the python script could be run only each time a network connection is established (through d-bus signal, as in the Desktop Commmnd Execution Widget) ?

weißelstone 2010-06-29 21:11

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by fpp (Post 734601)
the python script could be run only each time a network connection is established

This was my first attempt. It works great but was not often enough for me (as my phone does only connect every hour or so for emails when on 3G and I want it to work as real time tracking too if desired). This will be a config option when I get to the GUI (tomorrow I hope).

digitalvoid 2010-06-29 21:23

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Originally Posted by weisselstone:

"...
So you are using python on the server, too. Is this available on many hosters? I'm only used to php on servers and have zero experience with anything else."

I have a 24/7 server at home with a fixed IP address so I can do what I want...

I like to know how you automaticly connect to an available internet connection (detect if there is already a connection and if not connect to a available connect and test if this connection works and if not chose another one and so on...).

Ayodeji 2010-06-29 21:29

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
'Looks very cool. A suggestion, if I may - perhaps you could add the ability to update via Google Latitude, which would provide an option for those who may not wish to use their own server (Latitude can also maintain location history as well)?

weißelstone 2010-06-30 07:53

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by digitalvoid (Post 734633)
I like to know how you automaticly connect to an available internet connection (detect if there is already a connection and if not connect to a available connect and test if this connection works and if not chose another one and so on...).

I mostly copied the python-conic sample: http://pymaemo.garage.maemo.org/conic.html

Quote:

Originally Posted by Ayodeji (Post 734643)
'A suggestion, if I may - perhaps you could add the ability to update via Google Latitude, which would provide an option for those who may not wish to use their own server (Latitude can also maintain location history as well)?

I never used Latitude but I see that there is a client already in the extras (or testing/devel) repo. If this is easy to implement this may be an option in the future but for know I' like to improve the self-made server. A history is also included (in fact all locations are stored in the mysql table but for now only the last n ones are shown).

benh_n900 2010-06-30 08:23

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
I also created a similar thing, mainly on the server side, that while not having the kml side, allows additional functionality if you have lost your phone, see http://talk.maemo.org/showthread.php?p=627494 and feel free to use http://www.whereismydevice.com if you want to connect your scripts to it to add any of this functionality!

Cheers,

Ben

weißelstone 2010-07-01 15:46

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by benh_n900 (Post 735069)
see http://talk.maemo.org/showthread.php?p=627494 and feel free to use http://www.whereismydevice.com if you want to connect your scripts to it to add any of this functionality!

Cheers,

Ben

I'll have a look at it. The client side is not that mature yet as I'm more used to php than python.

@all: The server got many improvements. The settings and addresses are now in an extra file so that working with the svn gets easier (as I don't want my SQL settings on the SVN :p).
Some easy Javascript Google Map is also now supported and also a page which creates the networked kml file for Google Earth which fetches the recent data from the server.
Source is at: https://garage.maemo.org/projects/pygeotrack/

By the way: At the moment this is more for the fun of "nearly" real-time tracking of the device (e.g. let the family know when I'm at home).
The lost-phone features will come later.

ny-hardcore 2010-07-01 21:51

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
is it possible i'm not seeing the sql create file somewhere?
or how is the mysql db constructed?

weißelstone 2010-07-01 22:44

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
I forgot about the file as I always create tables by hand.
I'll add one tomorrow. In short its an int called id, floats for lat, lon, bear and speed, datetime for date and varchar for the key. You can get the names from the .php files if you need it faster.

robbie 2010-07-02 06:33

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
I'm working on a simular (but different purpose) solution with Phil. Phil created a client and i created a server (php and db). It allows you to track a route while on the go. The logged route can be plotted on Google maps (or any other service that supports KML).

We don't have any release yet but you can get all the current files from SVN:

https://garage.maemo.org/projects/livegpslog/

weißelstone 2010-07-02 09:31

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
My searching skills have become very bad. I didn't find any of the projects named here before :p Your's, robbie, seems to be very similar. I also implemented tracks (either all points in the db or the last n ones) and it works good but if you enable the TimeStamps in the .kml real-time tracking doesn't work anymore (as Google Earth sets the timeline to the current view and won't display the new points by itself). If you are using TimeStamps (didn't check the source yet) did you find a solution to this?

EDIT: I just did a co on your svn. Seems you didn't make much with the kml yet, too. Just a line. So if you open the kml file it will display the whole track, right? This was one of my problems, I wanted the whole track but focus and zoom on the current position (just think you drive 130km on a motorway, then enter a city and someone wants to see where in the city you are, he sees the whole track and if he zooms in it will zoom back every 10 seconds to the whole track). The whole camera system in the .kml format is still a bit strange to me.

Gerald101 2010-07-02 10:52

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by weißelstone (Post 734615)
This was my first attempt. It works great but was not often enough for me (as my phone does only connect every hour or so for emails when on 3G and I want it to work as real time tracking too if desired). This will be a config option when I get to the GUI (tomorrow I hope).

May I suggest a way to do both? If there is no network connection store the points locally with a time stamp. Upload them when there is a network connection. I know this adds quite a lot of work.

weißelstone 2010-07-02 11:08

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by Gerald101 (Post 738415)
If there is no network connection store the points locally with a time stamp. Upload them when there is a network connection.

I'll have a look at it at some point.

By the way: I fixed the problem with the viewpoint when using track by using a LookAt for the whole file with the coordinates of the last position. This way Google Earth follows the device in real time but you can also see the track if you want.

robbie 2010-07-04 19:23

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by weißelstone (Post 738326)
Just a line. So if you open the kml file it will display the whole track, right?

You're right but that's on purpose. I'm mainly using it to display the progress while walking long distance marches (40 km and more a day) and people are not only curious where you are but also what progress i've made. They can zoom in any time.

I've also added a marker thats clickable and then shows you the kilometers i've walked. Google automatically zooms in on the marker once you've clicked.

If you want real-time (or near real time) tracking, you'll have to use ajax to add points and move the marker.

Edit: now i see that you solved it already :)

robbie 2010-07-04 19:26

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by Gerald101 (Post 738415)
May I suggest a way to do both? If there is no network connection store the points locally with a time stamp. Upload them when there is a network connection. I know this adds quite a lot of work.

There are some apps that log the track locally and allows you to upload it later (i believe manually only).

Phil (the author of the client we're working on) added some caching of points. We store 10 points and then upload. Theoretically it allows you to store more points when not connected but i'm not sure if it's foolproof.

Gerald101 2010-07-05 02:02

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by robbie (Post 740577)
There are some apps that log the track locally and allows you to upload it later (i believe manually only).

. . . .

If you find one that does it automatically let us know. I tried manual upload today and it is too cumbersome.

Laughing Man 2010-07-25 01:11

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Interesting project, though I'm not familar with python or php (I've done very little work with either and I never seem to have enough available time to learn).

But for anyone who's interested in this project and was wondering how to host their own server. You can download this if your using Windows.

http://www.apachefriends.org/en/xampp-windows.html

Then you just need to use opendyns if you don't have a static IP address.

cyeung 2010-09-07 00:42

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
After a bit of sorting things out, I got it to work! I will be using this so that people can see where I am on my Bike MS ride in less than a week (see signature).

Now, I would like to slow down the update loop (i.e. update the location once every 10 minutes). Where in locupdate.py can I wedge in a
Code:

time.sleep(600)
Thank you for your work, weißelstone!

Edit:Never mind. I figured out where to put it.

cyeung 2010-09-11 02:50

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Throughout this week, I have been testing pygeotrack in preparation of my bike ride this weekend in benefit of the National Multiple Sclerosis Society. So far, so good. In addition to adding a six-minute time delay, I did a few cosmetic adaptations to fit the event.

The result of my work can be found here: http://cyeungrun.com/BikeMS Assuming there is cellular coverage throughout the route, my Nokia N900 will be transmitting its GPS location every six minutes.

Data should start showing up at September 11, 8 AM (GMT -4) as the ride will start at that time. Until then, don't be surprised that the map is centered in the middle of the ocean.

weißelstone, thank you.

TiagoTiago 2010-09-11 04:33

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
You could check if your provider has a coverage map, though i guess now it's too late


btw, there was a thread about starting a comunity project for making somthing to track lost/stolen N900s, i don't remember the exact name of the thread though

cyeung 2010-09-12 01:45

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
1 Attachment(s)
The test proved to be successful (see attached screenshot). I was riding with some of my coworkers whose riding style varied from mine, so I ran out of time and had to be driven back to the last mile.

TiagoTiago 2010-09-12 02:11

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
during the day the map wouldn't load for me the times i tried so i couldn't follow you live, it has loaded with the full path now though

davall 2010-09-14 14:07

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by cyeung (Post 809100)
After a bit of sorting things out, I got it to work! I will be using this so that people can see where I am on my Bike MS ride in less than a week (see signature).

Now, I would like to slow down the update loop (i.e. update the location once every 10 minutes). Where in locupdate.py can I wedge in a
Code:

time.sleep(600)
Thank you for your work, weißelstone!

Edit:Never mind. I figured out where to put it.

Can you tell me where you've coded
Code:

time.sleep(600)
in the python script???

Thanks!

davall 2010-09-14 21:27

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Figured out. Nice solution with these python and php scripts.

chivar 2010-09-26 13:51

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
will this be available in the repos??? :)

cyeung 2010-10-03 15:32

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
In response to chivar's request, my procedures for getting this program to work...

1. Prerequisites
  • pygeotrack, which can be downloaded here: https://garage.maemo.org/projects/pygeotrack/
  • Web server with Apache, MySQL, and PHP.
  • (recommended) PHPMyAdmin
  • FTP or SSH/SFTP access to the server
  • Nokia N900 and USB data transfer cable
  • Knowledge of how to use the N900 command line and HTML.

2. Web server
  • Upload the contents of the server folder onto the server.
  • Create a database and create a table called "gps"
  • Add the following fields in the table. Data type is in parentheses:
    - id (int)
    - lat (float)
    - lon (float)
    - bear (float)
    - speed (float)
    - datum (datetime)
    - schlussel (varchar)

    NOTE:
    datum is German for "date," and schlussel is German for "key." When creating a field of varchar type, you must specify the length. For this program to function properly, you must put in a positive integer.
  • Edit settings.php with your settings (MySQL server, user name, password, etc.).

3. Nokia N900
  • In the client folder, edit pygeosettings.cfg with your server's URL and key.
  • Create a folder.
  • Upload the contents of the client folder to the N900.

4. Front-end improvements
I replaced the index.html with one of my own. To create a link to generate the KML file, I linked to:
Code:

creator.php?name=BikeMSLocator&desc=&key=0500&int=600
And for the map, I created an iframe with source
Code:

googlemap.php?key=0500&openmap=Submit
As you see above, my key was 0500, which was my rider number on the Bike MS event. Customize your own replacement index.htm with decorations of your own liking. Rename the original index.htm as testing.htm or something.

5. Execute
  • Open up X Terminal on the N900.
  • Navigate to the folder you put the contents of the client folder.
  • Execute python locupdate.py.

Those are my procedures. I may have missed a few things as it has been about a month since I did this. In any case, send me a PM with your issues and corrections, and I'll correct this post accordingly. Once we get this shaken out, let's put this on the wiki.

chivar 2010-10-04 04:30

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Thanks sir for very fast response :) will check this now

chivar 2010-10-18 03:46

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by weißelstone (Post 734544)
...So, is there any interest in this application? If some people would be interested I'd package it up and set up a svn (or garage page, didn't look into the whole garage thing yet). I'd also be happy if someone wants to work on it together with me (that's where the SVN comes into the game).

are these files updated? recent changes??
i like to try this as cyeung did :)
https://garage.maemo.org/plugins/scm...oot=pygeotrack

chivar 2010-10-31 04:38

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

login as: user
user@192.168.1.100's password:


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ cd /home/user
~ $ mv clientside/ pygeotrack
~ $ cd pygeotrack/
~/pygeotrack $ cat pygeosettings.cfg
[Settings]
server: http://192.168.1.102/pygeotrack/upload.php
key: pygeotrackern900
~/pygeotrack $ python locupdate.py
Traceback (most recent call last):
File "locupdate.py", line 6, in <module>
import conic
ImportError: No module named conic
~/pygeotrack $ sudo su apt-get install conic
Password:
Sorry, user user is not allowed to execute '/bin/su apt-get install conic' as root on Nokia-N900.
~/pygeotrack $ root


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.


where can i get the conic thing?? can anyone please post a link thank you all :):o:o


===============================

was able to locate conic module in python-conic.. now my problem is the page refresh too fast no time to parse the url passed by n900 to host/server

===============================

now im getting error

Lat: 14.339917
Lon: 121.049910
Bear: nan
Speed: nan
Key: pygeotrackern900
Warning: mysqli::mysqli() [function.mysqli]: (HY000/2003): Can't connect to MySQL server on '192.168.1.102' (111) in /var/www/pygeotrack/mysql.php on line 3
Konnte keine Verbindung zur Datenbank aufbauen: Can't connect to MySQL server on '192.168.1.102' (111)(2003)

chivar 2010-11-02 05:47

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
still getting errors :(
i dunno what else to change i already made sure my login credentials is correct

Lat: 14.583719
Lon: 121.029654
Bear:
Speed:
Key: pygeotrackern900Konnte keine Verbindung zur Datenbank aufbauen: Unknown MySQL server host 'http://myn900.atwebpages.com' (1)(2005)


Quote:


// SQL-Connection Settings
$host= "http://myn900.atwebpages.com"; <-- *fdb3.awardspace.com :o:p
:rolleyes:
$user = "522978_sql";
$pass = "1f4808fd";
$database = "gps";
:o:(:(


===============================
11.07.2010
i am now able to write to db
http://myn900.atwebpages.com/upload....geotrackern900

now the problem is the link
http://myn900.atwebpages.com/googlem...geotrackern900
doesn't show the correct gps coords from the locupdate.py
even when i export the kml file and opened it with google earth
it always end up somewhere in ocean in the african continent heheheh :eek::p

=================================
im now good :) :D:p:o;)

magnuslu 2010-12-02 03:31

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Hi,

Any chance to modify any of the stuff discussed in this thread to provide the functionality outlined in Running a marathon with the N900?

Thanks,

Magnus

weißelstone 2010-12-15 08:15

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by chivar (Post 843780)
are these files updated? recent changes??
i like to try this as cyeung did :)
https://garage.maemo.org/plugins/scm...oot=pygeotrack

They are always the latest files. The only changes I made are from yesterday adding support for basic auth to the client so that you can secure the web interface via .htaccess (Google Earth asks for the password, too. Google Maps doesn't work then because the google servers can't parse the password protected file) and some optical tuning for the interface of the web page.
Quote:

Originally Posted by chivar (Post 860481)
im now good :) :D:p:o;)

Nice to see. Sorry but the project was on ice for a few months due to time issues.
Quote:

Originally Posted by magnuslu (Post 887288)
Hi,

Any chance to modify any of the stuff discussed in this thread to provide the functionality outlined in Running a marathon with the N900?

I don't think this moves into the direction you are looking into. This doesn't show any information to the user. It's intended to run in background and show all information in Google Earth or a Web-Page. Disctance/remaining distance/average speed and time are not that hard I guess (and are a very good idea), still they would only show up on the computer and in the debug view on the phone.
For the sms update have a look at smscon, it sends your location (with google link) to every mobile that sends a specific codeword to your phone (also an email if you want). I don't know about twitter as I'm not using it, guess the API is not that hard but I won't do it.

I would love to write an optional GUI for the script (especially for the settings) but I'm completely new to maemo programing. If someone wants to make it it needs the following to work with the server:That's in fact eveything and also the reason I didn't bother learning GUI-coding yet, python was the easiest I could find to achieve a connection to my server (even thought my connection watcher and time settings do not really work) but it worked for me and then I stopped until now.
Quote:

Originally Posted by cyeung (Post 832317)
NOTE:
datum is German for "date," and schlussel is German for "key." When creating a field of varchar type, you must specify the length. For this program to function properly, you must put in a positive integer.

I thought key in the database could be misleading as "key" is sometimes used instead of "id" and so I made it German (well without the ü), then date got German by incident too :p

ny-hardcore 2011-01-14 14:44

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by davall (Post 816278)
Figured out. Nice solution with these python and php scripts.

Where exactly did you put it?
the time.sleep(600) i mean...

chivar 2011-02-14 04:42

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by ny-hardcore (Post 920236)
Where exactly did you put it?
the time.sleep(600) i mean...

yeah which file do we need to edit to add that delay? xterm is cluttered with the scrolling/polling of gps data

beetraham 2011-03-19 15:45

Re: [ANNOUNCE] pygeotrack: a simple N900-tracking client/server
 
Quote:

Originally Posted by ny-hardcore (Post 920236)
Where exactly did you put it?
the time.sleep(600) i mean...

Being a Python newbie myself as well (ny-hardcore: no pun intended), I found a quick workround for similar need by simply adjusting the originally defined wait state in file locupdate.py;
Code:

preferred_interval=location.INTERVAL_10S)
.. into;
Code:

preferred_interval=location.INTERVAL_60S)
- being equal to fixed 60s update interval.


<note:added per notices>

Additionally, you may or may not wish to consider adding shebang/hashbang into the header; at least yours truly did not seem to get the Python script initialized without generated erros until having inserted the *shebang* into file locupdate.py.

To insert shebang into python client's header section, let's first check the abs path to be added as a substring from N900 shell prompt;
Code:

root@N900:/gps# which python
/usr/bin/python
root@N900:/gps#

Now, let's add the shebang as a first line entry into file locupdate.py based upon above query response;

Code:

#!/usr/bin/python <-- to be added as 1st line entry
My 2 cents.

//beetraham


All times are GMT. The time now is 11:54.

vBulletin® Version 3.8.8