Active Topics

 


Reply
Thread Tools
Posts: 569 | Thanked: 462 times | Joined on Jul 2010 @ USA
#1
This sets up the N900 as an internet alarm clock radio, connecting to home Wi-Fi & starting PyRadio at a desired time.

It requires the applications Alarmed and PyRadio.
Thanks to Nicolai for indicating the command line solutions at
http://wiki.maemo.org/Phone_control#Networking

The basic setup is:
1. Determine the Internet Access Point ID of your home ID
2. Create a timed command in Alarmed to connect to Wi-Fi at that IAP_ID
3. Create a timed command in Alarmed to start PyRadio shortly after connecting to Wi-Fi
4. Create a standard alarm in Alarmed for 10 or 30 minutes later, in case Wi-Fi or Pandora is down, for safety

-- Details of procedure:-

1. Discover the ID for your home wi-fi in the saved connections:

1a. In XTerminal type
gconftool -R /system/osso/connectivity/IAP

1b. Look in the text which returns for the line
name = [name of your home wi-fi]

1c. look a couple of lines lower for the line
/system/ossoconnectivity/IAP/ [then a long string of characters]

1d. The long string of characters is the IAP_ID of your home Wi-Fi.

1e. Copy & paste may not work from XTerminal, so minimize it so that you may refer to it again for the IAP_ID in a later step

2. Create a timed command in Alarmed to connect to Wi-Fi at that IAP_ID:

2a. Open Alarmed, then New Event

2b. Change Event Type from "Alarm" to "Command Execution"

2c. Change interval from "Every Minute" to "Daily"

2d. Name it "Clockradio Wi-Fi connect" or something

2e. Change "Time" to 5 minutes *before* you want the radio to play

2f. Change "Enter Command" to
dbus-send --system --type=method_call --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:* uint32:0

(All on one line, note the spaces, substitute your IAP_ID for *)

2g. Save the Event.

3. Create a timed command in Alarmed to start PyRadio

3a. Open Alarmed, then New Event

3b. Change Event Type from "Alarm" to "Command Execution"

3c. Change interval from "Every Minute" to "Daily"

3d. Name it "Daily ClockRadio" or something

3e. Change "Time" to the time you want the radio to play

3f. Change "Enter Command" to
/opt/pyRadio/pyRadio.py

3g. Save the Event.

4. Create a standard alarm in Alarmed for 10 or 30 minutes later, in case Wi-Fi or Pandora is down, for safety

If no typos, etc., at the set times connection to wi-fi will be made, and pyRadio will start up, on your last Pandora station at whatever volume you have left it. X minutes later a regular alarm will go off, just in case.
 

The Following 3 Users Say Thank You to rotoflex For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#2
Loved the idea of having a radio alarm clock on my N900. I adapted the idea to make it easier and also install less applications.

It also works on multiple WiFi connections, if you leave your WiFi on auto-connect!

Instead of using PyRadio I used the alarmed app to start my favourite local (internet) radio site via the media player.

I did the following...

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to start the radio alarm
Select a name for the alarm 'Rock Radio Alarm'

I entered the following command:-

dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:http://streaming.gmgradio.com/rockradiomanchester.m3u > /dev/null

If you copy this correctly you can wake up to Rock Radio Manchester in the morning.

Alternatively replace:-

http://streaming.gmgradio.com/rockradiomanchester.m3u

...for another stations address.

Examples:-

BBC Radio 1
http://sradio.tv/stream/1827.m3u

Kerrang Radio
http://sradio.tv/stream/979.m3u

Planet Rock
http://sradio.tv/stream/1828.m3u

I would also recommend using the alarmed app to create a 'Alarm' 10-15 minutes after your radio starts, incase there is no internet connection available.
 

The Following 6 Users Say Thank You to sixwheeledbeast For This Useful Post:
Posts: 14 | Thanked: 5 times | Joined on Jun 2010
#3
Great work!
I was just wondering...is it possible doing all these wonderful things while the phone is off?
I mean, is it possible to create an event that triggers the phone to boot up and just then connects to wifi and later to the radio station?
 
Posts: 842 | Thanked: 1,197 times | Joined on May 2010
#4
I'd simply keep it in "offline" mode instead of fully off - it doesn't take much battery this way, and trying to enable wifi is going to be easier than waking the whole device.
__________________
My projects: BackupMenu - OS Backup & restore | Video: Flashing your n900(LiveCD)
My devices: N770 + 8GB SD card soldered internally, N900 with 8GB SD card + Custom OC(125-950 typically).
OC freqs: 0:22,90 125:22,90 250:28,180 500:30,360 550:32,400 600:34,430 700:39,430 750:41,430 805:45,430 850:47,500 900:50,500 950:54,500 1000:58,500 1100:67,520 1150:71,520
 
