You Are Here:

Community: Developer Discussion Boards

#1 Old E66 accelerometer sensor programming - 2008-10-24, 14:10

Join Date: Oct 2008
Posts: 2
atimb
Offline
Registered User
Hello there,

I'm really committed to create some fancy application with the accelerometer sensor, it has great potential, but I faced problems.

The possibilities:
J2ME: I wanted to use this, but unfortunately no JSR-256 support in Nokia devices.

PyS60: Seems very friendly, but "import sensor" fails with ("Module not found _sensor")

SiS: I do not want it this way, unless otherwise it's not possible. (Although I didn't find any sensor example for E66 either)

I googled all my yesterday about this topic, but most of the forum topics were 1 year old, and only were about N95 and 5500.

But as you can see in the title, I have E66, and I don't even know if there's any chance I could handle that sensor. The resources on the net are really limited to N95 unfortunately... I've tried N95 examples on my phone, but all without success.

So my final question is: Is it possible to overcome that PyS60 "Module not found _sensor" error in E66, and is PyS60 meant to handle the E66's accel sensor at all? If it doesn't even meant to, how could I do this in SiS?

For reference:
I installed "PythonForS60_1_4_4_3rdEd.sis" and "PythonScriptShell_1_4_4_3rdEd.SIS" from sourceforge without any other modification (signing, etc..)

Thank you in advance,
Attila Incze
Reply With Quote

#2 Old Re: E66 accelerometer sensor programming - 2008-10-24, 15:26

Join Date: Mar 2007
Posts: 103
Location: Brazil
cabezonxdg
Offline
Regular Contributor
Check this:

http://discussion.forum.nokia.com/fo...d.php?p=457775


Wiki Contributor of the Month (May).
Winner of the May Contest on Wiki.
Reply With Quote

#3 Old Re: E66 accelerometer sensor programming - 2008-10-24, 18:05

Join Date: Oct 2008
Posts: 2
atimb
Offline
Registered User
Thank you, although I've already found that thread, and if I wanted to start an API partnering request: "The page you have requested is made viewable for Forum Nokia PRO member companies only."

Why sensor API isn't public? I'm afraid I'll never get my hands on this, as I'm just a "simple person", not "Forum Nokia PRO member companies" ...
Reply With Quote

#4 Old Re: E66 accelerometer sensor programming - 2008-10-26, 12:53

Join Date: Oct 2008
Posts: 5
programciyim
Offline
Registered User
http://wiki.forum.nokia.com/index.ph...nsor_Framework
i found this.And end of the page example works fine in e66.
Reply With Quote

#5 Old Re: E66 accelerometer sensor programming - 2009-04-28, 09:44

Join Date: Mar 2009
Posts: 4
theresa_nick
Offline
Registered User
Hi!

I want to use acceleromter data from my N85 in a python programm, but get the same error as atimb when trying to start a little sample code.

I installed 'PythonForS60_1_4_5_3rdEd' and singed version of 'PythonScriptShell_1_4_5_3rdEd_unsigned_testrange'

Do I need to install anything else on the phone to get connection to the sensor???

Here is my code:
Code:
import sensor
import e32
import time

class DemoApp:
    def __init__(self):
        self.accelerometer = AccelerometerXYZAxisData(data_filter=LowPassFilter())
        self.accelerometer.set_callback(data_callback=self.my_callback)
        self.counter = 0

    def my_callback(self):
        if self.counter % 5 == 0:
            print  "X:%s, Y:%s, Z:%s" % (self.accelerometer.x,
                                 self.accelerometer.y, self.accelerometer.z)
        self.counter = self.counter + 1

    def run(self):
        self.accelerometer.start_listening()


d = DemoApp()
d.run()
e32.ao_sleep(1)
d.accelerometer.stop_listening()
print "Exiting Accelorometer"
I would really appreciate any kind of help!
Reply With Quote

#6 Old Re: E66 accelerometer sensor programming - 2009-04-28, 10:42

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Please check if this works in your phone:
http://jouni.miettunen.googlepages.com/sensorsample

Cheers,

--jouni
Reply With Quote

#7 Old Re: E66 accelerometer sensor programming - 2009-04-28, 11:30

Join Date: Mar 2009
Posts: 4
theresa_nick
Offline
Registered User
Hi!

I can start the programm, but nothing happens. I thought this programm only works on FP1 devices, but N85 is FP2.
Reply With Quote

#8 Old Re: E66 accelerometer sensor programming - 2009-04-28, 12:10

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
Quote:
Originally Posted by theresa_nick View Post
Hi!

I can start the programm, but nothing happens. I thought this programm only works on FP1 devices, but N85 is FP2.

hello theresa_nick

AFAIK if you want to use the sensor module in FP2 device you need PyS60 1.9.2 or later.

Sensor Module will not work for FP2 devices in PyS60 1.4.5

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#9 Old Re: E66 accelerometer sensor programming - 2009-04-28, 14:25

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by theresa_nick View Post
I thought this programm only works on FP1 devices, but N85 is FP2.
Ups,

Sommy missed that! E66 is FP1, but N85 is really FP2! FP2 contains the new Sensor Framework, which is supported only by PyS60 1.9.x branch. I'll write myself a note to make an updated sample... PyS60 1.9.3 is pretty stable, so it shouldn't be any problem.

http://wiki.forum.nokia.com/index.php/Nokia_Sensor_APIs

Cheers,

--jouni
Reply With Quote

#10 Old Unhappy Re: E66 accelerometer sensor programming - 2009-04-28, 15:37

Join Date: Mar 2009
Posts: 4
theresa_nick
Offline
Registered User
Thanks a lot for your support.

I changed to 'Python_1.9.3_3rdEd_unsigned_high' and 'PythonScriptShell_1.9.3_unsigned_high'(which I open signed for my phone), but still get an ImportError that 'No module named _sensor' can be found
Reply With Quote

#11 Old Smile Re: E66 accelerometer sensor programming - 2009-04-28, 16:27

Join Date: Mar 2009
Posts: 4
theresa_nick
Offline
Registered User
Ok, I changed to version 1.9.2 and now it just works
Code:
from sensor import *
import e32
import time

class DemoApp():

    def __init__(self):
        self.accelerometer = AccelerometerXYZAxisData(data_filter=LowPassFilter())
        self.accelerometer.set_callback(data_callback=self.my_callback)
        self.counter = 0

    def my_callback(self):
        # For stream sensor data the callback is hit 35 times per sec(On
        # 5800). The device cannot handle resource hungry operations like 
        # print in the callback function for such high frequencies. A 
        # workaround is to sample the data as demonstrated below.
        if self.counter % 5 == 0:
            print  "X:%s, Y:%s, Z:%s" % (self.accelerometer.x, self.accelerometer.y, self.accelerometer.z)
        self.counter = self.counter + 1

    def run(self):
        self.accelerometer.start_listening()

if __name__ == '__main__':
    d = DemoApp()
    d.run()
    e32.ao_sleep(1)
    d.accelerometer.stop_listening()
    print "Exiting Accelorometer"
Really strange...
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
E66 Accelerometer Question? ranrinc General Discussion 9 2009-07-15 18:44
N95 Accelerometer & JSR-256 AnthonyAndrews Mobile Java General 9 2009-04-21 23:12
Accelerometer mikedeklerk General Symbian C++ 32 2008-04-29 16:10
Finding accelerometer update frequency phishboh Python 1 2008-02-19 16:49

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia