Anodynous / stenogotchi

Portable stenography using Plover and bluetooth keyboard emulation on a Raspberry Pi Zero W
GNU Affero General Public License v3.0
172 stars 11 forks source link
bluetooth dietpi keyboard-emulation pi plover plover-plugins python3 raspberry raspberry-pi raspberry-pi-zero-w steno stenography

Stenogotchi

stenogotchi_1

Aim of the project is to deliver a cheap and portable device for running Plover where local installation on the host is impossible or simply not preferred. A stand-alone link enabling stenography using any input device supported by Plover on any device accepting bluetooth keyboards.

Likely use-cases include:

Stenogotchi is built on top of Pwnagotchi, but instead of hungering for WPA handshakes it feeds on your steno chords. It emulates a BT HID device for connecting to a host and output can be toggled between STENO and QWERTY mode on the fly. The friendly UI optimized for low-power eINK displays is also accessible as a web UI version, making both the eINK display and buttonSHIM modules optional. If the RPI0w always will be powered over microUSB a separate battery pack is not needed. The suggested UPS-Lite 1000 mAH battery provides 3+ hours of runtime and supports pass-through charging.

Hardware

Module Status
Raspberry Pi Zero W or Raspberry Pi Zero 2 W Required
MicroSD card (min 4 GiB) Required
Waveshare 2.13 v.2 Recommended
ButtonSHIM Recommended
UPS-Lite v1.2 Recommended
DS3231 RTC Module Optional

See the build notes for guidance on fitting the parts together.

Installation

All commands should be executed as root. The installation process can be completed headless.

  1. Flash and configure DietPi image, see https://dietpi.com/docs/install/

    • For headless installation, set AUTO_SETUP_NET_WIFI_ENABLED=1 in dietpi.txt and enter wifi credentials in dietpi-wifi.txt before first boot.
    • When prompted allow dietpi to update, change passwords and disable serial console. Under dietpi-config > advanced options enable:
      • Bluetooth
      • SPI state (needed by eINK screen)
      • I2C state (needed by Buttonshim module and for UPS-Lite power readings)
    • Using command 'dietpi-autostart' enable automatic login of user 'root' to local terminal (option #7)
  2. Install dependencies

    apt-get install git xorg xserver-xorg-video-fbdev python3-pip python3-rpi.gpio python3-gi libtiff5 libopenjp2-7 bluez screen rfkill -y pip3 install file_read_backwards flask flask-wtf flask-cors evdev python-xlib pillow spidev jsonpickle dbus-python toml

  3. Download and install Plover (v4.0.0.dev10)

    wget https://github.com/openstenoproject/plover/releases/download/v4.0.0.dev10/plover-4.0.0.dev10-py3-none-any.whl pip3 install plover-4.0.0.dev10-py3-none-any.whl

    • If you'd rather try the continuous build of Plover for the latest improvements, you will need to install both build-essential and python3-dev through apt-get first. Switch back to dev10 if you experience issues.
  4. Clone the Stenogotchi repository and install the plover plugin "stenogotchi_link"

    git clone https://github.com/Anodynous/stenogotchi.git pip3 install ./stenogotchi/plover_plugin/

  5. Configure Plover. Setup will ultimately depend on your own preferences and keyboard, but below is what I use. Make sure to include at least 'auto_start = True' and the '[Plugins]' section in your own config.

    mkdir -p /root/.config/plover/ nano /root/.config/plover/plover.cfg

    ----------

    [Output Configuration] space_placement = After Output start_attached = True start_capitalize = False undo_levels = 30

    [Logging Configuration] enable_stroke_logging = False enable_translation_logging = False

    [Machine Configuration] auto_start = True machine_type = Gemini PR

    [Gemini PR] baudrate = 9600 bytesize = 8 parity = N port = /dev/ttyACM0 stopbits = 1 timeout = 2.0

    [Plugins] enabled_extensions = ["stenogotchi_link"]

  6. Run installation script to finalize setup of Stenogotchi. Optional boot time improvements offered by script described in "Significantly reduce boot time" section below.

    chmod +x ./stenogotchi/initial_setup.sh ./stenogotchi/initial_setup.sh

  7. Configure Stenogotchi settings after reboot completes

    nano /etc/stenogotchi/config.toml

    ----------modify the config as you see fit----------

    main.plugins.buttonshim.enabled = true main.plugins.upslite.enabled = true main.plugins.evdevkb.enabled = true main.plugins.plover_link.bt_autoconnect_mac = '00:DE:AD:BE:EF:00,11:DE:AD:BE:EF:11'

    ----------

Updating

   cd ~/stenogotchi
   git pull
   pip3 install ~/stenogotchi/plover_plugin/

Configuration / Troubleshooting

Bluetooth connections

Significantly reduce boot time

Usage

stenogotchi_2

Buttonshim

Below long-press (1s) actions are pre-defined. Short-press triggers user configurable terminal commands, e.g. rclone sync of Plover dictionaries with cloud storage.

Project roadmap

Pictures

stenogotchi_3 stenogotchi_4 stenogotchi_5

License

Released under the GPL3 license.