I have had the Pirate Audio: Headphone Amp for Raspberry Pi around for a months but I have been unable to get the display to work. I am using a Pi zero w.
I was wondering if some one might have an updated set of step by step instructions I could follow or just a working image I can download. I am just trying to build a basic music player. I have no need for an internet connection on the device. I have been through the process several times with no luck, and the zero is painfully slow to update and all that. Mopidy seems to be installed correctly.
I updated my OS and then ran the following.
git clone https://github.com/pimoroni/pirate-audio
cd pirate-audio/mopidy
sudo ./install.sh
Same issue, came here to find more info. There does seem to be some issue with deprecated libraries, specifically an updated Python that breaks something in the code and some issues with mopidy.
I’ve looked at the Github Issue page, and am planning on messing with some of that new info tonight. If anyone knows specifically how to work around all this, I’d love to know!
I have a Pirate Audio Speaker. It’s currently running a very old version of Raspbian. It’s setup as an itty bitty beat box. In place of the speaker phat. Just FYI. Build an Itty Bitty Beat Box
I’m not currently using the Display portion. I have run some of the sp7789 examples on it.
Just to recap,
display doesn’t work at all?
or just issues with song playing, album art etc?
Yep, it will not display anything. I may just need to mess with it more, but as of writing, it just doesn’t work. I’m planning on using this as a sort of portable MP3 with a battery pack, so the display is pretty crucial.
I may just go back to some old version of Rasbian, but I just want something stable at the moment LOL
The back light is on, but nothing shows on the display. I believe the issue is with ST7789.
While troubleshooting I ran
sudo pip3 install st7789
but I had to add something along the lines of --break-system-package (I don’t remember now) it seemed to run but I still never got anything on the display. I have since reinstalled.
When running :
sudo apt-get install python-rpi.gpio python-spidev python-pip python-pil python-numpy
You will get an error. It works when you change python to python3
and then
sudo pip3 install st7789
but you will get the error externally-managed-invironment
It will work with --break-system-packages
I have not done that this time around though.
Currently most on my st7889 LCD’s are connected to Pico’s. When I get a chance I’ll connect a monitor and keyboard to my itty bitty beat box and fire it up. Then check what version of Raspbian its running, and see what history is there of what I did in the terminal window. I’m pretty sure I did some button test code?
I’ll post back what I find out tomorrow. I could even swap out my SD card for a spare Pi OS one. And start from a fresh install?
This may get me some negative feedback, but I’m going to post it anyway.
It’s one of those not recommended and do so at your own risk.
Running the following from terminal will disable the virtual environment. sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
Ok my setup is a Pi Zero W Rev 1.1, running Buster. And as near as I can tell I haven’t installed any st7789 software. So, that I have done, and I double checked that SPI is enabled.
>>> %Run scrolling-text.py
Traceback (most recent call last):
File "/home/pi/scrolling-text.py", line 7, in <module>
import st7789
ModuleNotFoundError: No module named 'st7789'
I have been using the Pirate Audio Speaker board with other single-board computers and not always with Linux, either. Although there may be support benefits in driving the ST7789 from Python, it is possible to use the ST7735 driver in Linux (drivers/gpu/drm/tiny/st7735r.c) with some specialisations to support the ST7789 and the screen on these boards as a normal framebuffer.
I guess that at some point I should share these specialisations so that this offers an alternative. As noted above, it is possibly easier to support the use of Python modules than Linux drivers, but there are definitely benefits in going down the Linux driver path.
I believe the most recent version of the st7789 installer installs into a virtual environment (if you don’t have one, it will set one up for you).
Try git clone https://github.com/pimoroni/st7789-python cd st7789-python ./install.sh
You’ll then need to switch to your virtual environment before running the examples with:
source ~/.virtualenvs/pimoroni/bin/activate
Looks like we could indeed do with updating the readme to be a bit more helpful here!
That worked on my Pi 400 running Bookworm. I’m getting a message about text size being depreciated, but I’m getting the scrolling text on a display when run from the virtual environment. It was a stock fresh install of Bookworm 64bit.
I’ll have to hunt up a spare SD card to try it on my Pi Zero Pirate Audio setup.
I won’t be able to test this out on my Pirate Audio Hat. I took my Pirate Audio Hat and plugged it onto a spare Pi 4B I had here. That 4B was working just fine with Pi OS already installed. I have no idea what happened but it wouldn’t boot up? The SD Card that was in it now shows as 0 Mb, and the Pi 4 won’t boot up at all, sd card in it or not. The hat is also dead now? No sound now when plugged into my itty bitty beat box. The hat was on properly, I double checked it before powering up the Pi. Just bad luck, I’m thinking the Pi died and in the process took everything else with it? I’ll have to go get my multi meter and check voltages etc.
Anyway, I don’t have any other hats with an LCD on them here to tinker with. Not Pi based anyway.
@hel Hel Gibbons may be able to help you out? My current working test setup is a 1.54" SPI Colour Square LCD (240x240) Breakout connected to a Pi 400 running Bookworm. I’m hunting though my stuff for something closer to the Pirate Audio Hat. No luck so far.