?

Log in

No account? Create an account
nmea_info.py on Series 60 v3 (3rd Edition) - Nick [entries|archive|friends|userinfo]
Nick

[ website | gagravarr.org ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

nmea_info.py on Series 60 v3 (3rd Edition) [Apr. 29th, 2007|01:58 pm]
Nick
Artem lent me his S60 v3 phone today, so I've been working on making nmea_info.py work nicely on 3rd edition phones. I'd hoped that this would be a mix of changing all my absolute positioning to using a relative size, and selecting the new font.

So, I went through the code, and updated it all to use a relative positioning, based on the screen height required to fit 12 lines on the screen. This bit worked really well, and now all the text appears in the right place, and all the graphics are of the right size.

The snag came when I tried to get the font to be a sensible size. Despite the tiny font size bug being reported over 8 months ago, there's still no sign of a patch. All they need to do is allow you to specify either font=u'Font name' (as now) OR font=(u'Font Name',size) (with the size only having an effect on 3rd edition phones), then then pass that size onto the underlying font object. But, they don't, so the font is unreadable.
Update: The bug is finally fixed! You need to use S60 Python 1.3.22 or later.

Thankfully, I'm not the only person who things that the current python behaviour just won't cut it. So, there's now an un-official build of python for S60 3rd edition, which does the fonts a lot better. It doesn't have a font api that's compatible with older S60 phones, but they have fixed the default fonts (eg normal) to be the right size.

So, with Artem's phone running the un-official python 1.3.18, I was able to get nmea_info.py to render almost the same on S60 v2 and v3. All other S60 v3 users of nmea_info.py should grab the latest version (v22), make sure they have the patched version of python Python 1.3.22, and enjoy!

Update:Python 1.3.22 fixes the bugs, so use that, instead of the patched version.

Update 2: If you have installed the LocationRequestor module, then from nmea_info.py v23 onwards, it can talk to the internal GPS in a 3rd edition series 60 phone, eg the N95. However, owing to the pesky platsec stuff, all the .sis files (python, LocationRequestor and nmea_info) will need to be signed with a devcert, and granted all the extra permissions that allows.
linkReply

Comments:
From: (Anonymous)
2007-05-25 08:12 am (UTC)

official python 1.3.21 - 3rd Edition S60v.3

@Nick
Thanks for your scripts. Is the patch to python still necessary with the last version of python(1.3.21) on Series60 v.3? Actually I downloaded nmea_info(v22) but the fonts are unreadable so I guess the answer is yes, but maybe the .sis file should be rebuild with the last python release, or not?
Many thanks in advance
Roberto
(Reply) (Thread)
From: gagravarr
2007-05-25 05:53 pm (UTC)

Re: official python 1.3.21 - 3rd Edition S60v.3

You still need to use the patched version of python, 1.3.21 still hasn't fixed the bug :(

Alas I can't include the font patch in the .sis file of nmea_info, as it's a patch to core python, so has to be included in the python .sis file.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-05-28 09:07 am (UTC)

Re: official python 1.3.21 - 3rd Edition S60v.3

Thank you, I'll try to patch python-1.3.21. By the way about nmea_info, I was thinking the use of your app. for outdoor activities (trekking et all.). What about load an image (maybe a scan of a mountain track map, georeference (it this correct?) that on a PC, then load into the phone) and display directly on phone where we are?
May be what I am saying is really stupid or very very difficult, so I apologize in advance. Thank you for you patience.
Roberto
(Reply) (Parent) (Thread)
From: gagravarr
2007-05-28 04:11 pm (UTC)

Re: official python 1.3.21 - 3rd Edition S60v.3

Alas the georeferencing would be tricky, and the drawing it on the phone would be pretty hard too :(
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-03 06:38 pm (UTC)

N95 Internal GPS

Can this be used with the internal GPS in a Nokia N95?

I've tried and it just asks which Bluetooth device to use.
(Reply) (Thread)
From: gagravarr
2007-06-03 06:49 pm (UTC)

Re: N95 Internal GPS

Alas not yet. There's an experimental python module to interface with the GPS on the N95, but it's not yet fully working. Once it is, I will be knocking up a N95 version
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-04 09:56 pm (UTC)

Re: N95 Internal GPS

I hope too to see soon a preview of nmea_info.py using LocationRequestor module!

Thank you

Eddi
(Reply) (Parent) (Thread)
From: gagravarr
2007-06-05 09:09 am (UTC)

Re: N95 Internal GPS

Ah, hadn't seen LocationRequestor (had been tracking the other one, gps_location)

Having a read through the documentation, it looks quite promising. It seems to have almost everything that I'll need, except the details on the satellites (position in the sky, signal strength etc). If I have some spare time, I might look at doing a version using LocationRequestor but missing all the satellite code, otherwise I'll wait and do a version when it supports everything we'll want.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-05 09:31 am (UTC)

Re: N95 Internal GPS

I found LocationRequestor Last nignt on pys60 developer forum...

I seen it is more complete then gps_location..

You may write some stub for missing feature, I hope it will be implemented in a next release!

Eddi
(Reply) (Parent) (Thread)
From: gagravarr
2007-06-05 04:25 pm (UTC)

Re: N95 Internal GPS

After my request, they've added some method calls that look like they'll do what we need. I'll have a play later and see.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-05 05:11 pm (UTC)

Re: N95 Internal GPS

I've seen, Great

Eddi.
(Reply) (Parent) (Thread)
From: gagravarr
2007-06-05 11:08 pm (UTC)

Re: N95 Internal GPS

v23 should support the gps in an N95. Make sure you have everything signed with your devcert, so you can get access to the location api, and you've also installed the latest LocationRequestor.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-06 08:25 am (UTC)

Re: N95 Internal GPS

nmea_info.py open if called by python, but open and then close from packaged version nmea_info_v3_023_devcert.sis.

!:\sys\bin\nmea_info_0x200042e3.exe [NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment]

Eddi
(Reply) (Parent) (Thread)
From: gagravarr
2007-06-06 09:24 am (UTC)

Re: N95 Internal GPS

Did you sign the nmea sis file with your devcert, and give it all the extra devcert permissions? That looks to me like you haven't given it the extra permissions it needs (such as Location)
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-06 11:24 am (UTC)

Re: N95 Internal GPS

Yes, I signed it with DevCert as I done with LocationRequestor.

I think is a problem with PE header

Please check that when you build the exe you included the right capability.

When makesis package the files it read from exe the capability encoded.

Eddi
(Reply) (Parent) (Thread)
From: gagravarr
2007-06-06 12:14 pm (UTC)

Re: N95 Internal GPS

I signed mine with ensymble, so I just set all the permissions at signing time.

I've build a new version of the devcert sis for v23, which has all the permissions requests, give that a try with your signing tool and see if it likes it any more.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-28 05:32 pm (UTC)

Re: N95 Internal GPS

I recently bought a N95 and now I am looking for an application that can burn in the lat/long cordinates on to the pictures. At the very least add the coordinates to the JPG header. Can you application be modified to do that?

I am not a member of this forum, but perhaps you can send a copy your answer to soofika@gmail.com

Soofi
(Reply) (Parent) (Thread)
From: gagravarr
2007-06-29 10:42 am (UTC)

Re: N95 Internal GPS

If you use my app to take the photo, it'll put the lat and long in

Otherwise, just offload the pictures and gpx files to your computer when you're done, and use some external tagging progam there (it'll depend on your OS what to use)

An on-phone one might be possible, but it'll probably be a bit fiddly to do the UI to select the gpx/nmea file, then select the pictures. pexif would do all the work, and I've written (GPL) code for handling the gpx/nmea files on a phone, it's just the selection UI you would need to write.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-18 03:06 pm (UTC)

cam bug :)

