maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   N900 + Google Latitude (https://talk.maemo.org/showthread.php?t=38542)

rubberduck 2011-01-23 14:27

Re: N900 + Google Latitude
 
ah, got it.
Thanks for your help and for the time you spend on this project.

greetings

rubberduck

MasterZap 2011-01-23 18:39

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 926665)
@rubberduck the version 4.6 is not the same version of traysh

the actual method is use the cell tower because is power efficient, the gps will drain your battery, you can not change it.

This shpuld be up to me! I ABSOLUTELY want the real GPS, but I only want the GPS to turn on at every update.

ALL latitude clients I got to work on the n900 was unusable either because
a) they used cell tower location only
or
b) they turned on the gps and kept it on constantly, even though I asked it to update every 10 minutes...

Please solve this!

/Z

rlinfati 2011-01-23 23:25

Re: N900 + Google Latitude
 
@MasterZap

the agps need about 15s in optimal condition to get your position in good condition (in a park) , in a poor condition (inside of a house/office) maybe never get yours position...

then, the problem is when stop the gps... if i stop early the accuracy will be worst of the cell-tower. if i wait a lot of time the battery drain...

i'm not sure what is a good method using gps without a battery drain... maybe using qt-mobile... but i'm not sure...

tip: if you open another app using the gps ( nokia maps, location test, chat, etc ) the google latitute will get the gps position ( by design )

traysh 2011-01-24 06:52

Re: N900 + Google Latitude
 
2 Attachment(s)
Quote:

Originally Posted by rlinfati (Post 926665)
@rubberduck the version 4.6 is not the same version of traysh

the actual method is use the cell tower because is power efficient, the gps will drain your battery, you can not change it.

the interval is in seconds, and not new position are submit before of last_update_time + interval

the daemon is not running at the startup, i need more testing before of enable this option ( roaming, 3g can be expensive and a battery drain )

the version of traysh have some bugs, and need to be fixed before to submit to extras... but i backport some features from their code.

btw, if you run from terminal, can see a log of the operations...

It's good to know you're back in development. I didn't thought you did, that's why I didn't upload my hacks this week.

By moving the gui out of the daemon to a separate file and using QCoreApplication instead of QApplication, I got a working daemon that only takes 2MB of RAM, including shared libraries. The updates are working as they should now, the program won't connect to internet and will update when connected. Also, I implemented some code to not update the location with a less accurate position, it considers the uncertainty of the new and of the previous positions. As a daemon, it is working really very well now, tough bigger update intervals are still missing.

To reduce battery drain, might we could turn the gps off and turn it on only when we want a new position. Of course this aproach will only work if the update interval is big.

About using cell tower, here where I am it's not possible to get a position with a better accuracy than 800 meters, and that's a lot. My girlfriend has an iPhone 4 and her positions are very precise, so I'm pretty sure the official Google updater uses the GPS. It would be nice if we could measure the battery drainage...

I think we should split the app into 3 standalone binaries: a very lightweight daemon that only updates the position, a settings GUI witch can be run from the system settings but also from the daemon or the latitudeGUI (this already happens if the username is wrong) and the latitudeGUI witch is only a viewer and witch may run the daemon if it's not already running (to provide the updates) and the settings, to configure it. But that's your decision.

I'm attaching a new deb, please have a try. As I mentioned, the gui won't work, it won't load at all, but the daemon is working really very well.

Probably the changes I made to the code I was working on won't fit in the git anymore, will they? I'm a git newbie. How can I upload my changes? I'm attaching my current code here as well.

traysh 2011-01-24 08:07

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 927011)
i'm not sure what is a good method using gps without a battery drain... maybe using qt-mobile... but i'm not sure...

qt-mobility would be a nice idea, at least it would reduce the #ifdefs and we would be instantly ready for meego (I guess)

petur 2011-01-24 08:46

Re: N900 + Google Latitude
 
How about having some options on its positioning behaviour?
1) only use celltower info
2) use celltower + GPS it that happens to be on when updating
3) use GPS (activate it)

option 3 could have another setting that specifies the amount of time to wait fot it to get a fix (example: 30 seconds or 1 minute), so the user can limit batt drain.

Splitting daemon, settings and viewer sems like a splendid idea. The daemon should be as lightweight as possible.

Thanks a lot for your work!

rlinfati 2011-01-24 09:36

Re: N900 + Google Latitude
 
@traysh make a branch in git..., no push the updates to the master branch

rlinfati 2011-01-24 15:07

Re: N900 + Google Latitude
 
Quote:

Originally Posted by traysh (Post 927154)
Also, I implemented some code to not update the location with a less accurate position, it considers the uncertainty of the new and of the previous positions.

what happen if my last update was in a park (gps, very accurate) and now i'm in my house (cell tower, no accurate) ??

Quote:

Originally Posted by traysh (Post 927154)
As a daemon, it is working really very well now, tough bigger update intervals are still missing.

Please, check my last updates to git... i backport allmost all yours important features.

To include the config in "control panel" please not use the UI file...

Quote:

Originally Posted by traysh (Post 927154)
About using cell tower, here where I am it's not possible to get a position with a better accuracy than 800 meters, and that's a lot.

the accurate depend of yours city... i have 200~ mts

traysh 2011-01-24 15:48

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 927417)
what happen if my last update was in a park (gps, very accurate) and now i'm in my house (cell tower, no accurate) ??

The location will be updated if the distance between the two places is bigger than the sum of the two uncertainties (eph). As in the park the precision was very good, it's eph will be almost 0, so it will depend on the distance and the uncertainty of your house. If the eph in your house is 200m and the park is closer than that, there will be only an update if randomly you get a good precision. We can set a timeout to force the update after some minutes, tough. The way it is now is working very well for me. If it isn't for someone we can change it.

Quote:

Originally Posted by rlinfati (Post 927417)
Please, check my last updates to git... i backport allmost all yours important features.

I will.

Quote:

Originally Posted by rlinfati (Post 927417)
To include the config in "control panel" please not use the UI file...

I'm sorry, I didn't understand what you mean

traysh 2011-01-24 20:59

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 927417)
what happen if my last update was in a park (gps, very accurate) and now i'm in my house (cell tower, no accurate) ??

on second thought, this is a bug that will happen in situations like the one you described. I'll think about it.

MasterZap 2011-01-25 13:57

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 927011)
@MasterZap

the agps need about 15s in optimal condition to get your position in good condition (in a park)

I normally get a position in less than that, but lets say that's a number.

Quote:

Originally Posted by rlinfati (Post 927011)
, in a poor condition (inside of a house/office) maybe never get yours position...

Sure, then give it 30 seconds to try? User-definable setting for timeout?

I have a simple python script that gives me GPS coordinates. I don't understand it (partially since I don't understand the location API in the Python code) but it seems to always, in a reasonable way, figure out the current GPS coordinate, and it's always pretty accurate.

I live out in the country, and by celltower it locates me sometimes 6 kilometers from where I am! I hope you understand that isn't even a little bit useful?

Actually, for me, "last GPS coordinate" is probably of more use than cell tower.

Quote:

Originally Posted by rlinfati (Post 927011)
then, the problem is when stop the gps... if i stop early the accuracy will be worst of the cell-tower. if i wait a lot of time the battery drain...

Ideally, make it configurable:

#1 - how long it tries
#2 - what it does when it fails, i.e. "keep last GPS point" or "revert to Celltower"

As said, for me, celltower is almost worse than useless.

Quote:

Originally Posted by rlinfati (Post 927011)
tip: if you open another app using the gps ( nokia maps, location test, chat, etc ) the google latitute will get the gps position ( by design )

So if I set up a cron job that every 30 minutes runs my gps.py (which gives the proper GPS position), that wil cause your tool to give the accurate coordinate? But what about all the times in between - your tool will fallback on the inaccurate coordinate?

I wouldn't want that.

I actually tried to extend the Python code I had to do latitude, but something went wrong in the auth stage (even though I seem to be doing exactly what everyone else is doing... very strange).

Here's my suggestion:

You give the user these options:

UI = Update interval (seconds):
GO = How long to keep the GPS on (seconds):

So you update every UI seconds.
If GO is zero, then DO NOT USE GPS AT ALL, use celltower.
If GO is nonzero, but less than UI, turn on the GPS for GO seconds every interval, then turn off.
If GO is nonzero but equal to or greater than UI, then keep GPS on constantly.


That's easy, and not so many user interface controls, and gives the total flexibility, and saves YOU the problem of deciding how long to try the GPS.

The only remaining question is, what to do when GPS doesn't lock, fall back to celltower, or use the last working GPS position. Personally I suggest give the user an option for that too, i.e.

When no GPS Lock use:
[ ] Celltower position
[ ] Retain last GPS position

Please?

Pretty please?

I'll send flowers! :)

/Z

traysh 2011-01-25 16:54

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 927209)
@traysh make a branch in git..., no push the updates to the master branch

ok, uploaded my current code to git as "experimental" branch

rlinfati 2011-01-25 17:13

Re: N900 + Google Latitude
 
Maybe

UI = Update interval (seconds, default 30min):
Cell (default) / Cell+Gps / Gps
GO = How long wait for a coordinate (default 30sec)

if not network, then not update

with cell, always i have a coordinate
with cell+gps, if the gps NOT fix, then fallback to cell
with gps, if the gps NOT fix, then not update

waiting for yours comments...

btw: the qtm location do not work well, never stop the gps, and always use the gps :(

MasterZap 2011-01-25 18:21

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 928328)
Maybe

