76 total views, no views today
76 total views, no views today
Now that Christmas is over, I needed to find the next “thing” for my Raspberry Pi. After some googling, I decided to give Pi Musicbox a try. Musicbox is basically a spin of the Raspbian Linux distribution with Mopidy allowing you to play all sorts of streaming services like Spotify, TuneIn, SoundCloud and local sound files on a ‘headless’ Raspberry Pi.
In this post, I will describe a bit of the work I had to do to get Pi Musicbox working to my satisfaction including some of the issues I am still encountering.
The first thing I had to do was ‘dd’ the musicbox image into my mini SD card using a SD card adapter on my laptop which is running Fedora 21:
sudo dd bs=1M if=musicbox0.5.2.img of=/dev/mmcblk0
Once that was done, I mounted the card on my laptop and modified the config/settings.ini file in the MUSICBOX partition. In that file, you can set the root password for your server, enable ssh, set up wifi (*), configure your Spotify account (**) among other things.
(*) I started my set up using my canaKit wifi usb dongle, but once I started doing things with samba mounts to share music, I quickly noticed a lot buffering issues with the system while trying to play music, so I gave up on the wifi and plugged it in directly into my router’s ethernet port.
(**) You must have a Spotify Premium account for you to be able to connect to it via Pi Musicbox.
After saving my changes to settings.ini file, I unmounted my card, took it out of the adpater and plugged it into the Pi. Once it booted it up, I just accessed http://192.168.1.30/ (the IP my router gave my Pi) from my laptop.
Depending how fancy you want to go with your set up, this is probably be the part of the project that will take most of your time. In my case, I wanted to make the songs I had on my mac playable from the Pi.
I shared a Music folder I had with some albums on my mac, and mounted the share o the Pi.
MusicBox has a set of options in the settings.ini to allow you to enter a Samba share information in there for the system to scan, but I could not get that to work with a share coming from a mac, so I went and edited the /etc/fstab on my pi and added:
//192.168.1.79/music /mnt/music cifs username=myusername,password=mypassword,nounix,sec=ntlmssp,noperm,rw 0 0
My guess is that Musicbox tries to mount a samba/cifs share without using the sec=ntlmssp option, which is required to mount a share from a Mac OS X host in Linux. Again, it is just a guess at this moment.
Note that I am mounting the above on /mnt/music. I had to modify the /etc/mopidy/mopidy.conf file. I had to set media_dir option to /mnt/music
My premium membership to Spotify had expired, and when I first started playing with Musicbox the part related to Spotify would just spin on the web interface and nothing would happen. I ended up finding the log for the application and noticed when mopidy started it said non-premium accounts couldn’t access the content I was trying to access.
The log location for mopidy on Musicbox is: /var/log/mopidy/mopidy.log
Remember to enable ssh and set a root password on the settings.ini (as previsouly mentioned) so you can access the log file.
Probably my second favorite feature on Musicbox is the ability to interact with TuneIn, which allows you to listen to local radio stations that have an online presence. And, in case you are wondering, my favorite feature in the Spotify connectivity.
As much fun as I am having in setting this up, there are a few issues I am fighting with. Some of them may be of my own doing, and others may be related to mopidy itself, but at this point, I just see them as problems. So, this is meant to be for information’s sake and not criticism on the project at all.
Yet another great little afternoon project for the Raspberry Pi. I now have a music/radio streaming service in the house that can be remotely accessed via a web interface. It doesn’t require a monitor or TV, no keyboard or mouse. Just a network connection and some speakers. That’s all I have to say about that.
3,553 total views, no views today
Here’s a quick way to create a lightshowPi remote control on your Android phone.
1. This is for an Android Phone, I am not sure about iPhone. Download the app RasPi Check: https://play.google.com/store/apps/details?id=de.eidottermihi.rpicheck
You connect to your Raspberry Pi via SSH on your home network
2. I wrote a quick little python script that turns on all the Christmas lights on my tree using python’s RPi.GPIO. This is for whenever I want to just have the lights on w/o the blinking and music.
##### starts here ####
# script name: christmas-on.py
import RPi.GPIO as GPIO
light1 = 12
light2 = 16
light3 = 22
light4 = 32
light5 = 40
### ends here
a) I am only using 5 channels on my SSR board
b) I am using GPIO ports: 18, 23, 25, 12, 21
3. The christmas-off.py is exactly the same, just using GPIO.LOW isntead of GPIO.HIGH.
4. Add 4 commands to the RasPi Check app.
a) lights on
b) light off
c) dane on
export SYNCHRONIZED_LIGHTS_HOME=/home/pi/gpio/lightshowpi/ && nohup $SYNCHRONIZED_LIGHTS_HOME/bin/start_music_and_lights
d) dance off
export SYNCHRONIZED_LIGHTS_HOME=/home/pi/gpio/lightshowpi/ && $SYNCHRONIZED_LIGHTS_HOME/bin/stop_music_and_lights
Image attached to post.
Note: The creator of LightshowPi just told me, I can turn on all the lights (and off) by using:
# Turn all lights on
sudo /home/pi/gpio/lightshowpi/py/hardware_controller.py –state=on
# Turn all lights off
sudo /home/pi/gpio/lightshowpi/py/hardware_controller.py –state=off
1,650 total views, no views today
A couple of weeks ago, I wrote a little bit about my experience with the Raspbery Pi B+ and the Canakit. The article ended up getting some love from reddit’s /r/raspberry_pi and opensource.com on twitter, which I truly appreciated :-).
As I previously mentioned, I ordered the Sainsmart 8 Channel 5V Solid State Relay Module Board. It finally arrived today, so I went to Target to buy the material to do my “dancing” Christmas Tree.
So, what exactly did I do here?
Here are some photos and videos:
Here are 3 videos I posted on YouTube with the final results:
1,917 total views, no views today
If you want to use one of my photos as an official Fedora 21 background.
Try it out:
yum install f21-backgrounds-extras-gnome
950 total views, no views today