p4wnp1-oled-terminal
Runs a command in P4wnP1 and displays the output on OLED screen (SH1106)
Works on Raspberry Pi Zero 2 W
Tested successfully on RPi 0 2 running Raspberry Pi OS (Dec 12 '21)
This is a Demo
This is just a modified Demo file that does this:
- Runs blueranger.sh
- Pipes the output to a txt file
- Continuously displays the text file contents on the OLED screen
Adapted from "terminal.py" in luma.examples repo
How It Works
Terminal.py is an example file in luma.examples.
I re-coded the file to:
- Launch a subprocess that starts BlueRanger.sh shell script and pipes the output to a text file (deleteme.txt)
- Read and display text lines from a (deleteme.txt) text file instead of from an arbitrary loop
And it works!
Usage
Here’s the command to get it running on Raspberry Pi Zero 2: python3 terminal.py -i spi --display sh1106 --rotate 2
Bigger Plan
The bigger idea is to integrate this into BeBoXGui as its own menu item. I'm thinking "Run a Command" could be a good menu option Title for this.
- After the user selects this menu option, the OLED screen gets text input using my text input script.
- Then this script (terminal.py) runs the command and displays the output.