Update: added an english version at the end…
Problem ist das WakeOnLAN meines ArbeitsPC in der Uni. Es gibt ne schöne Website (danke noch mal Willi) um Rechner im Uni Netz zu starten. Meine Idee: starte PC kurz bevor ich in die Uni komme. ABER warum sollte ich zu Hause PC starten um die Website aufzurufen??? Eine Möglichkeit (ohne Rechner) auf dem Weg zur Uni wär genial!!!
Hier meine Lösung:
benutzt wird ne FritzBox 7170, VoIP Nummer, Handy mit Festnetz-Flat, USB-Stick, Software dtmfbox 0.5.0 (http://dtmfbox.v3v.de/)
dtmfbox ist ne Art Telefonsoftware die auf Anrufe reagiert (Anrufbeantworter, CallThru, etc…) und per Scripte bestimmte Aufgaben ausführen kann
dtmfbox kann in den RAM der FritzBox installiert werden, oder als Alternative auf einen USB Stick, der an der FBox steckt
Funktionsweise: per Handy die VoIP Nr anrufen, CallThru wird so configuriert, dass bei einer bestimmten Nr sofort der Anruf entgegengenommen wird, per DTMF Kommand das CallThru Menü verlassen, im übergeordneten Menü einen neuen Unterpunkt auswählen, dadurch Script ausführen, Script macht ein wget auf einen Website, die Website sendet bei spezieller URL ein WakeOnLAN Kommand ins interne Netz um Rechner zu booten
How-To (RAM Variante)
telnet auf die FBox:
telefon-tastencode: #96*7*
(PW ist selbe wie bei der Weboberfläche)
dtmfbox installieren:
cd /var
wget http://fritz.v3v.de/dtmfbox/dtmfbox-dl/0.5.0/rc.dtmfbox
chmod +x rc.dtmfbox
./rc.dtmfbox install ram
./rc.dtmfbox start_httpd
dtmfbox konfigurieren:
voip_stun=stun.1und1.de
capi_controller=
[acc1]
active=1
name={VoIP-Nr}
number={VoIP-Nr}
type=voip
voip_registrar=sip.1und1.de
voip_realm=1und1.de
voip_user={VoIP-Nr}
voip_pass={VoIP-PW}
voip_id={VoIP-Nr}@1und1.de
bearbeiten:
[menu:dtmf_commands]
say=DTMF Befehle.
1=script:wol("DesktopUni")
einfügen:
[script:wol]
cmd=/var/dtmfbox/script/wol.sh(/var/dtmfbox/script/wol.sh, "%$1%", "%src_id%", "%dst_id%")
DTMFBOX_ENABLED="1"
CALLTHROUGH1="{Handy-Nr}/1"
:%s/\n/ /g (sonst stützt das Webinterface nach dem Speichern ab)
http://fritz.box:6767/ im Browser aufrufen:
Basiseinstellungen
Speichern (damit die initiale Config der /var/flash/debug.cfg gemacht wird,
damit dtmfbox nach Neustart der FBox wieder hochfährt)
Scripteinstellungen
Speichern
Menu bearbeiten
Speichern
WOL Script in die debug.cfg aufnehmen:
das Script wol.sh könnte zum Beispiel so aussehen:
#!/var/tmp/sh
. /var/dtmfbox/script.cfg
myPC="$1"
SRC_ID="$2"
DES_ID="$3"
myTASK=""
#########################
## WOL: Uni ArbeitsPC
#########################
if [ "$myPC" = "DesktopUni" ];
then
wget http://{login}:{pw}@{website}/{mac-adresse} -O /dev/null -q
myTASK="done"
fi
#########################
## Anruf auflegen
#########################
if [ "$myTASK" = "done" ]; then
$DTMFBOX $DES_ID -hook down
$DTMFBOX $SRC_ID -hook down
fi
ersetzt man die newlines durch \n, tabs durch \t und “!” durch 41, so kann man das Script als eine echo-Zeile in der debug.cfg aufnehmen, das vorherige Beispiel würde ergeben (das & g t; am Ende soll ein “>” sein, dämliches WP):
echo -e '#41/var/tmp/sh\n. /var/dtmfbox/script.cfg\n \nmyPC="$1"\nSRC_ID="$2"\nDES_ID="$3"\nmyTASK=""\n \n#########################\n## WOL: Uni ArbeitsPC\n#########################\nif [ "$myPC" = "DesktopUni" ];\nthen\n\twget http://{login}:{pw}@{website}/{mac-adresse} -O /dev/null -q\n\tmyTASK="done"\nfi\n \n#########################\n## Anruf auflegen\n#########################\nif [ "$myTASK" = "done" ]; then\n\t$DTMFBOX $DES_ID -hook down\n\t$DTMFBOX $SRC_ID -hook down\nfi' > /var/dtmfbox/script/wol.sh
diese echo-Zeile muß vor der Zeile “cd $DTMFBOX_PATH/script” in der /var/flash/debug.cfg eingefügt werden
FBox neutarten
Anrufen von Handy: {VoIP-Nr}p*21
(p (= Wählpause) z.B. durch langes drücken der *-Taste)
telnet abschalten:
telefon-tastencode: #96*8*
Freuen und glücklich sein
English version:
Problem is the WakeOnLAN of my desktop at the university. There is a website (special thanks to Willi) to boot PCs which are connected to the network of our university. My idea was to boot the PC a short-time before I will enter the building. BUT why should I start my PC at home only to visite this website??? A solution (without a PC) would be great!!!
Here is my Solution:
you will need a FritzBox 7170 (or a similar typ), a VoIP number, a mobile phone (hopefully without costs to call the VoIP no.) , maybe USB drive, the Software dtmfbox 0.5.0 (http://dtmfbox.v3v.de/)
dtmfbox is a kind of telefonie software, which reacts to incomming calls (e.g., answerphone, call-through, …) and is able to execute scripts for special tasks
dtmfbox could be installed into the RAM of the FritzBox, or could be installed to a USB drive, which is connected to the FritzBox (called FBox in the following)
How this works: you dial the VoIP no. via the mobie phone; the call-through is configured, so that the incoming call will be answered immediately; a DTMF command quits the call-through menu; a new entry in the superior menu will be choosen, this starts a script; the script executes a wget command to the website; the website sends (if URL contains special parts) a WakeOnLAN command to the intranet to boot the PC
How-To (installed into the RAM)
starting telnet on the FBox:
keycode on a connected phone: #96*7*
(password is the same as the one for the webfrontend of the Fbox)
install the dtmfbox:
cd /var
wget http://fritz.v3v.de/dtmfbox/dtmfbox-dl/0.5.0/rc.dtmfbox
chmod +x rc.dtmfbox
./rc.dtmfbox install ram
./rc.dtmfbox start_httpd
configure the dtmfbox (the …1und1.de stuff is for my ISP):
voip_stun=stun.1und1.de
capi_controller=
[acc1]
active=1
name={VoIP no.}
number={VoIP no.}
type=voip
voip_registrar=sip.1und1.de
voip_realm=1und1.de
voip_user={VoIP no.}
voip_pass={VoIP password}
voip_id={VoIP no.}@1und1.de
edit:
[menu:dtmf_commands]
say=DTMF Befehle.
1=script:wol("DesktopUni")
insert:
[script:wol]
cmd=/var/dtmfbox/script/wol.sh(/var/dtmfbox/script/wol.sh, "%$1%", "%src_id%", "%dst_id%")
DTMFBOX_ENABLED="1"
CALLTHROUGH1="{number of the mobile phone}/1"
:%s/\n/ /g (otherwise the webinterface crashes after the saving)
start the webinterface of the DTMF: http://fritz.box:6767/ in the webbrowser:
Basic preferences
Save (this sets the initial configuration in /var/flash/debug.cfg,
otherwise the dtmfbox would not start after a reboot of the FBox)
Script preferences
Save
Configure the Menu
Save
insert WakeOnLan script in the debug.cfg:
an example the the script wol.sh:
#!/var/tmp/sh
. /var/dtmfbox/script.cfg
myPC="$1"
SRC_ID="$2"
DES_ID="$3"
myTASK=""
#########################
## WOL: university PC
#########################
if [ "$myPC" = "DesktopUni" ];
then
wget http://{login}:{pw}@{website}/{MAC address} -O /dev/null -q
myTASK="done"
fi
#########################
## disconnect the incoming call
#########################
if [ "$myTASK" = "done" ]; then
$DTMFBOX $DES_ID -hook down
$DTMFBOX $SRC_ID -hook down
fi
thru replacing the newlines with \n, tabulators with \t and “!” with 41 (see next line), one is able to insert the script with one echo-line into the debug.cfg; the previous example would look like this (please replace the & g t; in the end with a “>”, stupid formatting problems of wordpress
):
echo -e '#41/var/tmp/sh\n. /var/dtmfbox/script.cfg\n \nmyPC="$1"\nSRC_ID="$2"\nDES_ID="$3"\nmyTASK=""\n \n#########################\n## WOL: university PC\n#########################\nif [ "$myPC" = "DesktopUni" ];\nthen\n\twget http://{login}:{pw}@{website}/{MAC address} -O /dev/null -q\n\tmyTASK="done"\nfi\n \n#########################\n## disconnect the incoming call\n#########################\nif [ "$myTASK" = "done" ]; then\n\t$DTMFBOX $DES_ID -hook down\n\t$DTMFBOX $SRC_ID -hook down\nfi' > /var/dtmfbox/script/wol.sh
this echo-line has to be inserted before the line “cd $DTMFBOX_PATH/script” in the /var/flash/debug.cfg
restart FBox
make a call with the mobile phone: {VoIP no.}p*21
(p (= pause) e.g. thru long holding of the *-key on the mobile phone)
shut down telnet:
keycode: #96*8*
Update: added an english version at the end… Problem ist das WakeOnLAN meines ArbeitsPC in der Uni. Es gibt ne schöne Website (danke noch mal Willi) um Rechner im Uni...
Recent Comments