#36633 - 15/08/2001 11:32
Alarm clock
|
member
Registered: 29/08/2000
Posts: 153
Loc: Berkshire, UK
|
Quite a few people over the months have asked about using their Empeg as an alarm, but I don't recall seeing anything posted that does this. Well, just for the practise (my Empeg being my first real contact with Linux!), I've written a script to do just that. It's a little kludgy, but it works.
It uses Rex Perkin's "Picker" program to allow you to set the alarm time, and the "date" command (which I extracted from the Debian ARM distro) to get the current time.
I've attached a zip file containing all the files needed and a ReadMe with instructions.
Since I don't really know what I'm doing, I'm just happy that I have something that works - if you have a better solution, or realise that I've done something very stupid, please let me know!
I'm away on business for the next couple of days, so I probably won't be able to respond to any comments until Monday - just so no one thinks I'm ignoring them! And I'd like to add a "thank you" to those who've written stuff before, giving me the confidence (and the beginnings of knowledge) to have a go at this, including but not limited to Tony, Rex, Frank, Borislav, and so on...
Cheers,
Bryan.
Mark 2 #080000515
Was 12GB Blue, now 42GB Green!
Attachments
35758-alarmclock.zip (30 downloads)
_________________________
Bryan.
|
Top
|
|
|
|
#36634 - 16/08/2001 17:30
Re: Alarm clock
[Re: BryanR]
|
addict
Registered: 30/04/2000
Posts: 420
Loc: Sunnyvale, CA, USA
|
Good stuff, Bryan! I'm on vacation for the next two weeks (and without my empeg, *sniff*sniff*) but I'll check it out when I come back.
Borislav
|
Top
|
|
|
|
#36635 - 17/08/2001 09:18
Re: Alarm clock
[Re: BryanR]
|
enthusiast
Registered: 16/02/2001
Posts: 373
Loc: Switzerland
|
Hello Bryan,
I did try to install the Alarm clock. But I got the following error if I choose the Alarm
The third option was chosen.
/drive0/var/alarmclock: date: command not found
But date is in this directory drive0/var and i did also the set the right permission!
-rwxr-xr-x 1 0 0 16743 Aug 15 16:40 disp
any ideas?
bye
CrazyMelki
|
Top
|
|
|
|
#36636 - 17/08/2001 11:08
Re: Alarm clock
[Re: crazymelki]
|
member
Registered: 29/08/2000
Posts: 153
Loc: Berkshire, UK
|
Not immediately, but I'll have a look at it when I get some time - maybe Sunday afternoon if I'm back home by then, otherwise it'll probably be Tuesday, I'm afraid. I'm stuck working offsite again on Monday, so I won't be able to waste time at work on it... (don't tell the boss!)
I have just realised that I missed out a file from the zip, though. Again, I won't be able to post it until I've got some free time either at home or work.
Sorry 'bout this - wasn't expecting to be quite this busy!
Bryan.
Mark 2 #080000515
Was 12GB Blue, now 42GB Green!
_________________________
Bryan.
|
Top
|
|
|
|
#36637 - 18/08/2001 07:58
Re: Alarm clock
[Re: BryanR]
|
enthusiast
Registered: 16/02/2001
Posts: 373
Loc: Switzerland
|
Hello Bryan,
I found this bug! I did add to your alarmclock script the path for the date file as following:
on the line 56:
ClockTime=`/drive0/var/date +%H:%M`
Now this is working fine...but got the next error:
The third option was chosen.
sed: Couldn't open file dc.sed: No such file or directory
/drive0/var/alarmclock: [: -lt: unary operator expected
/drive0/var/alarmclock: [: : integer expression expected
sed is installed in the /bin directory. But I really don't know about programming (only logical thinking).
bye
CrazyMelki
|
Top
|
|
|
|
#36638 - 21/08/2001 02:00
Re: Alarm clock
[Re: crazymelki]
|
member
Registered: 29/08/2000
Posts: 153
Loc: Berkshire, UK
|
Yes, that was the file I'd missed out. Attached to this post is an updated zip, which has been amended to contain this file, and I've corrected the path on the call to "date" that you spotted.
Bryan.
Mark 2 #080000515
Was 12GB Blue, now 42GB Green!
Attachments
36013-alarmclock.zip (23 downloads)
_________________________
Bryan.
|
Top
|
|
|
|
#36639 - 21/08/2001 11:30
Re: Alarm clock
[Re: BryanR]
|
enthusiast
Registered: 16/02/2001
Posts: 373
Loc: Switzerland
|
Hello Bryan,
Now it's working. But I did again some changes in your alarmclock file. The script was looking for the dc.sed in the root directory. You can have a look on my attachment. I changed to /drive0/var/dc.sed!
wow...soon I will be also a programmer !
Suggestion: Can we not let the time blinking after setting the alarm. It looks very nervous....
And maybe it's also possible to show with the curren time the current alarm time!
cool....
bye CrazyMelki
Attachments
36045-alarmclock.zip (28 downloads)
|
Top
|
|
|
|
#36640 - 21/08/2001 12:20
Re: Alarm clock
[Re: crazymelki]
|
enthusiast
Registered: 16/02/2001
Posts: 373
Loc: Switzerland
|
Hello Bryan,
It's again me:
I found already a way to display the clock, alarm time and the date!
I start in my init the timed application before I start the pick_list:
/bin/timed &
while [ 1 ] ; do
/drive0/var/pick_list
Then I changed the on Alarmclock (Line139) from $ClockTime to $AlarmTime.
mabye there is a possiblity to dimmer this screen?
bye CrazyMelki
|
Top
|
|
|
|
#36641 - 22/08/2001 02:06
Re: Alarm clock
[Re: crazymelki]
|
member
Registered: 29/08/2000
Posts: 153
Loc: Berkshire, UK
|
Glad you got it working!
That's a good way of displaying the clock, if you use the timed application. I also played with displaying the clock time on the screen in the same echo to disp: each line is 16 chars long, so you can pad the string out, inserting where appropriate the text (or variable) you want displayed.
My only concern was that of burn-in on the display. I don't know how good an idea it would be to have a pretty static display on for hours at a time. I suppose the player (when not showning a visual, anyway) does have a mainly fixed display, so maybe it's not much of an issue.
As for dimming it... not sure. I'm too much of a newbie at all this Linux game to be able to think of something off the top of my head - it may not even be possible from a script. I'll have a fiddle and see what I can find.
One thing I have found (told you I was a newbie) is how to avoid that dc.sed script - when I get a chance I'll amend the alarmclock script to avoid using it. I did think it was overkill, but it did the job, which was my main aim, and the Linux book on my desk didn't have any solutions for me! Got hold of a better one now, though!
Cheers,
Bryan.
Mark 2 #080000515
Was 12GB Blue, now 42GB Green!
_________________________
Bryan.
|
Top
|
|
|
|
#36642 - 22/08/2001 11:01
Re: Alarm clock
[Re: BryanR]
|
enthusiast
Registered: 16/02/2001
Posts: 373
Loc: Switzerland
|
Hello Bryan,
As you know, I am really not a developer! It was only a suggestion...
But maybye there is somebody else in the forum who can help you!
But If you have any news, let me know!
Bye
CrazyMelki
|
Top
|
|
|
|
#36643 - 22/08/2001 16:23
Re: Alarm clock
[Re: BryanR]
|
addict
Registered: 24/08/2000
Posts: 658
Loc: India
|
I tried this thing & seemed to install all OK (I have loaded VolAdj thing before but it's not on there now). I have one question, how do you get to it to or see it? I get no menu at bootup nor can I find anything like it when running.
I have very limited Linux skills but can follow directions pretty good as long as the slang or lingo doesn't get too thick. What am I doing wrong?
Does this only work for a certain Version? I run 1.03 dev.
#695 empeg-car Mk2/Green/Amber/Neon Red/Clear/Smoke-12Gig needs tuner,2.x, VR
"No buyers regret"
|
Top
|
|
|
|
#36644 - 23/08/2001 01:57
Re: Alarm clock
[Re: jwickis]
|
member
Registered: 29/08/2000
Posts: 153
Loc: Berkshire, UK
|
Well... I've also got 1.03 dev installed, so that's probably not it.
What should be happening is that the init script runs the pick_list script, which then either starts alarmclock or continues on to run the player. If you're not seeing the picker options after boot, then I'd guess that one of these is happening:
1) Your init script isn't calling pick_list
2) The init script can't find pick_list
3) Picker can't be started.
I'd make sure that the init script (in /sbin/) is okay - from hyperterm you can display it on screen using
cat /sbin/init
If that's okay, check that the pick_list and picker files are in /drive0/var, and that all files have execute permissions set - you can view these using:
ls -l [file]
One thing I have found is that if you're sending a file to your Empeg that's already on it, you need to remove it first. I don't know if that would have anything to do with it, but it's something that's caught me out quite a few times!
If you still can't see any problems, drop me an email on the address in my profile, and I'll have at look through the problem with you in more detail.
Cheers,
Bryan.
Mark 2 #080000515
Was 12GB Blue, now 42GB Green!
_________________________
Bryan.
|
Top
|
|
|
|
#36645 - 23/08/2001 20:12
Re: Alarm clock
[Re: BryanR]
|
addict
Registered: 24/08/2000
Posts: 658
Loc: India
|
In reply to:
One thing I have found is that if you're sending a file to your Empeg that's already on it, you need to remove it first.
I think that's it like I said I have had Lovejoy's VolAdj picker on it & some of the regular files are still on there & I was skeptical as to whether they were being over written or not the dates were not current.
Now to find out the command to delete files in Linux.
Thanks for the direction. #695 empeg-car Mk2/Green/Amber/Neon Red/Clear/Smoke-12Gig needs tuner,2.x, VR
"No buyers regret"
|
Top
|
|
|
|
#36646 - 23/08/2001 20:17
Re: Alarm clock
[Re: jwickis]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
Now to find out the command to delete files in Linux.
rm
___________
Tony Fabris
|
Top
|
|
|
|
#36647 - 23/08/2001 20:35
Re: Alarm clock
[Re: tfabris]
|
addict
Registered: 24/08/2000
Posts: 658
Loc: India
|
Talk of quick thanks much.
#695 empeg-car Mk2/Green/Amber/Neon Red/Clear/Smoke-12Gig needs tuner,2.x, VR
"No buyers regret"
|
Top
|
|
|
|
#36649 - 23/08/2001 20:52
Re: Alarm clock
[Re: tfabris]
|
addict
Registered: 24/08/2000
Posts: 658
Loc: India
|
In reply to:
Ha, that was slow. Took me five minutes. I seem to recall I've done two minutes before.
OK try this one, how do you get rid of a file 'read only file' to get permission to delete it?
#695 empeg-car Mk2/Green/Amber/Neon Red/Clear/Smoke-12Gig needs tuner,2.x, VR
"No buyers regret"
|
Top
|
|
|
|
#36650 - 23/08/2001 21:00
Re: Alarm clock
[Re: jwickis]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
The file system is mounted read-only by default. You have to do:
rw
rwm
to mount the drives read-write.
Important: When you're done doing the work, don't forget to do
ro
rom
before rebooting or restarting the player. If you forget to do this, you'll have certain errors such as constantly being prompted to fsck the disk. ___________
Tony Fabris
|
Top
|
|
|
|
#36651 - 24/08/2001 03:23
Re: Alarm clock
[Re: tfabris]
|
old hand
Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
|
Unless Sven's guide is wrong, then you don't need both rom and ro .
That is to say, rom and ro are not exact opposites of rwm and rw .
--
Toby Speight
_________________________
Toby Speight 030103016 (80GB Mk2a, blue) 030102806 (0GB Mk2a, blue)
|
Top
|
|
|
|
#36652 - 24/08/2001 03:23
Re: Alarm clock
[Re: tfabris]
|
old hand
Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
|
Hi Tony.
The "ro" command automatically does a "rom", too. So you only need to invoke "ro" to remount any partition read-only (well, only /, /drive0 and /drive1 to be exact).
cu,
sven
proud MkII owner (12GB blue/green/smoked, was #080000113 is #090001010)
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord
|
Top
|
|
|
|
#36653 - 24/08/2001 03:24
Re: Alarm clock
[Re: tms13]
|
old hand
Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
|
Damn, you beat me by just a few seconds.
cu,
sven
proud MkII owner (12GB blue/green/smoked, was #080000113 is #090001010)
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord
|
Top
|
|
|
|
#36654 - 24/08/2001 07:40
Re: Alarm clock
[Re: tfabris]
|
addict
Registered: 24/08/2000
Posts: 658
Loc: India
|
You have to do:
rw
rwm
DOH, I thought I was in it that way but apparently not.
Well it works now thanks don't know what I'll actually do with it but it's cool I can play around and learn a little thanks to you guys.
#695 empeg-car Mk2/Green/Amber/Neon Red/Clear/Smoke-12Gig needs tuner,2.x, VR
"No buyers regret"
|
Top
|
|
|
|
#36655 - 24/08/2001 09:47
Re: Alarm clock
[Re: jwickis]
|
member
Registered: 29/08/2000
Posts: 153
Loc: Berkshire, UK
|
I must admit that I don't imagine I'll use it much myself - it was more of a learning exercise in scripting!
Today I installed Linux on my PC at work, and I've downloaded the toolchain from Brian Mihulka's site, so I'll see if I can brush off my C skills and re-write it as an executable..!
Bryan.
Mark 2 #080000515
Was 12GB Blue, now 42GB Green!
_________________________
Bryan.
|
Top
|
|
|
|
|
|