Reply
Thread Tools
Posts: 5 | Thanked: 1 time | Joined on Jan 2012
#1
Hi, first of all, i apologies for my english.

Like the title said, my optical sensor is dead. So the app for the camera is not responding.

I was looking around on the web and i found that the sensor triggers an event that change some value that indicates when the slide of the shutter is opened or closed. Then the camera app check this value before start to work.

If you open and close the shutter on the camera and then open the xterminal and run "dmesg", the last two lines should read something like

cam_shutter (GPIO 110) is now open
cam_shutter (GPIO 110) is now closed

That's indicate that the sensor is working, in my case that never happend. Obviously, if the slide is not opened the app doesn't work.

With this in mind, i think that is possible change the value of the variable that indicates when the slide is open (cam_shutter) directly form the x-terminal. So here is the question:

Any one knows some command to do this??

Last edited by Akira85; 2012-02-10 at 03:29.
 
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#2
Wow!!! Wow wow wow - This is exactly my problem! I swear I searched but didn't find your thread! Wow... My optical sensor did break yesterday too. Did your phone reboot or shut itself down?

If I manage to find some answer I'll contact you, also, please, contact me if you get it first.
http://talk.maemo.org/showthread.php?t=82268
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.
 
Posts: 85 | Thanked: 5 times | Joined on Nov 2009
#3
do you think this has anything to do with this topic? http://talk.maemo.org/showthread.php?t=67968
 
Posts: 5 | Thanked: 1 time | Joined on Jan 2012
#4
" cesarcesar:
do you think this has anything to do with this topic? http://talk.maemo.org/showthread.php?t=67968
"


Nop, that thread is about something diferent, but thx for the help .

----------------------------------------------------------------------------------

" Temporal:
Wow!!! Wow wow wow - This is exactly my problem! I swear I searched but didn't find your thread! Wow... My optical sensor did break yesterday too. Did your phone reboot or shut itself down?

If I manage to find some answer I'll contact you, also, please, contact me if you get it first.
http://talk.maemo.org/showthread.php?t=82268

"

Hi Temporal, I was reading your thread and effectively we have the same problem. My intencion too, is write some code to change the value of the variable that the trigger of the slide changes.

So far, the only thing i can do is get the status of the variable. I use this comand:

hal-get-property --udi /org/freedesktop/Hal/devices/platform_cam_shutter --key button.state.value

But i can't modify the value. I don't have much idea about D-Bus, but i think it have to be some comand that let you change that value.

I also wrote to Nokia to help me with this problem, but they don't want give me the comand. They just told me that they can't send me the comand.

If i get some command or code to do this i will send it to you. But so far, the only thing i can do is wait to some one answer me with the command.
 
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#5
Akira, this is what I got so far (this will let you use the camera - and flashlight if you use it):
Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool false
Unfortunately this will make the camera button unusable to shortcutd, so you'll have to use

Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool true
to restore functions.

There's more details on my thread. I believe the easier way is to fake a dbus signal.
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.
 
Posts: 5 | Thanked: 1 time | Joined on Jan 2012
#6
Originally Posted by Temporal View Post
Akira, this is what I got so far (this will let you use the camera - and flashlight if you use it):
Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool false
Unfortunately this will make the camera button unusable to shortcutd, so you'll have to use

Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool true
to restore functions.

There's more details on my thread. I believe the easier way is to fake a dbus signal.
------------------------------------------------------------------
Thx man, that's a useful way to cheat the system hahaha..... but i think too that it's has to be a better way to do it.

I tried to use your code but is not working. When i wrote in the x-terminal:


Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool false
And then open the camera app, still the app tells me that the lens cover is closed. So i try to get the state of the varibale to see if something changed. I used this line:


Code:
hal-get-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value
And this was the result:


Code:
Error: libhal_device_get_property_type: org.freedesktop.Hal.NoSuchProperty: No property button_state_value on device with /org/freedesktop/hal/devices/platform_cam_shutter
Then i tried the same comand but with sudo and nothing, i mean, nothing changed and no error message either.

So, after 20 minutes seeing the screen like a crazy person, i figure out, that before i was using the same comand but with a little diference. Instead of "button_state_value" i use "button.state.value". So if i write:


Code:
hal-get-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button.state.value
This returns "True". But when i use the same line with sudo dosen't give me any result. I mean, dosen't tells me the state of the variable.

In resume, i tried to use your code like this:


Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button.state.value --bool false
But again nothing happened, the app of the camera still tells me that the lens cover is closed. And i check the state of the variable and still is "True", so i guess is not changing it.
I was thinking, that maybe is something that i have installed. So, i unistalled some programs like Bless (http://blessn900.com/) and others that i tried to use with the camera. But i keep one of those, the Fcamera app, that let me use the camera, at least for take pictures. This app also tells me that the cover is closed but even with that the app let me take pictures. Do you think that this app is doing something that is blocking the code?
 
Posts: 5 | Thanked: 1 time | Joined on Jan 2012
#7
Temporal,

I finally made that the code work. So the app of the camera is now working. I can take pictures, film, flash...in resume i got all back .

I discovered that the reason for that the code didn't work, is that i never had root privileges. I know i know...this is a noob discover, but i was using "sudo", so I thought that just with that was enough. But no, its seems that the N900 never let you have root privileges by default. If you try :

sudo root

The x-terminal will ask you for the password, so you wrote the password and then you think "Oh great i'm a root now", but noooo!. If you write "whoami" you will see that you still are just an user. So i google to find some answers, and there is another way to acces as a root:

sudo gainroot

But again you will be fuc..ed by the system. You will get this message "Enable RD mode if you want to break your device". Again i google it and there is some ways to anable the RD, but for what i read is better not to do it. Then i found an app that let you get the root priveleges, is called Rootsh (http://maemo.org/downloads/product/Maemo5/rootsh/). So, now that i finally am root, i use this command :

Code:
hal-set-property --udi /org/freedesktop/Hal/devices/platform_cam_shutter --key button.state.value --bool false
The two little diferences, with the one that you pass me, is that the "h" of /hal" need to be capitalized..."/Hal", and the other thing that already told you, is that the --key don't work with "_" instead of that you have to use "button.state.value". Dunno why, i google it, but i never found nothing about it.

You probably already know all this, but i post it for all the others noob like me that have troubles trying to make this code work...I hope this information will be useful for somebody.

Besides of all that, you told me that you have troubles with the code, because this changes in value of the state button, make that the shortcut of the button didnt open the app of the camera. In my case the shortcut of the button is working. When i press the button, while i am in the desktop or in somewhere, this take me directly to de app of the camera. Maybe, we have diferent version of Maemo, i'm using :

Maemo 5 version: 21.2011.38-1.

Or maybe, it's some app that i have installed, but im not sure about this. But if you want to try, the only app that i have, that can make some diferent with respect to the camera functionality is Fcamera (http://fcam.garage.maemo.org/fcamera.html).
 

The Following User Says Thank You to Akira85 For This Useful Post:
Reply


 
Forum Jump


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