Alarming idea

Posted by: thinfourth2

Alarming idea - 17/04/2001 09:53

Okay folks i have a question for those out there that actually know how a empeg works.

I want the empeg to start up and start playing music in the morning so i have a cool alarm clock.

For this task i have a laptop with a serial port running win98se a pair of speakers and a mk2 running 1.02.

i have managed to get the developer version of the software onto the empeg and managed to get it to switch on and off through hyerterminal. Now what i want to know is how do i get it to work as an alarm clock.

Even better is there any software out there that will let me do it without the laptop.

many thanks the bloke with the stand

Ps i know not very much about computers so be gentle


Posted by: SE_Sport_Driver

Re: Alarming idea - 17/04/2001 10:05

The player automatically starts playing on power-up (as long as that is what it was doing when it lost power), so why not just get a timer for the power supply? (I know it is not QUITE as glamorous).

32GB (JUST UPGRADED!) Mk. II BLUE
Detroit, MI USA
www.PfeifferBeer.com
Posted by: thinfourth2

Re: Alarming idea - 17/04/2001 10:32

very good idea just not as much fun as 7 million cables and a few hundred lines of code.

But has the adventage of actually working


Posted by: fvgestel

Re: Alarming idea - 17/04/2001 11:18

I can remember writing a shell-script which acted like a cron daemon.
Cron daemon is a unix program that can schedule tasks in the future and at regular intervals.
I'll see if I can find that stuff... must be over 5 years old, but very useful on the empeg, no need to install debian packages

Frank van Gestel
Posted by: thinfourth2

Re: Alarming idea - 17/04/2001 11:28

excellent many thanks frank you might even be able to teach me how to you display server next

Posted by: schofiel

Re: Alarming idea - 17/04/2001 14:30

Run the player as a CRON process?

One of the few remaining Mk1 owners... #00015
Posted by: fvgestel

Re: Alarming idea - 17/04/2001 15:15

Couldn't find it, but doesnt matter; it was using the date command which isn't installed on the developer image.
So I thought hey, let's try something for the shell.
I came whith the following script which will wait till the alarm time has been reached before exiting.
This can be used in the init script like this :


#!/bin/bash

mount -n -o remount,ro /
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
[ -e /proc/ide/hd[bc] ] && mount -n -o nocheck,ro /dev/hdc1 /drive1

ALARM="06:00"

while :
do
/empeg/bin/player
while [ "$TIME" != "$ALARM" ]
do
TIME=`export PS1=\\\\t;export TMOUT=59;bash -i < /dev/ttyS0 2>&1 >/dev/null`
TIME=`echo $TIME`
TIME=${TIME##* }
TIME=${TIME%:*}
done
done


After selecting the quit command in the player's menu, it will keep waiting until the alarm time has expired. after that it will startup the player app again.

Frank van Gestel
Posted by: thinfourth2

Re: Alarming idea - 17/04/2001 16:05

okay march of the stupid here

i gather that i type this in with hyperterminal after connecting to the player and quiting out of the software with q

any chance of a total idiot guide for me

bearing in mind i fix very big diesel engine for a job and know very little about the guts of empeg

Posted by: fvgestel

Re: Alarming idea - 17/04/2001 16:12

Oops, I forgot to take it easy...
the main idea of init scripts is to replace the normal startup-sequence. Like autoexec.bat.
to replace the original init script with another :
copy the script from my reply to a file on the PC using copy and paste and name it init.txt
NOTE : the line with "#!/bin/bash" must be the first line and it must be aligned to the left.
connect hyperterm and stop the player app
now type the following command in hyperterm :

# rw
# cd /sbin
# mv init init.empeg

use "send file" from the hyperterminal-menu (not "send text file") to send the init.txt file to the empeg
the prompt should return after sending

# cat init.txt | sed 's/.$//' > init
# chmod +x init
# ro

Pull plug and reboot
After reboot it should work as desired. If it doesn't, you can always reinstall the consumer or developer image to get the deault init back.



Frank van Gestel

Edited by fvgestel on 18/04/01 12:54 AM.

Posted by: Ezekiel

Re: Alarming idea - 17/04/2001 20:45

Says the dog jumping about the heels of the master:

"Just be sure you've set the clock via Emplode first."

-Zeke

Frank, you continue to amaze.

just say you weren't paying much attention...
Posted by: bonzi

Re: Alarming idea - 18/04/2001 07:16

the main idea of init scripts is to replace the normal startup-sequence. Like autoexec.bat. to replace the original init script with another...

I feel somehow safer if I leave original init alone, and hack /etc/profile (for novices, a script the shell executes on its initialization) instead.

Anyway, whichever variant we use, we need somebody to write a script to enter desired delay (perhaps using menu program by Rex or something similar: we could start with a reasonable default (say 6 hours), then use up and down arrows to increase/decrease hours, and likewise left and right for minutes). Even better, perhaps those who know about IR handling will be able to come up with direct entry from remote?

Nice excercise, but I think guys@empeg should really put sleep/alarm/snooze functions into player itself (of course, with a choice of abrupt or gradual switching off/on, separate playlists for both and other bells, whistles and flashing lights ).

Cheers!

Dragi "Bonzi" Raos
Zagreb, Croatia
Q#5196, MkII#80000376, 18GB green
Posted by: fvgestel

Re: Alarming idea - 18/04/2001 08:05

You are right, this should be core functionality. It was just fun writing some nifty shell-script...

Frank van Gestel
Posted by: fvgestel

Re: Alarming idea - 18/04/2001 08:11


Anyway, whichever variant we use, we need somebody to write a script to enter desired delay (perhaps using menu program by Rex or something similar: we could start with a reasonable default (say 6 hours), then use up and down arrows to increase/decrease hours, and likewise left and right for minutes). Even better, perhaps those who know about IR handling will be able to come up with direct entry from remote?


Any C-coders can pickup my blitmenu source and extend it in this way... It will take too much resources from me at this time to dive into the display/button/IR-stuff again and I want displayserver 2.0 to get to a stable form.

Frank van Gestel