Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run on Android/Termux? #226

Open
T-vK opened this issue Sep 30, 2024 · 2 comments
Open

How to run on Android/Termux? #226

T-vK opened this issue Sep 30, 2024 · 2 comments

Comments

@T-vK
Copy link

T-vK commented Sep 30, 2024

I'm using the open source terminal emulator app Termux on my Android Tablet and I would like to run wyoming-satellite on it.

I installed python, pip and venv by running pkg i python and then I ran script/setup which caused this error:

Traceback (most recent call last):
  File "/data/data/com.termux/files/home/wyoming-satellite/script/setup", line 18, in <module>
    builder.create(_VENV_DIR)
  File "/data/data/com.termux/files/usr/lib/python3.11/venv/__init__.py", line 76, in create
    self._setup_pip(context)
  File "/data/data/com.termux/files/usr/lib/python3.11/venv/__init__.py", line 358, in _setup_pip
    self._call_new_python(context, '-m', 'ensurepip', '--upgrade',
  File "/data/data/com.termux/files/usr/lib/python3.11/venv/__init__.py", line 354, in _call_new_python
    subprocess.check_output(args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/data/data/com.termux/files/home/wyoming-satellite/.venv/bin/python3', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
gta4xlwifi:/data/data/com.termux/files/home/wyoming-satellite

Any clues what that error means and how to get further?


Later on I will probably also need to figure out how to replace the aplay and arecord commands. Maybe termux-microphone-record would be an adequate replacement:

Usage: termux-microphone-record [args]
Record using microphone on your device

-h           Shows this help
-d           Start recording w/ defaults
-f <file>    Start recording to specific file
-l <limit>   Start recording w/ specified limit (in seconds, unlimited for 0)
-e <encoder> Start recording w/ specified encoder (aac, amr_wb, amr_nb)
-b <bitrate> Start recording w/ specified bitrate (in kbps)
-r <rate>    Start recording w/ specified sampling rate (in Hz)
-c <count>   Start recording w/ specified channel count (1, 2, ...)
-i           Get info about current recording
-q           Quits recording

and maybe the play command provided by sox would be a valid replacement for aplay.

@slyticoon
Copy link

If you are using the android tablet as a dashboard style device, I believe that it is possible to use assist (including wake word detection) via the Home Assistant companion app. You can set the "voice assistant" on the tablet to be home-assistant's assist, which can listen for your wake word.

@T-vK
Copy link
Author

T-vK commented Nov 17, 2024

I've already tried this and it doesn't work. The app does not have built in wake word detection and can not continuously listen in the background. But I have been working on getting wyoming-satellite and wyoming-openwakeword to run on Android for a couple of weeks and eventually got it working. For the convenience of other folks trying to get this to work as well, I've created a simple install script that takes care of all the complicated business:
https://github.com/T-vK/wyoming-satellite-termux
I also created a discussion thread over at HomeAssistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants