Internet radio play at start up


#1

I have the phatbeat and recently set up the internet radio and it works great - I am putting it inside an old bush radio I’ll show come photos later.

I can do a little coding but not sure were to start. I wanted my radio to autoplay the playlist once the pi is booted rather than having to press play that way I can always start with my favorite station.

Could someone point me in the right direction? I checked on the web interface but couldn’t see any options.

Where is the file running the code and is there a reference for VLC? Not really sure were to start.

Thanks.


#2

It’s not nice, but you could emulate the push of the play/pause button at startup by running a delayed cron job that sends a high signal to the pin that the button uses (pin 6 I believe). This should, in theory, act as if somebody went up there and physically pushed the button.

Like I said, not nice, but might work.


#3

I’m running my Pirate Radio setup as shown here, https://learn.pimoroni.com/tutorial/sandyj/internet-radio-on-your-pirate-radio Mine starts playing automatically when it boots up. It launches the last station I was listening to when I turned it off. Seems to remember what volume level I left it at too.
There is some info on the vlc codes here, Use a media keyboard with your pHat Beat, can it be done?
Another option is to add your own easy to use buttons to your case, I did that here, My Pirate radio build


#4

The GPIO used by each button is marked on the pHat Beat. I have my own buttons wired to those GPIO. Mine ground, pull low those GPIO when pressed. Works great with no coding needed.


#5

Thanks for the replies.

Ideally I would like as few buttons as possible.

I will try the codes - does anyone know were the existing script can be found?

alphanumeric I am running the same code but it defo does not automatically play I wish it did.

I am now swerving towards putting some additional buttons on the radio on one side.


#6

Mine plays as soon as it boots up. Are you pausing it before shutting down, or just pushing the power button to turn off? I don’t know the location of the actual installed script. I toyed with adding my media keyboard code to it but have so far chickened out.


#7

I presumed that my own radio didn’t play at startup due to me running both as an airplay speaker and an internet radio at the same time, but maybe not so!
I wonder where it’s actually ran from also, and what causes it to run at boot. Maybe @Gadgetoid or @RogueM could give us a hand?

I don’t believe it uses either Cron or rc.local, so I really haven’t a clue how it boots…


#8

It’s not in crontab, I use that to launch my media keyboard / IR remote control code, and didn’t see an entry there.


#9

Thanks for the suggestions - I have wired up buttons for play and skip forward and the output from the phatbeat to the existing tone potentiometer on my radio (leave digital volume as is) and it works well. Impressed with the sound given it is 5v.

It still starts up funny though and I suspect this is why it does not autoplay. To get it to play the first stream on the playlist I have to press skip, then play. I have also tried through the VLC remote at http://raspberrypi.local:8080 and even there, I have to press skip then play. Play alone does not play at start up.

I am going to check to see if I have set up a dodgy playlist but it looks fine in VLC.


#10

I have some channels that don’t seem to work at certain times of the day, just silence. The original m3u file I pulled the info from for that one station had more than one IP address in it. I’m guessing they use different ones at different times of the day. Just agues though. I only copied the first IP listed into the VLC Radio playlist.


#11

I’ve redone my Pirate Radio right from square one at least once. It was acting flaky, likely from me playing around trying to get my IR remote working. Working a lot better the second time around.


#12

I have the same problem on a Pi Zero W w/pHat Beat - that is, no immediate start of streaming after boot. I’ve read somewhere that delaying the auto-startup of VLC a second or so will solve the problem but I simply press the FF button. Perhaps VLC does not wait for the network connection to get going properly before it tries to connect to the stream?


#13

Using mine more and more now, I’ve noticed the no music on boot up occasionally happens for me. And hitting play/pause usually fixes it. Mine will stop all on its own some times too. And hitting play / pause usually starts it working again. I think its the stream, what station I’m on that’s doing it. I have some that just don’t work at certain times of the day. Just silence, I have to switch stations. I’m going to do up a new playlist m3u file and see if that helps.

I’m running full Raspbian so I’m going to try setting the “wait for network” option in raspberry Pi config.
https://www.raspberrypi.org/blog/latest-raspbian-update/