Posts: 436 | Thanked: 298 times | Joined on Jan 2010 @ England
#5
brilliant work sixwheeledbeast i have got the planet rock one working by copy/pasting the string but every time i try and replce the radio1 version in when it loads up i get a message stating playlist corrupted?

can anyone help by giving me the full string to copy/paste for radio1

cheers
__________________
SEE THE WIKI.MAEMO ALARMED PAGE AND FIND NEW, COOL COMMANDS AND IF YOU HAVE ANY COOL/AWESOME/USEFUL COMMANDS YOURSELF PLEASE ADD THEM. http://wiki.maemo.org/ALARMED_Commands_List
If you dont have a wiki.maemo account and cant be bothered to create one you can inbox me your commands and I will add them for you.
 
Posts: 569 | Thanked: 462 times | Joined on Jul 2010 @ USA
#6
 

The Following User Says Thank You to rotoflex For This Useful Post:
Posts: 436 | Thanked: 298 times | Joined on Jan 2010 @ England
#7
thanks rotoflex but im still having problems ... will try again when i get home and see how it works on my wifi
__________________
SEE THE WIKI.MAEMO ALARMED PAGE AND FIND NEW, COOL COMMANDS AND IF YOU HAVE ANY COOL/AWESOME/USEFUL COMMANDS YOURSELF PLEASE ADD THEM. http://wiki.maemo.org/ALARMED_Commands_List
If you dont have a wiki.maemo account and cant be bothered to create one you can inbox me your commands and I will add them for you.
 
Posts: 29 | Thanked: 1 time | Joined on Feb 2010 @ Germany
#8
i also use alarmed application, but i run a short script to slowly increase the volume up to 70 %

the comand in alarmed looks like:
sh /home/user/MyDocs/.documents/Internetradio.sh

you can edit the file to get another radio station.

thanks
Attached Files
File Type: zip Internetradio.zip (517 Bytes, 236 views)
 

The Following User Says Thank You to berlinermaxe For This Useful Post:
Posts: 436 | Thanked: 298 times | Joined on Jan 2010 @ England
#9
BRILLIANTllll

Thanks to the rotoflex for creating this really useful post with the extra info on radio1 links and thanks to ixwheeledbeast for coming up with a simple way to run it.

great work guys!!!
__________________
SEE THE WIKI.MAEMO ALARMED PAGE AND FIND NEW, COOL COMMANDS AND IF YOU HAVE ANY COOL/AWESOME/USEFUL COMMANDS YOURSELF PLEASE ADD THEM. http://wiki.maemo.org/ALARMED_Commands_List
If you dont have a wiki.maemo account and cant be bothered to create one you can inbox me your commands and I will add them for you.
 
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#10
Update on my internet radio alarm clock.
Bit long winded, hope this helps.

I have added a few extra command executions thanks to "berlinermaxe's" idea.

The following is all the commands to create an internet radio alarm clock that increases volume over time.
-

Firstly set the volume of the device to a nice level.
This ensures the radio will start at the correct volume every day.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Set the 'time' to one minute before the radio alarm is to start.
Select a name for the alarm 'Volume Set 55'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:55
-

Then we need to start the media player, as mentioned before "http://streaming.gmgradio.com/rockradiomanchester.m3u" can be replaced with your choice.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to start the radio alarm
Select a name for the alarm 'Radio Alarm'

Enter the following command:-

Code:
dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:http://streaming.gmgradio.com/rockradiomanchester.m3u > /dev/null
-

Then to increase the volume, so I have set this command 5 minutes after the radio start time.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to increase the volume
Select a name for the alarm 'Set Volume 65'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:65
-

Then to increase the volume again, so I have set this command 10 minutes after the radio start time.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to increase the volume again
Select a name for the alarm 'Set Volume 75'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:75
-

Okay so now the radio starts and slowly you are awakening.
I now have a command to stop the radio, a command to start the alarm clock and then a command to put the volume back to full.
This then means I don't have to manually change the volume and stop the radio playing.
So in the morning; I wake up, stop the alarm and then my clever little N900 puts the volume back so the volume is correct for my car kit.

So....

To stop the radio

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Select the 'time' to stop the radio.
Select a name for the alarm 'Radio Stop'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.stop
-

To start the alarm

In the Alarmed app Create a new event 'Alarm'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Select the 'time' start the alarm.

-

To put the volume to full again.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Select the 'time' to two minutes after the radio alarm will stop.
Select a name for the alarm 'Volume Set Full'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:100
All these commands can be tweaked to personal preference's e.g.... You could have the alarm start but without the stop command, the radio will then continue to play after you silence the alarm. Or leave the radio playing and not have the alarm at all.


Hope all this helps getting your N900 radio alarm clock working.

Last edited by sixwheeledbeast; 2012-02-21 at 20:40. Reason: Added code boxes.
 

The Following 4 Users Say Thank You to sixwheeledbeast For This Useful Post:
Reply

Thread Tools

 
Forum Jump


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