Lespa: a pirate audio box

Hello,

After asking a few questions round here about Pirate Audio (in particular in this thread: [Pirate Audio] Extending 'raspberry-gpio' Mopidy plugin), here is the box I created for my son, the Lespa (Lecteur Spotify Autonome in French, Autonomous Spotify Player, I wasn’t too inspired to find the name :) )



The box is based on a Raspberry Pi 0W, a Pirate Audio Amp and some mini arcade buttons. The box is made of Ash and matt black PMMA. I am lucky enough to have access to a cnc router and a laser cutter, so I could start from Ash boards, and was able to add some nice engraved details (even two pokemon drawings on the box sides).

The idea was to provide a device to listen to Spotify without any screen. So I linked the three red buttons of the first picture to three Spotify playlist and add a function to the mopidy_raspberry_gpio plugin to make it play them. Plus buttons for volume up and down and next, prev and play/pause. My son is delighted and the user experience is quite smooth. The mini arcade buttons do not seem too robust though and I already had to change a faulty one.

It was quite fun and makes me start to code in Python, which is nice.

I still have a few questions:

  • Is the pinout of the boards available at https://pinout.xyz/pinout/pirate_audio_3w_amp still valid? I presume so but I tried to link the audio board to the rpi with DuPont cables (without the buttons I didn’t need) and I didn’t succeed in making the screen work. I did it twice and each time, I’d swear I was correct in the wiring. Everything worked ok except for the screen. I used a GPIO ribbon and everything works fine, but it is a bit bulky and there are some efforts on the connections I don’t like.
  • In mopidy-pidi, I changed the invitation to connect to the Iris web app to display an image using the build-in function of displaying art. Two questions here : I remove the blur to be able to have the crisp image. Is there a way to set it back outside of the _init parts of the functions to get back to the normal functionality when displaying album art? It tried to set the variable back to True with no success. Also, it seems to have a gray overlay over it desappearing when I set the volume for instance. Is there a way to remove it just for this waiting image.
  • The main annoyance of the box is the loooong boot time of the rpi 0W with Raspbian. Would there be a way to add a splash screen to show something during the boot time? Using Python is possible? Is there a way to optimize the boot time? Trying another linux flavour?

Thanks,
Nicolas

1 Like

Nice, very nice, especially the engraved labels. =)
I have one of the pHat Beat based Pirate Radio setups. I put it in an old sub woofer box from a dead set of PC speakers. I reused the speakers and just removed the subwoofer. The pHat Beat VU meters are viewable through the speaker cloth. I also added some Mini Arcade buttons. I just wired them up in parallel to the ones on the pHat Beat.
My case is black so I went with all black buttons, and used the white stick on transparent Picade labels.
After seeing what you did I’m thinking it might be time for a rebuild. Maybe move up to a Pirate Audio board.

Hey @alphanumeric,

Thanks for your kind words. I saw your setup and I think it’s what gave me the idea of the arcade buttons and that it was possible to put something nice together.

On the enhancement side, I put a 2200 mAh battery (18650 type) with the Adafruit PowerBoost 1000 Charger but I am fearing that it will be a too small capacity. Do you think I can put two in parallel without security issue?

Now I’d like to setup a alarm clock for my daughter more or less on the same settings.

Chears

Two Powerboost’s or two batteries in parallel?
I wouldn’t do either to be honest. Two power supplies wired in parallel will just fight each other unless the voltages are exact matches.
There is this boost that will give you the full 2.5A
https://shop.pimoroni.com/products/mp2636-power-booster-charger-module.
And you only want to use multiple LIPO cells that are a factory matched pair like this one.
https://shop.pimoroni.com/products/lithium-ion-battery-pack?variant=21758938251347

I have the 6600 MAH version of that battery. It drives a Pi A+, Sense Hat, LED Shim and some environmental sensors. I get hours and hours of use.

@Nicolas - that’s beautiful, I wish I had such good woodworking skills and tools, the one I put together is… functional, but amateurish!