UI = Update interval (seconds, default 30min):
Cell (default) / Cell+Gps / Gps
GO = How long wait for a coordinate (default 30sec)

if not network, then not update

with cell, always i have a coordinate
with cell+gps, if the gps NOT fix, then fallback to cell
with gps, if the gps NOT fix, then not update

waiting for yours comments...

Yep, that would work.

Quote:

Originally Posted by rlinfati (Post 928328)
btw: the qtm location do not work well, never stop the gps, and always use the gps :(

That's too bad if that's the case. Is that why this problem is in so many apps?? :(

/Z

traysh 2011-01-25 23:18

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 927417)
To include the config in "control panel" please not use the UI file...

rlinfati is there a problem in using a .ui file in the control panel? Or you didn't like my ui? Tell me and I will fix it...

rlinfati 2011-01-26 15:53

Re: N900 + Google Latitude
 
googlelatitude (0.6-0) unstable; urgency=low

* Daemon at boot time (default off)
* If not network, do not try to update
* Use of gps
* Max 120s for a fix, min of 5 in cell-mode and 15 in gps-mode, default 30s
* Updates between 1800s, min 300, max 3600

@traysh the .ui file are "expensive" in cpu/ram..., also the use of dbus

TODO:
-integrate the plugins for the control panel, only if not use .ui file
-maybe integrate the code to not update the location with a less accurate position...

googlelatitude (0.6-1) unstable; urgency=low

* auto update setting for daemon, fix start at boot time, fix NaN in gps eph

petur 2011-01-26 16:01

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 929107)
-refresh the daemon with new setting every x time,workaround: in the gui stop and start the daemon.

Wouldn't call that a workaround. Since settings aren't changed that often, restarting the daemon should be fine...

traysh 2011-01-26 23:38

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 929107)
@traysh the .ui file are "expensive" in cpu/ram..., also the use of dbus

As the config in the system settings is a standalone binary, it is not a problem, it won't be run very often, only when it is necessary to change a setting.

About DBus, removing the gui from the daemon reduced the ram usage from 20MB to 2MB, and that's very little, so DBus is not the reason of memory (nor cpu) usage, it's already loaded by the other app anyway and shared between applications.

petur 2011-01-27 08:45

Re: N900 + Google Latitude
 
I noticed start daemon doesn't do much, when you stop the GUI there are no updates.
Enabling daemon at boot and rebooting seems to have started the daemon, waiting now to confirm it is updating.

In the UI I had disabled GPS, but whenever I start the UI app, the GPS still goes on.

petur 2011-01-27 09:38

Re: N900 + Google Latitude
 
OK, the deamon seems to work (is updating), but it always switches on the GPS, even if I have that disabled!

MasterZap 2011-01-27 09:48

Re: N900 + Google Latitude
 
Quote:

Originally Posted by petur (Post 929750)
OK, the deamon seems to work (is updating), but it always switches on the GPS, even if I have that disabled!

I think the "satellite dish" icon lights up for any location based thing, it's not actually a "GPS" indicator.

/Z

petur 2011-01-27 09:51

Re: N900 + Google Latitude
 
really? that s*cks :/

petur 2011-01-27 11:39

Re: N900 + Google Latitude
 
Bad news...

Using the Location Test tool, which logs GPS access (and seems to do so even when I do not enable the GPS through this tool), I saw that the GPS is turned on...

so the blinking indicator does mean the GPS is on, and that also means the config option of not to use GPS doesn't work.

rlinfati 2011-01-27 11:43

Re: N900 + Google Latitude
 
Quote:

Originally Posted by MasterZap (Post 929758)
I think the "satellite dish" icon lights up for any location based thing, it's not actually a "GPS" indicator.

/Z

correct !

the "start daemon" start a background process to update after the gui is closed.

ths gps option use ONLY gps, if is not checked use ONLY cell tower

petur 2011-01-27 11:47

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 929808)
the "start daemon" start a background process to update after the gui is closed.

ths gps option use ONLY gps, if is not checked use ONLY cell tower

well, neither of them seem to do what the label says... I only got the daemon running by enabling the option to start it at boot *and* reboot my n900 (now the daemon is running fine).

And from what I see logged by Location Test, it does turn on the GPS (unless the logging is flawed? Maybe I need to take it outside and see if it sees any sats)

Or does anybody have a good way to see if the GPS hardware is turned on? Tried HealthCheck, didn't show me :/

rlinfati 2011-01-27 11:51

Re: N900 + Google Latitude
 
Quote:

Originally Posted by petur (Post 929812)
well, neither of them seem to do what the label says... I only got the daemon running by enabling the option to start it at boot *and* reboot my n900 (now the daemon is running fine).

And from what I see logged by Location Test, it does turn on the GPS (unless the logging is flawed? Maybe I need to take it outside and see if it sees any sats)

