maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 Radio Transmitter: ways to amplify the radio signal (https://talk.maemo.org/showthread.php?t=38582)

cbock 2010-01-04 21:00

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by Bratag (Post 452651)
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

Bratag 2010-01-04 21:44

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by cbock (Post 453090)
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

YoDude 2010-01-04 23:05

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
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. :eek:

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. :eek::eek:

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


Quote:

Originally Posted by Bratag (Post 452651)
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.


fnordianslip 2010-01-04 23:08

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
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.

qwerty12 2010-01-04 23:10

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by YoDude (Post 453237)
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. :eek:

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. :eek::eek:

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.

DaveQB 2010-01-04 23:16

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by qwerty12 (Post 453247)

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 2010-01-04 23:38

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by DaveQB (Post 453256)
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 :rolleyes:

Bratag 2010-01-04 23:52

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
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

YoDude 2010-01-05 00:36

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by Bratag (Post 453301)
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:


:D

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 :rolleyes:

Kind of like washing your car will make it rain. :D

jjx 2010-01-05 04:00

Re: N900 Radio Transmitter: ways to amplify the radio signal
 
Quote:

Originally Posted by shadowjk (Post 452650)
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 :-)


All times are GMT. The time now is 02:08.

vBulletin® Version 3.8.8