In experimenting with Raspberry Pi Zero 2, here are my results with the (custom) Python scripts I've tried:
WORKS - Had to fix the file path to blueranger.sh, since it had moved.
Changed to ~/p4wnsolo/sw/BlueRanger/blueranger.sh
Filename & location: pi@raspberrypi:~/p4wnsolo/zips_21-12-05/ianscripts/oledblueranger $ python3 menuwithip.py
pi@raspberrypi:~/p4wnsolo/zips_21-12-05/ianscripts/oledblueranger $ python3 menuwithip-FIXED_21-12-05.py
WORKS - This is a very basic horizontal selection-menu for OLED. Reads menu items from txt file, has 3 button places and responds to key presses visually.
Filename & location:
pi@raspberrypi:~/p4wnsolo/zips_21-12-05/ianscripts/oledhorizmenu $ python3 key_demo_copy_goagain.py
Text Input (key_demo)
The entire folder has different versions of the OLED text input script.
But the best and latest version is wifi-disp.py from the latest RPi0 p4wnsolo build.
Not working - just need to figure out how to output to tty to test it (see notes).
Oledterm launches without error on RPi 0 2, but also doesn't show anything when I do this:
echo Hello > /dev/tty
or /dev/pts/0 or 1
The init screen seems to appear fine (0 - 9), but nothing after that.
May need to make my own!
I modified getip.py into getip-updated_21-12-05.py to cut stuff from it and show just the IP.
I also have it display the IP and hostname on the OLED screen.
Next: Get it to start on RaspberryPi bootup.
I got continuous program output to display on OLED using terminal.py!
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!
Here's the command to get it running on Raspberry Pi Zero 2:
pi@raspberrypi:~/p4wnsolo/zips_21-12-05/ianscripts/oledp4wnp1/luma.examples/examples $ python3 terminal.py -i spi --display sh1106 --rotate 2
Here's how to add Ethernet gadget capability to Raspberry Pi: