Connecting A Display To My PIrate Radio


#1

I hope someone can help or point me in the right direction

Due to having quite a few different stations preset in my PIrate Radio, I can sometimes be quite difficult to select the station that I want, I usually wait until I hear a station jingle to find out what station I have chosen. To make life easier I would like to add a display onto my PIrate Radio, so I can display the different stations on the PIrate Radio and scroll through them to pick the station I want.

Because I already have the pHat beat connected to the GPIO, is it possible to add another Hat with display, or do you think it would be better going down the HDMI route and just running a small monitor?

Thanks for any help

Del


#2

I personally am a fan of the 4.2inch automobile backup cam monitor with 2xvideo and 1 power outlet. On a Pi Zero solder some accessible pins to the two TV holes on the right side of the GPIO if viewing the top of the pi zero. You will see the two pin hole labeled run for the hard reset then right next to them two labelled TV. solder pins/sockets/ or a cut video cord and solder. I preferred Pins or low-profile sockets on underside. They are rated 6-12v but the 5v 2.1amp usb ports of my power banks and chargers seem to power it just fine. There is also a 3.5 inch screen but the housing is the same and the cost is close if not the same. I picked two up from ebay both around $15.
I also purchased the vidio jack male plug with two screw fastning ports for two jerky wires to hold.


They may not have the DPI of a nice adafruit piTFT but I can still display an entire desktop and I use none of my GPIOs so I have no compatibility issues with hats/phats.
My favorite small monitor is the Official 7" Touchscreen but the CSI connector to connect it is simply not present on the Pi Zero (but is are present on the A+, B, B+, 2B & 3B) so its non-compatible atleast without some wizardry I am unaware of.


#3

The monitor is only half the battle. I have a pHat Beat setup as a Pirate Radio. If I plug my TV in all I see is the command line prompt. What ever the pHat Beat does when you press the buttons is done in the background and nothing is shown on screen.


#4

If you look here, Use a media keyboard with your pHat Beat, can it be done? About half way through gadgetoid posted a list of the commands for VLC Radio. They might help you out. show playlist etc.


#5

Del, that tiny little blue frame does not have anywhere to mount a display that won’t make it look totally stupid. To have enough size to make it useful for station identification, certainly.

However: You have a DAC and a speaker at hand.
Why not make the station ID audible not visible?!

What about a playlist.m3u structured something like:

# a station
/pi/sndfiles/stationIDs/wpxr-101-memphis.mp3
http://111.22.333.44:8024

# the next station
/pi/sndfiles/stationIDs/icecast-technobass-alpha.mp3
http://55.666.7.888:8024

# etc 

Of course, this will make you have to press Prev/Back twice when navigating, that is, until you modify that behaviour too. You might be able to customize vlc shortcuts to process back twice, there might even be some advanced playlist format that allows for this, for all I know there is some “accessibility mode” addons you can load to make it auto-announce the files/streams, I don’t know. If it were me, I’d modify the module that processes the button scanning and have it generate two button presses.

Certainly easier than rigging a display to that cute little radio!


#6

This looks interesting.
Do you have some pointers to understand the needed soldering for the TV holes?


#7

#8

Del, does it have to be attached or part of the Pirate Radio?

Because with an old android phone (w/o cellular service) it can be like a remote display. Say you use vlcd/vlcradio, you can use Peter Baldwin’s VLC Remote (or any of the many derivatives, but source code for this one is available and free.)

It would look something like:

You could also SSH from the phone for a nice remote terminal to your Pirate Radio.

Just a thought.

good luck!


#9

Its two holes. I haven’t had any ill effect from plugging them in wrong other then it doesn’t work. I have done this a few times. Now on the the B+, Pi2 & pi3 most the cheap ebay composite 3.5 a/v to 3 A/v plugs are wired wrong and I had gotten some scary flickering and erratic pi behavior. If you use a full sized pi use a continuity tester on the 3.5 a/v to 3 +/- a/v plugs to make sure its the same layout the pi needs. It seems the ground on those cheap chinese ebay cables is in the wrong spot.
Again , on the Pi zero I have never had a problem to accidentally wiring backwards, just doesn’t work, but I never left it plugged wrong.


#10

Thanks a lot for all the informations on the RCA plugs. I’ll give it a try


#11

Sorry to re-start an old thread, but I think it still has legs…

I’d like to connect an SSD1306 OLED small display to my Pirate Radio. I can break out the occupied I2C pins for the screen data easily and will just have to hope there isn’t an address clash with the Phat beat.

