OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Linux Applications => Topic started by: ClintReese on October 28, 2004, 07:06:25 pm

Title: Beep from Terminal using Default ROM?
Post by: ClintReese on October 28, 2004, 07:06:25 pm
The question:
Can anyone think of a way to make the Zaurus _beep_ from a Python program running in the terminal on the standard Sharp Rom? (Zaurus 5600.  Default Sharp ROM.  Standard Sharp terminal application.)

Why:
I've been using the old 'Riverbank' distribution of Python on the Z to write and execute programs on it for a few months now.  Now, I'm writing a program which I want to do one simple thing: Beep to alert the user of a change.  An ear-piece headphone + beep + zaurus = ability for the Z to alert the user tactfully of the Python program's output.

What I've tried so far:

1. I tried 'tput bel' on the Z's terminal, because it works on my Linux desktop, but the Z says there is no 'tput' command.  I looked in the /bin , /sbin , /usr/bin , and usr/sbin to verify that.

2. I tried to use the Python 'curses' module.  The one which I installed on the Z from RiverBank doesn't have the curses module.  So much for curses.beep() on the current platform.

3. I can't think of a way to use the ( #include <curses.h> ) strategy from a C program because I still haven't figured out a way to put C programs on the standard Sharp ROM.  That's why I'm using Python.

4. By the way, ZGCC doesn't seem to work with the default Sharp ROM.  Am I wrong about this?

5. I looked for a .ipk for the curses module on Python.  I can't seem to find one that doesn't already require an installation of ZGCC.

6. Riverbank seems to say that they don't support the distribution of Python which I'm using, or any other distribution of Python for the Z anymore, so I can't get such a curses module from them, apparently.
http://www.riverbankcomputing.co.uk/zaurus/index.php (http://www.riverbankcomputing.co.uk/zaurus/index.php)
The link which they gave also seems to require zgcc
http://www.vanille.de/projects/python.spy (http://www.vanille.de/projects/python.spy)

More questions:
Am I overlooking something?  Could I just get the Z to beep through some other clever stategy?  It beeps when a key is hit.  I wonder if I could get it to beep by overloading it somehow.  Could I somehow play a sound file from the terminal with a command? Messy, but I'm almost desperate.  Am I stuck?  Should I finally give in and try to make the switch to Open Zaurus?  Yet another delay.

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on October 28, 2004, 07:14:46 pm
Quote
The link which they gave also seems to require zgcc
http://www.vanille.de/projects/python.spy (http://www.vanille.de/projects/python.spy)
Or not!  I just realized that the link does have a link to some .ipk files, one of which does seem to be some sort of a curses module!  Sorry that I may have overlooked this.  If it doesn't work, I may be back to whine some more.

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on October 31, 2004, 08:42:08 am
Quote
Quote
The link which they gave also seems to require zgcc
http://www.vanille.de/projects/python.spy (http://www.vanille.de/projects/python.spy)
Or not!  I just realized that the link does have a link to some .ipk files, one of which does seem to be some sort of a curses module!  Sorry that I may have overlooked this.  If it doesn't work, I may be back to whine some more.

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
It didn't work.  The default Sharp ROM doesn't even seem to recognize that file as one which it can install.  Time to try Open Zaurus, I guess.

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
Title: Beep from Terminal using Default ROM?
Post by: radioz on October 31, 2004, 09:39:45 am
Which Python are you using?

Have you tried the python.cramfs? I haven't had a chance to play with it much, but it seems pretty complete.

Here is the link I used: http://zaurus.xavierxeon.de/zaurus.php?gro...el&topic=python (http://zaurus.xavierxeon.de/zaurus.php?group=devel&topic=python)

radioz
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on October 31, 2004, 10:38:17 am
Quote
Which Python are you using?

Have you tried the python.cramfs? I haven't had a chance to play with it much, but it seems pretty complete.

Here is the link I used: http://zaurus.xavierxeon.de/zaurus.php?gro...el&topic=python (http://zaurus.xavierxeon.de/zaurus.php?group=devel&topic=python)

radioz
Thanks for the link!  I intend to try this.  I'm using an old Riverbank port of Python which they don't support anymore.  This should be a welcome change.  Thanks again!

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 01, 2004, 01:13:13 pm
Quote
Which Python are you using?

Have you tried the python.cramfs? I haven't had a chance to play with it much, but it seems pretty complete.

Here is the link I used: http://zaurus.xavierxeon.de/zaurus.php?gro...el&topic=python (http://zaurus.xavierxeon.de/zaurus.php?group=devel&topic=python)

radioz
It didn't work for curses.

It does seem to make a good replacement for the unsupported old Riverbanks veriosn, though, so thanks anyway.

I can import sys and import time, but when I try to import curses I get an error something like the following in my little test program, curses1.py:

File "curses1.py", line 8, ini ?
    import curses
File "/home/devel/python/lib/python2.3/curses/__init__.py", line 15, in ?
    from curses import *
ImportError: libncurses.so.5: cannot load shared object file: No such file or directory

I think that I may have seen something on this site about libncurses.  I think I will do a search on it.  If python can't load the shared object file, mayb gcc can't either?


Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 01, 2004, 01:55:00 pm
OK. Pursuing another strategy.

voicerec recording01.wav

It is very messy and slow, but all I need to do for now is learn how to execute a command from within a Python program. I think.

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 01, 2004, 02:10:45 pm
arg! os.system() should work, but now voicerec doesn't play the recording sent to it as an argument as a default!

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: jfv on November 01, 2004, 09:43:38 pm
If you have installed kismet it also installs a little program called buzzme (in /usr/bin ?)  which will make a little noise. You can make a system call to use it from your python script. Try buzzme -t from the command line.

Felipe
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 02, 2004, 10:32:59 am
Quote
If you have installed kismet it also installs a little program called buzzme (in /usr/bin ?)  which will make a little noise. You can make a system call to use it from your python script. Try buzzme -t from the command line.

Felipe
Thanks! I intend to try to install kismet soon.  This should work!

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 03, 2004, 09:17:18 pm
Quote
Quote
If you have installed kismet it also installs a little program called buzzme (in /usr/bin ?)  which will make a little noise. You can make a system call to use it from your python script. Try buzzme -t from the command line.

Felipe
Thanks! I intend to try to install kismet soon.  This should work!

Clint Reese
Hmmm.  Looks as if Kismet is also intended for open zaurus?  Oh well.  If I can get OZ installed properly, Kizmet may help me to get around some programming anyway.  Thanks.

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: jfv on November 03, 2004, 10:29:52 pm
I am using the Sharp ROM and kismet is fine with it. If you don't want to bother installing kismet, just take apart the ipk (cp file.ipk file.tar.gz; tar xzvf file.tar.gz) and you get a bunch of files, maybe in some subdirectories, one of which is buzzme. Just move it to /usr/bin/ , make it executable and you are good to go.

Felipe
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 03, 2004, 10:47:16 pm
Quote
I am using the Sharp ROM and kismet is fine with it. If you don't want to bother installing kismet, just take apart the ipk (cp file.ipk file.tar.gz; tar xzvf file.tar.gz) and you get a bunch of files, maybe in some subdirectories, one of which is buzzme. Just move it to /usr/bin/ , make it executable and you are good to go.

Felipe
Thanks!  I intend to try to learn how to install kismet on the default ROM.

Thanks again!

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 04, 2004, 05:23:31 pm
Quote
Quote
Which Python are you using?

Have you tried the python.cramfs? I haven't had a chance to play with it much, but it seems pretty complete.

Here is the link I used: http://zaurus.xavierxeon.de/zaurus.php?gro...el&topic=python (http://zaurus.xavierxeon.de/zaurus.php?group=devel&topic=python)

radioz
It didn't work for curses.

It does seem to make a good replacement for the unsupported old Riverbanks veriosn, though, so thanks anyway.

I can import sys and import time, but when I try to import curses I get an error something like the following in my little test program, curses1.py:

File "curses1.py", line 8, ini ?
    import curses
File "/home/devel/python/lib/python2.3/curses/__init__.py", line 15, in ?
    from curses import *
ImportError: libncurses.so.5: cannot load shared object file: No such file or directory

