Help - Search - Members - Calendar
Full Version: Beep from Terminal using Default ROM?
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Linux Applications
ClintReese
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
The link which they gave also seems to require zgcc
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
ClintReese
QUOTE(ClintReese @ Oct 28 2004, 03:06 PM)
The link which they gave also seems to require zgcc
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. smile.gif

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
http://books.lulu.com/content/70176
ClintReese
QUOTE(ClintReese @ Oct 28 2004, 03:14 PM)
QUOTE(ClintReese @ Oct 28 2004, 03:06 PM)
The link which they gave also seems to require zgcc
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. smile.gif

Clint Reese
C.H.E.I.F. - Cyborgs Having & Encouraging Individual Freedom
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
radioz
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

radioz
ClintReese
QUOTE(radioz @ Oct 31 2004, 06:39 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

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
ClintReese
QUOTE(radioz @ Oct 31 2004, 06:39 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

radioz

It didn't work for curses. sad.gif

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

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
ClintReese
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. smile.gif

Clint Reese
ClintReese
arg! os.system() should work, but now voicerec doesn't play the recording sent to it as an argument as a default!

Clint Reese
jfv
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
ClintReese
QUOTE(jfv @ Nov 1 2004, 06:43 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

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

Clint Reese
ClintReese
QUOTE(ClintReese @ Nov 2 2004, 07:32 AM)
QUOTE(jfv @ Nov 1 2004, 06:43 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

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

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. smile.gif

Clint Reese
jfv
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
ClintReese
QUOTE(jfv @ Nov 3 2004, 07:29 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

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

Thanks again!

Clint Reese
ClintReese
QUOTE(ClintReese @ Nov 1 2004, 10:13 AM)
QUOTE(radioz @ Oct 31 2004, 06:39 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

radioz

It didn't work for curses. sad.gif

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

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

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

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
jfv
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. Please let me know if it works.

Felipe
ClintReese
QUOTE(jfv @ Nov 4 2004, 03:15 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. 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. sad.gif

Clint Reese
ClintReese
QUOTE(ClintReese @ Nov 4 2004, 04:11 PM)
QUOTE(jfv @ Nov 4 2004, 03:15 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. 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. sad.gif

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
ClintReese
QUOTE(jfv @ Nov 4 2004, 03:15 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. 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. smile.gif

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

Clint Reese
ClintReese
Hurray! It works! Thanks again, jfv and radioz! Let me know if there is something within reason that I can do for you. smile.gif

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. smile.gif

Clint Reese
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.