androidbashsshapp-inventor

Is it possible to run a bash ssh command via MIT App Inventor to a local Raspberry Pi?


TL;DR I want to create an Android app able to send a pause command to omxplayer running on a Raspberry Pi, via ssh.

I have been using RaspiCast (see Play store) for a Chromecast-like functionality on my sitting room TV, but since the Buster release of Raspbian I can cast youtube videos as usual but controls (pause, start) are non responsive any more and the progress bar is gone. Omxplayer connects to DBUS though, so it is possible to remotely send a commmand via send for various functions. For example running sshpass -f <(printf '%s\n' my_passwd) ssh pi@piTV_IP_address -p Port 'bash dbuscontrol.sh pause' on bash on another local linux machine can pause and unpause playback on my TV RPi where I cast. So I want to create the simplest of android apps: a single Pause/Play button that when touched will send that ssh command to the RPi on the local network. After that it will be trivial to populate the app with buttons offering what is available via omxplayer's dbuscontrol.sh script.

The ActivityStarter block (Connectivity category) seems like the first place one should look but I can't make heads or tails of it. Any suggestions?


Solution

  • you might want to try the Terminal / Shell Extension by Juan Antonio
    there also is a SSH Client Extension by Andre Castro available, Github respository
    for the App Inventor extensions diretory see here https://puravidaapps.com/extensions.php