PiratePython - Pirate Radio

This is a little unzip-to-your-SD-card software image for Pirate Radio, designed to make it simple and easy to get your new radio kit set up. If you don’t want to make customisations to your radio, and you don’t want to spend hours setting up Raspbian and our software from scratch, then this is the OS for you!

This is still very much a beta release, but it’s coming along nicely! Features include:

  • VU and button support for the pHAT BEAT included in the Pirate Radio kit
  • Ability to play internet radio stations, and also MP3 files stored on the SD card
  • An HTTP interface to control your radio- http://pirateradio.local:8080 (password: p1rat3)
  • Stateless RAM disk image, so it should never corrupt when powered off
  • Slightly better VU meter response/scaling (more improvements to come)

To get started, grab the zip file from below and extract it onto a blank SD card. Some users have reported problems with larger cards, so ideally try 8GB or 16GB, but this OS will also fit on a 2GB or 1GB card!

TODO

  • Investigate USB keyboard/input device support
  • Retrieve VLC volume and scale VU meter accordingly
  • Add vlc_volume option to settings.txt
  • Add vlc_http_password option to settings.txt
  • Investigate garbled audio on startup- VLC starting too soon?

Current Version

http://get.pimoroni.com/pirateradio-v20180202.zip

  • Maybe fixed the WiFi issue this time?
  • Fixed a bug in phatbeat controls
  • phatbeatd now handles VU meter updates and buttons
  • Updated to kernel 4.9.79
  • Added full wget utility (only really useful for debugging)

Old Images

http://get.pimoroni.com/pirateradio-v20180201a.zip

  • Fixed WiFi crashing issue
  • Generate unique host key on first boot

http://get.pimoroni.com/pirateradio-v20180201.zip

Please post any questions, requests, bugs and quibbles below!

4 Likes

Fat 32 formatted SD Card?

1 Like

Yup, if you use sdformatter it’ll prep them correctly I believe.

1 Like

Outof pure curiosity I decided to try this PiratePython version. Althou I am quite happy with the latest mods to the onlineinstaller performance.

  • I modified the wpa_supplicant.conf. ok I get the ip correctly.
  • I modified playlist to my streams. Ok starts very low audio level. level controls works
  • I try the HTTP interface with password p1rat3. No connection…So do I use http://pirateradio.local:8080 or the ip-adress ?
  • I try ssh into the RPi Zero: Asks for user and passwrd. Do I NEED username and which passwrd

I assume more questions to come as soon as I able to login to the device.

Thnx

1 Like

You can SSH in, but you wont be able to accomplish much since the entire system is stored within a read-only RAMdisk.

Username and password are- IIRC- in the README.txt, they are:

  • pirate
  • p1r4t3

You can change them in settings.txt

It’s possible the local discovery for pirateradio.local:8080 isn’t working on your system- I believe this requires Bonjour or similar on windows.

You can either use the IP, if you can find it, or try http://pirateradio:8080

1 Like

Ok, I can ssh onto the device, but not using HTTP…
Following remarks I noticed:

  • Audio level low after new start
  • Not able to change station using FF or REW buttons. Using either button device goes silent. Needs reboot to come alive

I do miss buttons.py test

I will follow this topic to see further comments

1 Like

Curious, just after I read this I pressed either FF or REW and my Pirate Radio totally lost its network connection. After a reboot I can’t seem to replicate it.

Aannd it’s just happened again. I wonder why. dmesg has some interesting output:

[  129.038710] brcmfmac: brcmf_sdio_readframes: RXHEADER FAILED: -110
[  129.038727] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame, send                    NAK
[  129.041061] brcmfmac: brcmf_sdio_rxglom: descriptor len 5 bad: 0
[  129.041177] brcmfmac: brcmf_sdio_hdparse: HW header length too long
[  129.041187] brcmfmac: brcmf_sdio_rxfail: terminate frame
[  129.041729] brcmfmac: brcmf_sdio_hdparse: HW superframe header length error
[  129.041747] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
[  129.042017] brcmfmac: brcmf_sdio_hdparse: HW header length too long
[  129.042027] brcmfmac: brcmf_sdio_rxfail: terminate frame
[  149.683860] mmc1: Timeout waiting for hardware interrupt.

Yikes!

1 Like

Appears the above is just correlation. Working with a hunch right now!

If you want to follow along at home, please SSH in and run:

sudo iw wlan0 set power_save off
1 Like

Okay, new image: http://get.pimoroni.com/pirateradio-v20180201a.zip

This one has:

  • Auto-generates new unique dropbear host keys on boot, for actually-secure SSH, these are stored in /boot
  • Has an /etc/network/interfaces file which disables WiFi power damagement

Todo:

To fix your volume issue @calleblyh I’ll add a starting_vol into settings.txt. Since the system is stateless, it can’t save the last volume, but you will hopefully be able specify a comfortable starting volume.

While I’m extracting settings to use in the VLC startup script, I’ll include the ability to change the VLC web interface password.

Note

To update to the a version you just need to drop in the new initrd file. Newer versions might require other file replacement, but this is the case for this one.

1 Like

Thnx,

Honestly, I don’t understand the meaning and purpose with “dropbear host keys” Please remember I am not a programmer.

First: I did replace the new initrd file to the original v20180201 image. Still having problem changing stations

Second: I used the new v20180201a image and still problems changing stations…

So, the “sudo iw wlan set power_save off”, is that a command I need for every reboot or not ?

It seems I am lost under yesterdays heavy snowstrom in Southern Finland.

But just outof pure curiosity I will try follow up this headless mini pirate python radio version.

Pantiltphat, phatbeat and speakerphat are for me best ever products from Pimoroni

1 Like

The v20180201a should not have the problem. I’ve had mine running now for more than 12 consecutive hours without it locking up. Just hit play this morning for some 90s dance, haha!

I wonder if something else is going wrong with your setup, or if I somehow failed to package up the v20180201a version correctly!

Yes that command should be run after every reboot. If you’re careful not to mess up the line-endings (programming is painful!) you can put this in boot.sh right after it calls boot.py.

The dropbear host keys are basically the identification files that your Pi uses to negotiate a secure connection over SSH - dropbear is a lightweight SSH server. Having unique ones on each Pi is an important security consideration, even if it might not be essential in this use case.

1 Like

I stand corrected! Just had a network lock-up. Weirdly my SSH session kept right on running though. I’m going to roll back some recent changes to the kernel configuration which I suspect might be present in this release.

I’ve been making quite a few changes that, if successful, wont make any apparent difference, but should let me add some nice touches.

1 Like

If there is a wish list of features, something I would like to see is keyboard, media key support. The volume up down, pause, change channel (next previous) etc. I have a mini wireless keyboard that would be great for that. I’ve done something similar with an IR remote and a FLIRC but its glitchy and unreliable. It just randomly stops working. Might be my really cheap remote though.

1 Like

That’s a tricky one, since the USB port is used in client-mode when the Pi Zero boots, allowing a host PC to transfer music/change settings etc. It’s something that has been requested before, though, or otherwise pointed out, and it’s a good idea.

If you have a smartphone, that can also serve as a remote using the RC interface: pirateradio.local:9294 or the web UI.

1 Like

No smart phone, or dumb phone lol. Just a landline phone here. I got keyboard control to work in vlcradio with some trickery. You helped me immensely with that. I used a FLIRC which emulates a USB keyboard. https://flirc.tv/ Then controlled that with a cheap IR remote. It proved to be unreliable though. It just randomly stops working. I may revisit it and try to sort it out or improve it.
Use a media keyboard with your pHat Beat, can it be done?
One issue with that method is the keys I want to use, the media keys, don’t give any codes. So I end up using the arrow keys etc instead. Anyway, its off topic so I won’t dwell on it any further.

Keep up the good work =)

Hi

I have set up Pirate Radio with the current image pirateradio-v20180202.zip
Connects to WIFI on boot.
Internet Radio starts on boot.
Crackles on startup.
Sound is smooth.
Can change channels.
Can adjust the volume.
Can connect via USB to PC.
Comes up as “piratepython” on my modem, regardless of what I change it to the settings file.
Can get the login box using http://piratepython.local:8080 or the ip-address.
Can not login due to either password or error msg - Your connection to this site is not private. Is this my firewall?

1 Like

I checked briefly version v20180202.zip. changed wpa_supplicant and playlist to fit my location. Ok.

  • Starts playing on boot
  • Vol UP/DN works
  • FF or REW do NOT work
1 Like

Spud just enter password only as p1r4t3 no username

Thanks will give it a go on the weekend.

Where do you type in all the commands for the computer board? Python?