I had exactly the same problem regarding following the online pin-out from Pi Zero W to the Pirate Audio board (no display), and ended up following the same solution as you (connect them all barring the buttons I needed).

Regarding your boot-time display - I think you’d need to write an app from scratch (or, built up from the demo code which comes with the board - there’s an example which displays a rainbow, if i recall correctly), certainly can be done in Python, rather than modifying the mopidy plugin, as the mopidy service won’t be running until some time after the Pi has booted (it’s Slooowwww, as you’ve noticed!), and then have that app set to start as early as possible in the boot sequence.

The display is SPI, and the pinout “should” be accurate. Just don’t forget to wire up the “two” grounds, Pins 25 “and” 39. Plus the +5V.
The display used is I believe this one.

My Pirate Radio takes a good while to boot up. It doesn’t bother me enough to do anything about it though. If you went with the Full Raspbian, set it to boot to command line instead of the desktop GUI. It will speed it up a little and save on resources.

The other option is to just use a more powerfull faster Pi. It will impact battery use though. A 3A+ may be a good compromise. I use them in my headless Motion Eye Camera setups.

1 Like

There is a way to have the Pirate Audio screen show the boot process, as if it was connected to HDMI. It’s a bit of work though. And I’m not sure if it will mess up showing what’s playing?
I will be attempting to replicate the boot screen shown in the link below with the 1.3 SPI LCD at some point. I have the breakout version I linked to above.

1 Like

@gicarey Thanks ! I am sure with the right tools you could end up with something similar. I belong to a volonteer workshop with semi pro wood tools, a cnc router and a laser cutter as I said. This helps a lot ! On the other hand, the box cost much more that the hardware I put in. But I wanted to build something nice for a change.

@alphanumeric, yes two batteries in parallel. I was quite sure this wasn’t a good idea. The Pimoroni battery packs were fine but the shipping fees for France costed as much as the batteries so I have looked to a more local solution. This was not so easy to find.

The wiring seemd to be correct, and I did wired the two grounds. Sound was OK but not the screen. I’ll have another go.

The boot time is not a big issue but I’d like to show that something is going on so that one is not wondering whether it is normal it takes so long. I read some info from Adafruit saying that either Python can be used or an installation in the kernel, so I have to stick to python to not mess with mopidy. I am no linux gooroo, I’ll have to look to a mean to launch a python script at boot time. I’ll look to your links. Thanks to always be helpful

ooh, might have a play with this @alphanumeric, thanks.

Just so we are on the same page, on boot up that Pirate Audio Screen isn’t going to do anything or show anything. It will only display what you tell it to display.
With some code changes, the examples here should work on the Pirate Audio screen.
You’d just have to edit / change the backlight pin used and the CS pin used to match the Pirate Audio pinout. And “maybe” the dc pin used. I do believe its BCM numbers, not physical pin number.

EDIT: That’s actually linked too from the Pirate Audio product page, and you’ll want to install the library.

I can’t order batteries from Pimoroni, I’m on the other side of the big pond in Canada.
I usually buy them from Adafruit as they can go by ground. I’m lucky I can pretty well get what I want at a reasonable price being in North America.

This is what I went through to get my display working.

Hi @Nicolas - I’ve been fiddling around today, trying to solve the ‘nothing on screen when following the wiring diagram’ issue. Seems that the diagram is wrong, and that BCM7 (CE1), Pin 26, and 3v3 Power Pin 17 are both required to have the screen working.

If i disconnect either, my screen ceases to update, soon as I reconnect it, i’m golden again!

I’ve now significantly reduced the amount of cabling in my box!

@gicarey, did you have to use CE1 in your code?

My 1.3" LCD was in my Breakout Garden Mini. It uses CE1, and that’s what the examples are written for. It will also work in the Breakout Garden Hat in the front SPI slot with those same examples. I had to hunt a bit for the wiring but it was accurate when I found it.
3-5V to any 5 or 3 V Pin
CS to BCM 7
SCK to BCM 11
MOSI to BCM 10
DC to BCM 9
BL to BCM 19
GND to any Ground Pin.