Hi !
Sorry to tell that I tried to run .py and .sis on my e61 without success...
Passed the no-landscape-view-warning, the other pb is that e61 got no camera. I commented out lines #153-159 and it launches well. The sis on returns a system error...
(Reply) (Thread)
From: gagravarr
2007-06-19 09:21 am (UTC)

Re: cam bug :)

In theory, it ought to be fine without a camera. It tries to load the camera module from within a try/except block, so it can detect if there's no camera and then not offer to use it.

Any chance you could try loading up the python shell, and running "import camera". You ought to get an exception (since there's no camera), but I'm guessing it's not an ImportError as with S60v2. Any chance you could let me know what it is for S60v3?
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-06-30 11:41 am (UTC)

Re: cam bug :)

On e61 :
>>> import camera
Traceback (most recent call last):
File "", line 1 in ?
File "c:/resource/site.py", line 97 in platsec_import
return _original_import(name, globals, locals, fromlist)
File "c:/resource/camera.py", line 24, in ?
_my_camera=_camera.Camera(0)
SymbianError: [Errno -44] KErrHardwareNotAvailable
(Reply) (Parent) (Thread)
From: gagravarr
2007-07-02 01:23 pm (UTC)

Re: cam bug :)

Thanks for that, I've added it as another except catch. New version with that in will be out as soon as I get my N95 back from a friend who's borrowing it...

For now, you could switch the "except ImportError:" to "except SymbianError:" just after the "import camera" line.
(Reply) (Parent) (Thread)