But, can anybody help direct me to the the station output text or code where I could insert some print statements to show which station is playing? I’ve had no joy with vlc.communicate("command") or sudo vls-wrapper, just does nothing useful when I type commands in.

Would possibly like to display the Wi-Fi/buffer status so I have an idea why the radio keeps going silent for ages.


#12

VLC on Pirate Radio sets up an rc interface (telnet, basically) which you can connect to and issue commands.

Here’s a dump of the help (albeit this is from the Windows version):

+----[ Remote control commands ]
|
| add XYZ  . . . . . . . . . . . . add XYZ to playlist
| enqueue XYZ  . . . . . . . . . queue XYZ to playlist
| playlist . . . . .  show items currently in playlist
| play . . . . . . . . . . . . . . . . . . play stream
| stop . . . . . . . . . . . . . . . . . . stop stream
| next . . . . . . . . . . . . . .  next playlist item
| prev . . . . . . . . . . . .  previous playlist item
| goto . . . . . . . . . . . . . .  goto item at index
| repeat [on|off] . . . .  toggle playlist item repeat
| loop [on|off] . . . . . . . . . toggle playlist loop
| random [on|off] . . . . . . .  toggle random jumping
| clear . . . . . . . . . . . . . . clear the playlist
| status . . . . . . . . . . . current playlist status
| title [X]  . . . . . . set/get title in current item
| title_n  . . . . . . . .  next title in current item
| title_p  . . . . . .  previous title in current item
| chapter [X]  . . . . set/get chapter in current item
| chapter_n  . . . . . .  next chapter in current item
| chapter_p  . . . .  previous chapter in current item
|
| seek X . . . seek in seconds, for instance `seek 12'
| pause  . . . . . . . . . . . . . . . .  toggle pause
| fastforward  . . . . . . . .  .  set to maximum rate
| rewind  . . . . . . . . . . . .  set to minimum rate
| faster . . . . . . . . . .  faster playing of stream
| slower . . . . . . . . . .  slower playing of stream
| normal . . . . . . . . . .  normal playing of stream
| frame. . . . . . . . . .  play frame by frame
| f [on|off] . . . . . . . . . . . . toggle fullscreen
| info . . . . .  information about the current stream
| stats  . . . . . . . .  show statistical information
| get_time . . seconds elapsed since stream's beginning
| is_playing . . . .  1 if a stream plays, 0 otherwise
| get_title . . . . .  the title of the current stream
| get_length . . . .  the length of the current stream
|
| volume [X] . . . . . . . . . .  set/get audio volume
| volup [X]  . . . . . . .  raise audio volume X steps
| voldown [X]  . . . . . .  lower audio volume X steps
| adev [device]  . . . . . . . .  set/get audio device
| achan [X]. . . . . . . . . .  set/get audio channels
| atrack [X] . . . . . . . . . . . set/get audio track
| vtrack [X] . . . . . . . . . . . set/get video track
| vratio [X]  . . . . . . . set/get video aspect ratio
| vcrop [X]  . . . . . . . . . . .  set/get video crop
| vzoom [X]  . . . . . . . . . . .  set/get video zoom
| snapshot . . . . . . . . . . . . take video snapshot
| strack [X] . . . . . . . . .  set/get subtitle track
| key [hotkey name] . . . . . .  simulate hotkey press
|
| help . . . . . . . . . . . . . . . this help message
| logout . . . . . . .  exit (if in socket connection)
| quit . . . . . . . . . . . . . . . . . . .  quit vlc
|
+----[ end of help ]

And what happens when you issue status:

status
status change: ( new input: file:///home/pi/Sabrepulse%20-%20Exile/Sabrepulse%20-%20Exile%20-%2004%20Banish.mp3 )
status change: ( audio volume: 289 )
status change: ( play state: 3 )
status: returned 0 (no error)

#13

Maybe this will help, http://www.bobrathbone.com/raspberrypi/pi_internet_radio.html
I only glanced at it, looks interesting though. Poke around a bit and you may find your answer.


#14

Thanks, that looks like the

vlc.communicate(“command”)

or

sudo vls-wrapper

, I tried. It just didn’t seem to do much. Commands either returned/did nothing mostly. From memory Status sort of worked but just returned something like “02 Playlist, 03 Stopped”.


#15

Where are you calling vlc.communicate() from? Editing the phatbeatd?

You could try: telnet localhost 9294 and see if that gives you a connection to the running VLC instance to begin with.

This is done within phatbeatd like so:

And normally vlc.communicate sends messages over that opened socket.