# [Q]Writing to /sys/class possible?



## razz1 (Oct 11, 2011)

Rooted GS3 and unlocked.

All permissions are set to 0777 that I wish to write to but the settings I change within the file instantly revert back to there default settings. Whether I change the setting directly with root explorer or with a script, the setting will not hold.
So...
echo 1 >/sys/class/lcd/panel/gamma_mode
Doesn't change the default setting of 3 in gamma_mode.
Something is changing it back. Is it the kernel? Or am I just missing a step before I can change it?
Any help is greatly appreciated. No one seems to have an answer for it so far.
Thanks guys!


----------



## JBirdVegas (Jun 11, 2011)

Are you running the command as root?


----------



## yarly (Jun 22, 2011)

JBirdVegas said:


> Are you running the command as root?


Probably not.


----------



## razz1 (Oct 11, 2011)

yarly said:


> Probably not.


Yes. Running as root and does absolutely no thing. Whether it's gamma_mode. Contrast, or anything under /sys/class/panel/lcd.


----------



## JBirdVegas (Jun 11, 2011)

You provided a relative path to supply an absolute path you must start the path with '/'

Try again:

```
<br />
su<br />
echo 1 > /sys/class/lcd/panel/gamma_mode<br />
cat /sys/class/lcd/panel/gamma_mode<br />
```


----------



## razz1 (Oct 11, 2011)

JBirdVegas said:


> You provided a relative path to supply an absolute path you must start the path with '/'
> 
> Try again:
> 
> ...












Ok so do you guys see anything wrong with this cause it's still not workin for me. After the final line I hit enter and then a "2" is returned. What is this "2"? The gamma_mode default is 2 so is that what this means? Nonetheless, nothing changed. Any idea?


----------



## yarly (Jun 22, 2011)

Yes that should work or try quotes around the 1. Also, why not just try editing it in a text editor like vi, vim or nano? It'll complain at least in vim if it can't save it saying it's read only. Probably will for nano.


----------



## razz1 (Oct 11, 2011)

Thanks yarly! I do believe this is read only. Any way to change it to write or are these class settings here to just as a reference to the system? I will try vim but I'm fairly sure its read only. I believe the nexus settings for gamma and contrast are changed in class but just won't work here.


----------



## yarly (Jun 22, 2011)

razz1 said:


> Thanks yarly! I do believe this is read only. Any way to change it to write or are these class settings here to just as a reference to the system? I will try vim but I'm fairly sure its read only. I believe the nexus settings for gamma and contrast are changed in class but just won't work here.


change the permissions or list them here if you're unsure.


----------



## razz1 (Oct 11, 2011)

System is set to write and all files from /sys to /gamma_mode are set for all to write. I changed them with root explorer. Still, no luck. These class files are somehow being changed back as soon as they are set. Just don't get it. I never had a problem changing settings in files before. Whether it was through a script or directly with root explorer but these class files are a pain! Just don't get it. I wish I could just give my phone to you for 5min so you could see with your own eyes lol. Something else has this area locked down. 
So far...
All permissions set to write.
All scripts were properly written and executed.
Tried directly with root explorer.

Pain in the butt!


----------



## JBirdVegas (Jun 11, 2011)

Use chmod instead ie

chmod 777 /path/to/file


----------



## JBirdVegas (Jun 11, 2011)

Err 755


----------



## razz1 (Oct 11, 2011)

Insane! Tried the chmod and still won't change.


----------



## razz1 (Oct 11, 2011)

Well it looks like gamma_mode must be set to a value of "0" before it can be changed to something other than the default of "2". Now I can set it to "1" but not back to "2" until a reboot.
Strange?? Odd???
Nonetheless, thank you guys sooo much for all your time and thought!
I really appreciated you guys sticking with me instead of turning your heads!


----------



## JBirdVegas (Jun 11, 2011)

Glad you got it but that is very weird indeed.


----------



## razz1 (Oct 11, 2011)

JBirdVegas said:


> Glad you got it but that is very weird indeed.


Yea. Playing around with it a bit more, when you set it to 0 it doesn't even change the actual gamma. It simply gives me the capability to set it to 1 which does change actual gamma to 2.4. Default is 2.0 at the setting of default 2. However once you have set to 0, there is no going back to setting of 2. Only 1. At that point, brightness is then locked out and can no longer be adjusted. The only way out is a reboot lol. There are also brightness and contrast settings in there and can't adjust any of those. I think overall, this area of the system is useless and best left to a custom kernel. Darn!


----------

