Active Topics

 


Reply
Thread Tools
Posts: 2 | Thanked: 0 times | Joined on Dec 2009
#111
Originally Posted by Bratag View Post
This will open up an xterm, run the script and then close the xterm. It checks to see if the transmitter is on and will turn it off if it is. I used a standard system icon for the icon in the desktop file. All you need to now is put it as a shortcut on your desktop and its one tap on and off.
If i use your Solution i get an xterm where i have to type in a Password.

So i just replaced the Exec-Line to "Exec= /usr/bin/sudo /usr/local/bin/boostfm.sh"

The only problem is that it starts a window with nothing in it and just the name BoostFM. If i switch to the Desktop it is gone and worked.
Don't know how to fix this problem.

greetings
Christopher
 
Posts: 2,014 | Thanked: 1,581 times | Joined on Sep 2009
#112
Originally Posted by cbock View Post
If i use your Solution i get an xterm where i have to type in a Password.

So i just replaced the Exec-Line to "Exec= /usr/bin/sudo /usr/local/bin/boostfm.sh"

The only problem is that it starts a window with nothing in it and just the name BoostFM. If i switch to the Desktop it is gone and worked.
Don't know how to fix this problem.

greetings
Christopher
You didnt add the line to your suduoers file as shown in step II. You have to have that line otherwise you will get prompted
__________________
Class .. : Power Poster, Potential Coder
Humor .. : [*********] Alignment: Chaotic Evil
Patience : [***-------] Weapon(s): +2 Logic Mace
Agro ... : |*****-----] Relic(s) : G1, N900

 
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#113
Something broke!

I followed the instructions and everything went well... icon is present and when pushed window opens and closes. Tested it on the radio and it rocks!

I came back in to write this post and went to terminal to see what level it reports and couldn't gain root.

xTerm reports:

sudoers file: syntax error, line 75 <<<
sudo: parse error in etc/sudoers near line 75


Now Applications Manager reports "operation failed" and shows no catalogues installed.
Media player does not show any songs and will not close.

I would hate to reflash. Is there anything I can try?


Originally Posted by Bratag View Post
Messed around with the scripts a little and came up with some stuff that doesn't require any outside apps etc to work.

Edit a file called /opt/bin/boostfm.sh
Code:
!/bin/sh
STATE=`fmtx_client | grep state | cut -d '=' -f2`
if [ "disabled" = ${STATE} ]
then
   echo "Turning on FM transmitter"
   fmtx_client -p1
else
   echo "Turning off FM transmitter"
   fmtx_client -p0
fi
/bin/echo 118 > /sys/class/i2c-adapter/i2c-2/2-0063/power_level
exit 0
Now add the following to /etc/sudoers

Code:
user ALL = NOPASSWD: /opt/bin/boostfm.sh
Now create a file called BoostFM.desktop in /usr/share/applications/hildon which contains

Code:
[Desktop Entry]
Version=0.1
Type=Application
Name=BoostFM
Exec=osso-xterm 'sudo /opt/bin/boostfm.sh'
Icon=general_fm_transmitter
X-Windows-Icon=
X-HildonDesk-ShowInToolbar=false
X-Osso-Type=application/x-executable
This will open up an xterm, run the script and then close the xterm. It checks to see if the transmitter is on and will turn it off if it is. I used a standard system icon for the icon in the desktop file. All you need to now is put it as a shortcut on your desktop and its one tap on and off.
__________________

SLN member # 009
 