I think that I may have seen something on this site about libncurses.  I think I will do a search on it.  If python can't load the shared object file, mayb gcc can't either?


Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176 (http://books.lulu.com/content/70176)
Aha! When trying to learn how to instal Kismet on the Zaurus, I learned that it also seems to be dependendent on the libncurses5 thing about which Python was complaining!

http://www.irongeek.com/i.php?submenu=zaur.../wardrivingapps (http://www.irongeek.com/i.php?submenu=zaurus/zaurusheader&page=zaurus/wardrivingapps)

Maybe I just need to instal libncurses5 properly, and maybe the Python curses import will work and the beep will work?  I've also looked at what seems to be the source code for 'buzzme,' and it seems to be dependent on a library called 'sys/ioctl.h' for its beeping capabilities.

So, if I can just find out about libncurses5 and get it working, it should have some libraries which I can use to make this thing beep...

Thanks again for your time if you've made it this far.

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: jfv on November 04, 2004, 06:15:02 pm
If I understand correctly, libncurses provides this hybrid console GUI, which you may not need. For kismet you can install kismetQt, or whatever it's called, which provides a proper GUI for it. As far as buzzme is concerned you should just need to put the binary in your path and it will buzz for you, you shouldn't need any libraries. If you are having trouble finding the binary I'll mirror it for you here (http://www.ma.utexas.edu/users/voloch/Exe/buzzme). Please let me know if it works.

Felipe
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 04, 2004, 07:11:28 pm
Quote
If I understand correctly, libncurses provides this hybrid console GUI, which you may not need. For kismet you can install kismetQt, or whatever it's called, which provides a proper GUI for it. As far as buzzme is concerned you should just need to put the binary in your path and it will buzz for you, you shouldn't need any libraries. If you are having trouble finding the binary I'll mirror it for you here (http://www.ma.utexas.edu/users/voloch/Exe/buzzme). Please let me know if it works.

Felipe
It didn't work. I copied it to the zaurus, did a
chmod 777 buzzme
and executed it by specifying the full path name.  No response except another command prompt.  No errors either.

Thanks, but it doesn't seem to be working.

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 04, 2004, 07:14:04 pm
Quote
Quote
If I understand correctly, libncurses provides this hybrid console GUI, which you may not need. For kismet you can install kismetQt, or whatever it's called, which provides a proper GUI for it. As far as buzzme is concerned you should just need to put the binary in your path and it will buzz for you, you shouldn't need any libraries. If you are having trouble finding the binary I'll mirror it for you here (http://www.ma.utexas.edu/users/voloch/Exe/buzzme). Please let me know if it works.

Felipe
It didn't work. I copied it to the zaurus, did a
chmod 777 buzzme
and executed it by specifying the full path name.  No response except another command prompt.  No errors either.

Thanks, but it doesn't seem to be working.

Clint Reese
Oops! Duh!  I need to add it to my path and then make the command line call which you specified earlier... Hehehe.... Next time I need to think before I post.

Thanks again.  Off to try again.

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 04, 2004, 07:16:55 pm
Quote
If I understand correctly, libncurses provides this hybrid console GUI, which you may not need. For kismet you can install kismetQt, or whatever it's called, which provides a proper GUI for it. As far as buzzme is concerned you should just need to put the binary in your path and it will buzz for you, you shouldn't need any libraries. If you are having trouble finding the binary I'll mirror it for you here (http://www.ma.utexas.edu/users/voloch/Exe/buzzme). Please let me know if it works.

Felipe
Hurray!!! It works!  It works!  It works!  It's alive!! It's alive!!!

Thank you, thank you, thank you.  

Is there any way that I can repay you? (within reason

Clint Reese
Title: Beep from Terminal using Default ROM?
Post by: ClintReese on November 04, 2004, 07:27:46 pm
Hurray!  It works!  Thanks again, jfv and radioz!  Let me know if there is something within reason that I can do for you.

Final solution:

1. Use the buzzme binary and the python cramfs which were suggested to me.  chmod, of course.

2. Use the following commands in Python, based on the path in which I had buzzme:

import os

os.system('/home/zaurus/buzzme -t')

It's a beautiful thing!  Thanks again.

Clint Reese