Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#29582 - 17/04/2001 09:53 Alarming idea
thinfourth2
Pooh-Bah

Registered: 13/04/2001
Posts: 1742
Loc: The land of the pale blue peop...
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


_________________________
P.Allison fixer of big engines Mk2+Mk2a signed by God / Hacked by the Lord Aberdeen Scotland

Top
#29583 - 17/04/2001 10:05 Re: Alarming idea [Re: thinfourth2]
SE_Sport_Driver
carpal tunnel

Registered: 05/01/2001
Posts: 4903
Loc: Detroit, MI USA
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
_________________________
Brad B.

Top
#29584 - 17/04/2001 10:32 Re: Alarming idea [Re: SE_Sport_Driver]
thinfourth2
Pooh-Bah

Registered: 13/04/2001
Posts: 1742
Loc: The land of the pale blue peop...
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


_________________________
P.Allison fixer of big engines Mk2+Mk2a signed by God / Hacked by the Lord Aberdeen Scotland

Top
#29585 - 17/04/2001 11:18 Re: Alarming idea [Re: thinfourth2]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
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
_________________________
Frank van Gestel

Top
#29586 - 17/04/2001 11:28 Re: Alarming idea [Re: fvgestel]
thinfourth2
Pooh-Bah

Registered: 13/04/2001
Posts: 1742
Loc: The land of the pale blue peop...
excellent many thanks frank you might even be able to teach me how to you display server next

_________________________
P.Allison fixer of big engines Mk2+Mk2a signed by God / Hacked by the Lord Aberdeen Scotland

Top
#29587 - 17/04/2001 14:30 Re: Alarming idea [Re: thinfourth2]
schofiel
carpal tunnel

Registered: 25/06/1999
Posts: 2993
Loc: Wareham, Dorset, UK
Run the player as a CRON process?

One of the few remaining Mk1 owners... #00015
_________________________
One of the few remaining Mk1 owners... #00015

Top
#29588 - 17/04/2001 15:15 Re: Alarming idea [Re: fvgestel]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
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
_________________________
Frank van Gestel

Top
#29589 - 17/04/2001 16:05 Re: Alarming idea [Re: fvgestel]
thinfourth2
Pooh-Bah

Registered: 13/04/2001
Posts: 1742
Loc: The land of the pale blue peop...
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

_________________________
P.Allison fixer of big engines Mk2+Mk2a signed by God / Hacked by the Lord Aberdeen Scotland

Top
#29590 - 17/04/2001 16:12 Re: Alarming idea [Re: fvgestel]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
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.

_________________________
Frank van Gestel

Top
#29591 - 17/04/2001 20:45 Re: Alarming idea [Re: fvgestel]
Ezekiel
pooh-bah

Registered: 25/08/2000
Posts: 2413
Loc: NH USA
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...
_________________________
WWFSMD?

Top
#29592 - 18/04/2001 07:16 Re: Alarming idea [Re: fvgestel]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
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
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#29593 - 18/04/2001 08:05 Re: Alarming idea [Re: bonzi]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
You are right, this should be core functionality. It was just fun writing some nifty shell-script...

Frank van Gestel
_________________________
Frank van Gestel

Top
#29594 - 18/04/2001 08:11 Re: Alarming idea [Re: bonzi]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands

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
_________________________
Frank van Gestel

Top