ThePiBaker
Posts: 9
Joined: Sun Oct 19, 2014 1:48 am

Songza on Raspberry Pi

Sun Oct 19, 2014 2:15 am

Hey guys -
I'm wondering if anyone might have any interest in creating a Songza equivalent to Pandora's "Pianobar"? Pianobar is an open-source, lightweight terminal program which runs Pandora Radio and can be planed on a Raspberry Pi, as described in this tutorial (see step 3): http://www.instructables.com/id/Pandora ... made-with/

I really like this project but I live in Canada where Pandora is not available (I could use VPN but I've become familiar with and fond of Songza, so I'd prefer that.

If anyone has any ideas, I'd really appreciate them.

fyi - I am new to all of this but willing to learn and contribute... however this project is, for the time being, beyond me, so I'd appreciate any help or direction you guys might be able to provide.

fruitoftheloom
Posts: 21968
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Songza on Raspberry Pi

Sun Oct 19, 2014 7:10 am

ThePiBaker wrote:Hey guys -
I'm wondering if anyone might have any interest in creating a Songza equivalent to Pandora's "Pianobar"? Pianobar is an open-source, lightweight terminal program which runs Pandora Radio and can be planed on a Raspberry Pi, as described in this tutorial (see step 3): http://www.instructables.com/id/Pandora ... made-with/

I really like this project but I live in Canada where Pandora is not available (I could use VPN but I've become familiar with and fond of Songza, so I'd prefer that.

If anyone has any ideas, I'd really appreciate them.

fyi - I am new to all of this but willing to learn and contribute... however this project is, for the time being, beyond me, so I'd appreciate any help or direction you guys might be able to provide.
There is a plugin for XBMC, but whether it will work with either OpenElec or Raspbmc, I am unable to deduce

http://forum.xbmc.org/showthread.php?ti ... id=1720697
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

ThePiBaker
Posts: 9
Joined: Sun Oct 19, 2014 1:48 am

Re: Songza on Raspberry Pi

Sun Oct 19, 2014 2:21 pm

I managed to get that plug in to work on RaspBMC. Does that mean I can somehow get it to work in the same fashion as the instructable I attached above?

fruitoftheloom
Posts: 21968
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Songza on Raspberry Pi

Sun Oct 19, 2014 5:52 pm

ThePiBaker wrote:I managed to get that plug in to work on RaspBMC. Does that mean I can somehow get it to work in the same fashion as the instructable I attached above?
The instructable is for Raspbian Wheezy OS......different than the OSes with XBMC
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

ThePiBaker
Posts: 9
Joined: Sun Oct 19, 2014 1:48 am

Re: Songza on Raspberry Pi

Mon Oct 20, 2014 5:53 pm

fruitoftheloom wrote:
ThePiBaker wrote:I managed to get that plug in to work on RaspBMC. Does that mean I can somehow get it to work in the same fashion as the instructable I attached above?
The instructable is for Raspbian Wheezy OS......different than the OSes with XBMC

Yes, I know that... I thought, as per your original reply, you were going somewhere with this...

fruitoftheloom
Posts: 21968
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Songza on Raspberry Pi

Mon Oct 20, 2014 6:21 pm

ThePiBaker wrote:
fruitoftheloom wrote:
ThePiBaker wrote:I managed to get that plug in to work on RaspBMC. Does that mean I can somehow get it to work in the same fashion as the instructable I attached above?
The instructable is for Raspbian Wheezy OS......different than the OSes with XBMC

Yes, I know that... I thought, as per your original reply, you were going somewhere with this...
No, just pointing out it seems only available as a XBMC add-on. ;)
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

audstanley
Posts: 10
Joined: Fri Nov 28, 2014 12:44 am

Re: Songza on Raspberry Pi

Fri Nov 28, 2014 12:56 am

Got it working perfectly. I also have it linked up with "google now" so i can send voice commands via my android galaxy s5. I'll post details or maybe a reddit link w/ photos. Not 100% sure it will work headless, but when i vnc into the box the browser runs in the backround so it may work without a desktop enviornment running.
UPDATE: you have to run the pi in a desktop environment, but that doesn't mean you have to have your pi plugged into a monitor all the time :D

A couple of issues: if i send the open radio station link command more then once then the script i wrote will activate two stations. Also, i need to fix gtk on startup. I'll post the scripts and details in the next couple of weeks. Maybe some of you guys can help me refine this to run more smoothly.

Sorry for the cuts. I wanted to upload to instagram and the pi takes a while to buffer: http://youtu.be/_GzOwy4mNoA
Last edited by audstanley on Wed Dec 03, 2014 7:17 pm, edited 1 time in total.

audstanley
Posts: 10
Joined: Fri Nov 28, 2014 12:44 am

Re: Songza on Raspberry Pi

Wed Dec 03, 2014 7:15 pm

Get your raspberry pi connected to wifi router, set up your raspberry to reconnect to your wifi router if it gets disconnected, and ssh into your pi from another computer your ip address will vary:

Code: Select all

ssh pi@10.0.1.101
if you don't know what your pi's ip address just use arp-scan from the other computer:

Code: Select all

sudo apt-get install arp-scan;
sudo arp-san --interface=wlan0 --localnet
You might have to run sudo arp-san --interface=wlan0 --localnet over and over again to find your pi If your pi is connect directly via ethernet to your laptop or desktop then run:

Code: Select all

sudo arp-san --interface=eth0 --localnet
this is so you can find your pi on the network WITHOUT needing to plug in HDMI and run the ifconfig command. It's also good if your pi changes ip address on the network while you are setting things up, and forget to set up a static address. Saves you the time of grabbing a keyboard/mouse/monitor/HDMI cable.

There are other threads on connecting to your wireless router, and also making sure the pi re-connects if the wireless signal drops, so I won't go into detail on those things, Just google it.

Connect to your pi via ssh:

Code: Select all

ssh pi@10.0.1.101
password by default is: raspberry

enable desktop environment and make your audio output the 3mm jack:

Code: Select all

sudo raspi-config
select Enable Boot to Desktop/Scratch
select Desktop Log in as user 'pi' at the graphical desktop
select OK
select Advanced Options
select Audio
select Force 3.5mm ('headphone') jack
select Finish
the pi will need to reboot.

ssh back into your pi after about 30-45 seconds:

Code: Select all

ssh pi@10.0.1.101
install Gnash because Adobe doesn't wan't to support ARM (jerks):

Code: Select all

sudo apt-get install browser-plugin-gnash
make a directory for your music stations:

Code: Select all

sudo mkdir scripts
cd scripts/
I use nano to make scripts:

Code: Select all

sudo nano christmas.sh
then paste in this:

Code: Select all

sudo killall epiphany-browser;
sleep 3;
export DISPLAY=:0.0;
sleep 3;
epiphany-browser http://songza.com/listen/the-biggest-christmas-hits-of-all-time-songza-1/;
hit Ctrl X, and Y to save, then Enter.
make the script executable:

Code: Select all

sudo chmod 777 christmas.sh
plugin you headphone jack and then:

Code: Select all

bash /home/pi/scripts/christmas.sh
you can add the bash command to your android phone - tasker app ($10)- SSH plagin ($1.50). With tasker you can create a "scene" and make multiple buttons for multiple radio stations. If you get more then one radio station playing at once just execute:

Code: Select all

sudo killall epiphany-browser
and the radio station will stop playing music.

You can copy this script with:

Code: Select all

sudo cp christmas.sh rock-music.sh
and nano into the rock-music.sh and plop in a different URL so you can create multiple station scripts.

The music takes about 40-50 seconds to start playing, and is a wonderful little internet music player with no commercials. Now, you just wire it into some old radio box, and you have an independent configurable internet radio station player for $50 with no need to mess around with bluetooth. Eventually, you can make buttons with GPIO pins to activate the radio station scripts.

You can also control volume with this command, put this into your tasker SSH plugin, and have fun making a few settings like "low volume," "medium volume," and "full volume."

Code: Select all

amixer cset numid=1 -- 100%
just adjust the percentages. I have a 100% task, a 90% task and a 70% task. 70% ends up being very quiet on my sound system.

Lastly, here is a good video on how to use the auto-voice plugin within tasker:
https://www.youtube.com/watch?v=5duJxXKjUBM
You would set up "voice recognize" as your profile (i use the trigger word "computer" and the command "low volume"). then your task would be the SSH plugin and plop the amixer cset numid=1 -- 70% into the SSH tasker plugin. Now you can say, "computer, set the radio to low volume." and your songza pi box will quiet down in about a second.

Return to “General discussion”