please, with boot=off start the daemon from the gui and verify if is running GoogleLatitudeDaemon

The Location Test log all location events, from cell and gps. how much satellite in view and use you have ? if are not 0/0 you may be have others app pulling the gps...

if is blinking the "gps icon" this mean is waiting for a fix (from gps or cell)

petur 2011-01-27 12:38

Re: N900 + Google Latitude
 
OK, I stand corrected... Location Test reported 0 sats and didn't blink the icon, so that part seems OK.
Sorry about the wrong report!

MasterZap 2011-01-27 13:34

Re: N900 + Google Latitude
 
Are you sure the "start daemon" works? Coz I only had it work after rebooting. I even grep:ed processes and saw nothing (also after closing the UI).

But after rebooting it was there. AND WORK IT DOES :D

I am very happy. I was using a home-hacked version of "gluppy" before to get the best Latitude functionality.... but this definitely works better now!

Many thanks to mr Linfati :D

/Z

rlinfati 2011-01-27 15:01

Re: N900 + Google Latitude
 
@MasterZap

please, run GoogleLatitudeGUI from a terminal and when you push the "start daemon" button will be writed
LatitudeGUI: demonio /path/to/GoogleLatitudeDaemon

please, can verify if the path is correct, thanks !

EDIT: fixed in 0.6-2 :)

MasterZap 2011-01-27 21:14

Re: N900 + Google Latitude
 
Well, it starts it,.. but it dies when you close the GUI... probably coz you start it as a child process??

/Z

gazza_d 2011-01-30 10:34

Re: N900 + Google Latitude
 
is it possible to change the positioning method and update frequency via command line or script? Or add specifc location based rules within the program?

basically what i want do do is to change them depending on where I am and what I am connecting to. eg if i am on wlan, then i am generally going to be static within a certain radius, so the update frequency can be reduced.

i would want to increase my updates and accuracy if i am in my car for example, which i can identify automatically via it's bluetooth connection.

good work so far, yout efforts are apprciated.

rlinfati 2011-01-30 11:59

Re: N900 + Google Latitude
 
Quote:

Originally Posted by gazza_d (Post 931785)
is it possible to change the positioning method and update frequency via command line or script? Or add specifc location based rules within the program?.

the config file is
~/.config/linfati/GoogleLatitude.conf

xur17 2011-01-30 17:04

Re: N900 + Google Latitude
 
Using a script like this you can get your current location when you are near wifi. Could this possibly be added to this script?

It could be used instead of gps or locating via cell phone base station information. This appears to give fairly accurate readings, and could fall back on gps or cell phone positioning if the accuracy wasn't high enough?

I might try to write a small script that will return location information using this automatically.

rlinfati 2011-01-30 17:59

Re: N900 + Google Latitude
 
@xur17

the cell tower mode do the same...
it's send the cell id send, wifi mac visible, and others.... but is based in nokia server and not google server

i have a bash script more complete for google service... i going to see if i can integrate it....

petur 2011-01-31 13:52

Re: N900 + Google Latitude
 
I use alarmed to switch my phone offline at night and back online again in the morning.
This was working fine, but it recently stopped working properly - when I look at the screen, there is a dialog on there that asks if I want to switch out of offline mode.

Did anything change to the latitude daemon that could cause it to do this (ie, tries to foce online rather than just check if the internet is available)?

I remember that this worked some time before, so this behavior came in a recent update of the Latitude daemon.

rlinfati 2011-01-31 14:26

Re: N900 + Google Latitude
 
@peter the version 0.6-x do not try auto connect...

@xur17 this is my script http://pastebin.com/gBpBukWm but need curl ( or wget ) to work... i going to translate to qt...

petur 2011-01-31 14:33

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 932587)
@peter the version 0.6-x do not try auto connect...

I seem to have 0.6-2 installed, I'll try to experiment a bit more tonight to figure out the culprit.

xur17 2011-01-31 17:48

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 931999)
@xur17

the cell tower mode do the same...
it's send the cell id send, wifi mac visible, and others.... but is based in nokia server and not google server

i have a bash script more complete for google service... i going to see if i can integrate it....

I tried using this script on cell tower mode while in my house (wifi visible) and the margin of error for the location was quite large.

That is interesting that nokia does get location based on wifi mac visible. I assumed they didn't.

rlinfati 2011-01-31 18:00

Re: N900 + Google Latitude
 
@xur17, in my script i can add the cell id to improve the accuracy, maybe your wifi router mac is not registred in google :)

MasterZap 2011-01-31 19:36

Re: N900 + Google Latitude
 
Hey, I have a suggestion: When connected to wifi - stop updating (reuse latest GPS fix) or at least reduce rate of updates a lot!

That would be perfect.

Other than that, it is working quite well now!!! Great Work!


/Z


All times are GMT. The time now is 04:39.

vBulletin® Version 3.8.8