fnordianslip's Avatar
Posts: 670 | Thanked: 359 times | Joined on May 2007
#114
You could try ssh as root locally on the N900 or from something else, and fixing the /etc/sudoers file, assuming you have the ssh server running.
__________________
Class .. : Lame hacker & beardy boffin
Humour . : [#######---] Alignment: Apathetic anarchist
Patience : [####------] Weapon(s): My cat, my code.
Agro ... : |#---------] Relic(s) : N900, MacBookPro, NSLU2, N800, SheevaPlug, Eee-901, Core2-Quad, PS3
"In theory, theory and practice are the same. In practice, they're not."
--
Beware of extras-devel.
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#115
Originally Posted by YoDude View Post
Something broke!

I followed the instructions and everything went well... icon is present and when pushed window opens and closes. Tested it about:blankon the radio and it rocks!

I came back in to write this post and went to terminal to see what level it reports and couldn't gain root.

xTerm reports:

sudoers file: syntax error, line 75 <<<
sudo: parse error in etc/sudoers near line 75


Now Applications Manager reports "operation failed" and shows no catalogues installed.
Media player does not show any songs and will not close.

I would hate to reflash. Is there anything I can try?
If you have rootsh installed (not the extras-devel version), run "rootsh /bin/sh" and you can remove the offending line from sudoers.

For future reference: Use visudo instead of editing sudoers directly. visudo tells you if a line will **** up the entire sudo system when exiting the editor.
 

The Following 7 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 152 | Thanked: 41 times | Joined on Dec 2009 @ Sydney
#116
Originally Posted by qwerty12 View Post

For future reference: Use visudo instead of editing sudoers directly. visudo tells you if a line will **** up the entire sudo system when exiting the editor.

EXACTLY!!
I was going to write that as I was reading through the last few [new] pages as alot of people are suggesting editing the file directly.

But now someone has made a good example of themselves for the benefit of the community.
Thanks YoDude
 
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#117
Originally Posted by DaveQB View Post
EXACTLY!!
I was going to write that as I was reading through the last few [new] pages as alot of people are suggesting editing the file directly.

But now someone has made a good example of themselves for the benefit of the community.
Thanks YoDude
Yeah... I'm not sure what example was made
__________________

SLN member # 009
 
Posts: 2,014 | Thanked: 1,581 times | Joined on Sep 2009
#118
I suspect people cut and paste the line and ended up with a blank line in their sudoers file. Sorry but the code tags seem to add a blank line wether I want it or not.

Agree with visudo comment. I actually used that myself guess I should have specified that. This is why I suck at writing docs
__________________
Class .. : Power Poster, Potential Coder
Humor .. : [*********] Alignment: Chaotic Evil
Patience : [***-------] Weapon(s): +2 Logic Mace
Agro ... : |*****-----] Relic(s) : G1, N900

 
YoDude's Avatar
Posts: 2,869 | Thanked: 1,784 times | Joined on Feb 2007 @ Po' Bo'. PA
#119
Originally Posted by Bratag View Post
I suspect people cut and paste the line and ended up with a blank line in their sudoers file. Sorry but the code tags seem to add a blank line wether I want it or not.

Agree with visudo comment. I actually used that myself guess I should have specified that. This is why I suck at writing docs
The extra line was exactly what happened... NP, after all...

I finally learned this:




I also learned that I made quite a few changes since I backed up last...

..and, if you package this up in a deb they will write songs about you.

It works and it adds so much value to the N900. The FM transmitter will now act as most expect it to and not the way it was shipped. Cheers.

As a bonus, if my Chinook & Diablo re-flashing history is a guide, this means a new firmware image will be available within the next two or three days

Kind of like washing your car will make it rain.
__________________

SLN member # 009

Last edited by YoDude; 2010-01-05 at 02:44.
 
Posts: 474 | Thanked: 283 times | Joined on Oct 2009 @ Oxford, UK
#120
Originally Posted by shadowjk View Post
1187.5bps is, what, over 100 chars per second? so you could change the 8char field over 10 times per second? Sounds plenty fast to me.
The RDS signal carries more than just those 8 characters, so no.

But it might be fast enough to show "RINGING" when there's an incoming call and "YOUR MOM" when it's someone special :-)
 

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


 
Forum Jump


All times are GMT. The time now is 23:11.