12 March 2011

Wake up alarm on Linux.


--- Ubuntu 9.10

I wanted to put the computer on standby when I go bed and wake up with music in the morning.

I read about plugins for xmms, amarok, python scripts, and bash scripts.

Some people were using the node  .../.../wakealarm to set up the computer wake up time.


The best solution I found is to use rtcwake and alarm-clock. The first to resume the computer from standby. The second to run anything you want whenever you want.

Examples:                   
                   
# sudo rtcwake --verbose --mode standby --time `date +%s --date "2011-01-11 07:30"`
# sudo rtcwake --verbose --mode standby --time `date +%s --date "tomorrow  07:30"`

The  rtcwake command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

Then use alarm-clock program to run the task you want.

That worked fine in Ubuntu, but not on my Debian computer.



--- Debian

Since the rtcwake didn't work well on my Debian, I had to find another solution.

I also found out that better than having two tasks to wake up at different times was to leave the music playing when I put the computer to sleep. When it wakes up the music would simply continue.

So this is the process (line) to make the computer wake up (as root):

## ensure that the permissions are correct; clean up anything previous ; insert wake up time; go to sleep;
# chmod 666 /sys/class/rtc/rtc0/wakealarm ;  echo 0 > /sys/class/rtc/rtc0/wakealarm;   echo `date -d "tomorrow 6:56" +%s` > /sys/class/rtc/rtc0/wakealarm ; pm-suspend


I find (up arrow key) and enter it when I go bed, and in the morning, since I have the screen off, I just do the same process again (up + Enter) when leaving home. I just use the music for some minutes.


I also did an script to raise the volume and then set it to medium-high, but at the end I just set up the volume before running the line and forget about the script.

In any case, here it is:

==============================
#!/bin/bash

# ------- Tasks -----------------------------------
# start playing music
kaffeine --play /your/play/list &

# set and increase volume repeatedly
SLEEPX="4";
for i in $(seq 40 85); do echo $i; VV="$i%"; aumix -v $VV -l $VV -p $VV -w $VV -W $VV; sleep $SLEEPX ; done;

# change volume to something normal
sleep 10; VV="75%"; aumix -v $VV -l $VV -p $VV -w $VV -W $VV
==============================


Hope it helps to anyone looking to have less devices on the room, while saving energy/noise and having a pleasant wake up.

06 March 2011

Upgrading Netopia wireless router: Issues and results.

For the shake of sharing, I put this up in the blog.

========================

I had (from the webpage of the router)
Router Name:     Netopia
Model 3347NWG
Software Version: 7.4.2r2

I went to http://www.netopia.com/support/hardware/ looking for my model and I found things like 3347NWG-VGx  and 3347NWG-006.

I asked netopia support via chat about the ending word of my model and they told me to look under the modem, that is, take the modem on your hands and look at the stick at the bottom. I had 3347NWG-EIR

Here http://192.168.0.254/indexExptRES.htm?uploadtRES.htm I got the upgrade to 7.5 (the upgrade page from the router)

Then with http://www.boards.ie/vbulletin/showthread.php?p=62888974 I got this http://www.netopia.com/support/hardware/firmware/7_series/nta780r7.bin link to the version 7.8.0r7

But the router didn't show yet any bridge functionality, which was my only reason to upgrade.


Summary:

Upgraded from 7.4.2r2 to 7.5. Then from 7.5 to 7.8.0r7. I don't know if something got better, but I know that this device would not work as wireless bridge no matter the supported firmware you put on it.

Too Cool for Internet Explorer