maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900) (https://talk.maemo.org/showthread.php?t=44576)

noobmonkey 2010-02-22 14:10

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by mackan1 (Post 541089)
0.4.2-3 still crashed for me. :(

did you try running it from x-term as described in a previous post? would be interested to see if it works :) or chucks out errors

mackan1 2010-02-22 14:12

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by noobmonkey (Post 541091)
just removed all of the cellular info functions (meh - worth a try)

Uploading to autobuilder in 2 mins...

if that doesnt work, the last think i can think off is when i save the front cam image - may need to rethink where i do that....


in what way do u mean "just removed all of the cellular info functions"
as in just uninstall it?

noobmonkey 2010-02-22 14:14

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by mackan1 (Post 541095)
in what would do u mean "just removed all of the cellular info functions"
as in just uninstall it?

Sorry - i just removed the ceullar functions from the code - to see if that will fix the bug :D

Trying to locate where it is crashing, so stripping out all code that could be doing it. I'm aware that it then has less functionality - but will re-build it back in :D

noobmonkey 2010-02-22 14:14

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
New version 0.4.2-4 is in the build queue - so should be about 10 mins

noobmonkey 2010-02-22 14:29

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Ok.... so not the dbus calls, and not the threading.
Still crashing.
Getting no errors or warnings now my end.

Changed the file save location to store the Front cam test image to \home\user\MyDocs\
New version -5 going into the auto builder!

noobmonkey 2010-02-22 14:40

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Ok well i'm now baffled.....
No errors my side, no threading, no dbus, and changed the image location...

what would cause it to just crash out? :(
v -5 doesnt work either :(

attila77 2010-02-22 15:05

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
This might sound confusing at first, but do you have object you're not the owner of ? I.e. a Qt object that you use from Python, but which is created/owned/destroyed by a native Qt object ? Most of the times I oops myself with PyQt is when an object implicitly gets destroyed behind the scenes and I call upon it not realizing it's gone. It would be great if you could strace the app (or get a traceback) to see where exactly is it crashing.

EDIT:
Quote:

Originally Posted by noobmonkey (Post 541010)
No one fancy testing it? - dont fancy removing all the dbus stuff and possibly gtk stuff - just confused as to why it runs ok with warnings locally, but must be erroring out from the utilities menu...
Tis odd :( (It does save a file during the run though - so it could be that erroring out?

Also, can you paste the .desktop file you're using ?

noobmonkey 2010-02-22 15:08

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
ooo strace - any quick hints on how to do that ? (Assuming a terminal call?)

will check the code when i get back to a big pc... more confused as it's running fine locally with no errors, so maybe a file or path error?

But not helpful with no bug reports/feedback

noobmonkey 2010-02-22 15:14

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
.desktop code as follows
[Desktop Entry]
Version=1.0.0
Encoding=UTF-8
Name=HealthCheck
Comment=N900 Health Check, test the front camera, GPS, battery and more
Exec=/opt/healthcheck/healthcheck.py
Icon=healthcheck
X-Icon-path=/usr/share/icons Path to the icon
X-Window-Icon=healthcheck
Type=Application
X-Osso-Service=com.nokia.healthcheck
X-Osso-Type=application/x-executable
StartupWMClass=HealthCheck

fatalsaint 2010-02-22 15:18

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
If the code you gave me earlier is what you are running..

Don't you need a:
#!/usr/bin/python

Or whatever the appropriate path is for python on the N900 at the beginning?

That could by why the desktop icon isn't working.

You want either:
Code:

Exec=python /opt/healthcheck/healthcheck.py
Or add the line above to the top of healthcheck.py.

noobmonkey 2010-02-22 15:29

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fatalsaint (Post 541195)
If the code you gave me earlier is what you are running..

Don't you need a:
#!/usr/bin/python

Or whatever the appropriate path is for python on the N900 at the beginning?

That could by why the desktop icon isn't working.

You want either:
Code:

Exec=python /opt/healthcheck/healthcheck.py
Or add the line above to the top of healthcheck.py.

Thanks Fatalsaint, again!

Got the (hashkey not working)! /usr/bin/env python
at the beginning

assuming the Exec=python /opt/healthcheck/healthcheck.py is for the .desktop file? (replace current line?)

(the icon loads, and it looks like the application loads, so not sure the error is there.)

fatalsaint 2010-02-22 15:32

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by noobmonkey (Post 541216)
Thanks Fatalsaint, again!

Got the (hashkey not working)! /usr/bin/env python
at the beginning

assuming the Exec=python /opt/healthcheck/healthcheck.py is for the .desktop file? (replace current line?)

(the icon loads, and it looks like the application loads, so not sure the error is there.)

Yes you can do one, or the other, or both..

Adding #!/usr/bin/env python to the top of healthcheck.py will allow you to either:
Code:

/opt/healthcheck/healthcheck.py
*or*
cd /opt/healthcheck/
./healthcheck.py

In a terminal.. Or use the Exec code you have right now. Not having that line in the file, requires you to pass it to python first with either:
Code:

python /opt/healthcheck/healthcheck.py
*or*
cd /opt/healthcheck
python healthcheck.py
*or*
Exec=python /opt/healthcheck/healthcheck.py

Etc....

noobmonkey 2010-02-22 16:05

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Ok, tried again with the exec python part - doesnt make a difference :(

So to confirm, .desktop has
Exec=python /opt/healthcheck/healthcheck.py

and the healthcheck.py file has #!/usr/bin/env python as it's first line.

The icon installs, it starts to run, and then just crashes out and dissapears....

qwerty12 2010-02-22 16:21

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by noobmonkey (Post 541287)
Ok, tried again with the exec python part - doesnt make a difference :(

With X-Osso-Service present in your desktop file, changing the Exec field there won't make a difference. Edit /usr/share/dbus-1/services/HealthCheck.service instead.

If the problem is that it crashes after some seconds when starting it from the menu (starting it from the terminal shouldn't cause it to crash) you need to initialize an osso.Context since you're using X-Osso-Service.

Try something like:
Code:

import osso
osso_c = osso.Context("healthcheck", "666", True)

If that fails, too, then you can try replacing the previous X-Osso-Type line with X-Osso-Type=application/x-python

If that also fails, comment out the X-Osso-Service line in your desktop file. Of course, only try all this if your program doesn't crash when started from the terminal.

noobmonkey 2010-02-22 16:27

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by qwerty12 (Post 541305)
With X-Osso-Service present in your desktop file, changing the Exec field there won't make a difference. Edit /usr/share/dbus-1/services/HealthCheck.service instead.

If the problem is that it crashes after some seconds when starting it from the menu (starting it from the terminal shouldn't cause it to crash) you need to initialize an osso.Context since you're using X-Osso-Service.

Try something like:
Code:

import osso
osso_c = osso.Context("healthcheck", "666", True)

If that fails, too, then you can try replacing the previous X-Osso-Type line with X-Osso-Type=application/x-python

If that also fails, comment out the X-Osso-Service line in your desktop file. Of course, only try all this if your program doesn't crash when started from the terminal.

I'm assuming the code is to go in my healthcheck.py file, and not the service file?
does run fine from terminal.

qwerty12 2010-02-22 16:30

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by noobmonkey (Post 541311)
I'm assuming the code is to go in my healthcheck.py file, and not the service file?
does run fine from terminal.

Yessssssir.

noobmonkey 2010-02-22 16:39

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Okey dokey, trying the osso stuff and will see how it goes :)

noobmonkey 2010-02-22 16:52

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Well
Quote:

import osso
osso_c = osso.Context("healthcheck", "666", True)
didn't work, will try the rest when i get home in 20 mins :D

noobmonkey 2010-02-22 17:17

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Just realised, not actually using python-osso.....

So removing traces of it from my code and the .desktop / build_app files....
Does that mean i can remove the lines
Quote:

X-Osso-Service=com.nokia.healthcheck
X-Osso-Type=application/x-executable
from the .desktop file too?

casper27 2010-02-22 17:29

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Just installed and same results as rest starts and then crashes just before launch. Getting there though Noob keep churning that code :)

noobmonkey 2010-02-22 17:30

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Cheers Casper - i'ma trying - have to admit, learnt how to upload to extras-dev pretty well today!!!

noobmonkey 2010-02-22 17:33

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Holy whohoooooooooooooooooooooo!!!!
Removed the osso stuff and it's working!!!

Qwerty - how many beers do i owe you now? :D

OK quick update - the code is the extremely slow cut down version! - will re-add everything and see where i get!!

edit - omfg.... that took a while!! ... and.......... relax!
edit * 2 - version in extras dev now is working 0.4.2-8

noobmonkey 2010-02-22 17:43

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Version 0.4.2-9 - Going through autobuilder now :D
Re-enabled threading and Dbus Calls as well as cell info

casper27 2010-02-22 17:49

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
I can confirm ver 0.4.2-8 is up and running. Loaded GPS Camera ect. Just looking through it now will report laters. Well done Noob.

noobmonkey 2010-02-22 17:53

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by casper27 (Post 541426)
I can confirm ver 0.4.2-8 is up and running. Loaded GPS Camera ect. Just looking through it now will report laters. Well done Noob.

Yay! and thankee, v9 is out - but for some reason my phone is still running 8... so figuring out why... Gonna uninstall and re-install and see what happens, if not i'll re-compile for v10.

aspidites 2010-02-22 17:55

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
noobmonkey, did you do an apt-get update first?

noobmonkey 2010-02-22 17:56

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by aspidites (Post 541435)
noobmonkey, did you do an apt-get update first?

hehe - was just a noob mistake :) - i re-installed 8 before 9 was ready :)
Just waiting for it to get through autobuilder :) - but 8 works - so big step forward!

noobmonkey 2010-02-22 17:59

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
ok 0.4.2-9 Works fine, everything re-enabled...
Does do a weird vanishing act for a second after running, but i have been beasting my poor n900 today!

Ready for an annouce i feel! :D

fred123 2010-02-22 18:11

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
1 Attachment(s)
Just installed, looks great.

I am not seeing front camera image should this be working now?

noobmonkey 2010-02-22 18:13

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fred123 (Post 541444)
Just installed, looks great.

I am not seeing front camera image should this be working now?


Point it near a bright lightbulb when you start or press update! (really bad camera quality!)
It also only collects 1 frame, so not sure of the aperture.

edit - thank you for the screeny! great to see it on someone elses device!!

noobmonkey 2010-02-22 18:19

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Have created an annouce thread! - so any bugs etc can go in there until i get a bugs account :D
But happy to keep this thread alive about the learning to code aspect etc :D

Announce Thread -
http://talk.maemo.org/showthread.php...457#post541457

casper27 2010-02-22 18:21

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
I can confirm the front camera does load but it is very very dark. everything else is working perfect so far.
Also confirm the disappearing just after launch but thats no biggy.

noobmonkey 2010-02-22 18:25

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
thanks casp, i think i can fix the front camera a bit by polling it for 50+ shots (only saves the last one), but i can't improve the quality unfortunately.
Will add the random reload to the bugs list.

Could you tell me roughly how many seconds it takes to load, and for an update please? (Button goes disabled then re-enabled when done)?

fred123 2010-02-22 18:31

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
I have tried pointing the camera directly at a light bulb, still no picture.

Tried runing gstreamer code directly in xterm,
get "sh: gst-launch: not found".

Something very strange here.

noobmonkey 2010-02-22 18:32

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fred123 (Post 541472)
I have tried pointing the camera directly at a light bulb, still no picture.

Tried runing gstreamer code directly in xterm,
get "sh: gst-launch: not found".

Something very strange here.

Oooo intruiiiging

it does need gstreamer, but thought all n900's had that?
might have found it's first fault?

edit - in x-term you could try

Quote:

gst-launch v4l2camsrc device=/dev/video1 num-buffers=100 ! dspjpegenc ! filesink location=/home/user/MyDocs/test.jpg
i set 100 buffers as that should make it a bit brighter, not much though.

casper27 2010-02-22 18:37

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Takes 8.3 secs to load rom cold and 4.4 secs for a reload. I have Gstreamer from the extras-decoders app.
At the time of loading I only have the app and browser open.

fred123 2010-02-22 18:38

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Apparently not

apt-get install gstreamer-tools is mentioned in this article

http://tomch.com/wp/?p=116

aspidites 2010-02-22 18:38

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Just a random thought:

If stackable windows are too complicated to implement right now, what about having each "tab" listed as an option in the app menu (that shows up when you click on the titlebar)?

noobmonkey 2010-02-22 18:40

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by fred123 (Post 541479)
Apparently not

apt-get install gstreamer-tools is mentioned in this article

http://tomch.com/wp/?p=116

hmmmm wonder if i can include this as an import to auto-download the tools on install?

noobmonkey 2010-02-22 18:52

Re: [Maemo 5] HealthCheck - Pymaemo/Qt - Learning to code (N900)
 
Quote:

Originally Posted by casper27 (Post 541478)
Takes 8.3 secs to load rom cold and 4.4 secs for a reload. I have Gstreamer from the extras-decoders app.
At the time of loading I only have the app and browser open.


hmmm does take a while doesn't it...
if i take out the GPS part it cuts it down to about 3 seconds.... - just takes a little bit of time to warm it up....


All times are GMT. The time now is 19:07.

vBulletin® Version 3.8.8