Pirate Radio, Mopidy and Python2

Hi there,

I have just received a Pirate Radio as a gift and put it all together. I have installed the software as per docs to install the Spotify client but ran into errors / warnings about Python versions along the way…

When it comes to running the web interface it gets even messier! The [http] config section of mopidy was set to only allow local connections; so I changed that but then it appears as if Iris has not installed… Digging around a bit more it looks like Mopidy does not support Python2 anymore; but I think that some of the dependencies have been installed in Python2.7 along the way rather than it all running in Python3…

Has anyone got the Pirate Radio and Mopidy working with Raspbian Buster properly?

Thanks,
Jon

I’m not sure if this helps but under manual install it says the following.
Maybe try running sudo apt-get install python3-phatbeat

Manual install:

Library install for Python 3:

on Raspbian:

sudo apt-get install python3-phatbeat

other environments:

sudo pip3 install phatbeat

Library install for Python 2:

on Raspbian:

sudo apt-get install python-phatbeat

I think i have a similar issue in that on setting up I have the message that VLC Radio Installer does not work on this version of Raspbian (Buster). I’m sorry to say I’m very new to RaspberryPI-dom and so my question is very basic (to some), but what is the best way to revert back to an earlier version of Raspbian to get the radio working?
I’ve seen elsewhere that the Juliet version is recommended, but I really have no idea whether to overwrite or uninstall, or even reformat the microSD card. A step by step guide for the unfamiliar would be really useful.
Thanks in anticipation.
G

You can get older versions of Raspbian here,
http://downloads.raspberrypi.org/raspbian/images/
And install instructions are here.
https://www.raspberrypi.org/documentation/installation/installing-images/README.md

I use Etcher, it will unzip and image the card all in the one go for you. And no having to format the card before hand.

Be advised though, if its a Pi 4B you have to use Buster. Anything earlier will not boot on a Pi 4B.

My Pi Zero W / pHat Beat setup is running Jessie or Stretch. Probably Stretch. I use it almost daily and haven’t had any issues with it for ages, so why fix what isn’t broken. ;)

1 Like

I might have to resort to using an older version of Raspbian; although as Buster is listed as compatible in the install script I was hoping to get it running on the latest version… I don’t have anytime to look at it tonight but might have time to give it another go tomorrow night…

Thank you!
I followed your recommendations with my Pi Zero W/pHat Beat, and all is going now…
I took the download of the 2019-04-08-rasbian-Stretch.zip and used the balenaEtcher to format and flash the SD card. After then powering up and making the initial settings (language,wifi etc) Rasbian asked to make updates, which reluctantly I accepted.
When all had settled, I then ran the command curl https://get.pimoroni.com/vlcradio | bash
After some minutes the install completed and waited for my reboot of the system. After doing this the radio started without any additional button pushing from me.
Many thanks again, I can now start to explore the operation in more detail and set up some playlists.
G.

@GremR Thats good to hear. You can skip doing updates, I’m pretty sure there is an opt out button “not now” or something similar. You can actually skip that whole quick setup menu and do it the old fashioned manual way via Raspberry Pi Configuration etc.
I’m no expert on this but I do believe as long as you don’t do a dist-upgrade or full-upgrade you will stay on Stretch.
I usually use the Raspbian with Desktop image, the one between full and lite. Even on headless setups like my Pirate Radio. I like doing things from the GUI versus command line. Once I’m all done I go into Raspberry Pi Configuration and set it to boot to command line instead of the desktop. Make sure you select the auto log on option. It will boot up quicker and run a little lighter faster. And if you ever need to go back to the GUI just run raspi-config from the command line and switch it back to boot to Desktop. Or run sudo startx.

1 Like

Something else I do is tick the box in Raspberry Pi Configuration for “wait for network”. Doing this my Pirate Radio always starts on the station it was on when last shut down. Without it mine would sometimes switch streams looking for a working one because the WIFI hadn’t connected fully yet.

1 Like

Both good pieces of advice… thank you.
I’m now running CLI and “wait for network”, and yes it does power up quicker by around 30s. I also notice that the audio doesn’t cough and splutter now at start up, presumably because the OS is more stable without running up the GUI.
Maybe you know the answer to this… Since I would like to get some idea of the coding involved (and it’s in my nature to see how things work from good examples… which presumably is why I would never have made a brain surgeon), is there a way to see the source code that drives the pirate radio app?
Thanks and best regards
G.

I’m not 100% sure what your asking? Most of what is going on is interaction with the pHat Beat, assuming your running the older Pirate Radio. Thats done via python as far as I know. And the function reference for that is here.
http://docs.pimoroni.com/phatbeat/
The rest of it is hooks into VLC Radio. Its something along these lines


I have no idea how the Modipy stuff works?