Having fun with the Raspberry Pi B+, Part III

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

#!/usr/bin/env python
import RPi.GPIO as GPIO

light1 = 12
light2 = 16
light3 = 22
light4 = 32
light5 = 40

GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(light1,GPIO.OUT)
GPIO.setup(light2,GPIO.OUT)
GPIO.setup(light3,GPIO.OUT)
GPIO.setup(light4,GPIO.OUT)
GPIO.setup(light5,GPIO.OUT)

GPIO.output(light1,GPIO.HIGH)
GPIO.output(light2,GPIO.HIGH)
GPIO.output(light3,GPIO.HIGH)
GPIO.output(light4,GPIO.HIGH)
GPIO.output(light5,GPIO.HIGH)
### ends here

Assumptions:
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
sudo /home/pi/gpio/christmas-on.py
b) light off
sudo /home/pi/gpio/christmas-on.py
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.

Screenshot_2014-12-09-22-46-31
It works like a charm….

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/py/hardware_controller.py –state=on

# Turn all lights off
sudo /home/pi/gpio/py/hardware_controller.py –state=off

Previous Posts:

Having fun with the Raspberry Pi B+
Having fun with the Raspberry Pi B+, Part II

681 total views, no views today

Posted in christmas, linux, raspberrypi | Leave a comment

Having fun with the Raspberry Pi B+, Part II

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?

  1. First you have to read the original post, and make sure you watch the tutorial on how to set up the breadboard.
  2. Once you are comfortable with that. Look at the LightshowPi project. Learn how to use it.
  3. Join their Google+ Community.
  4. Read up the people’s projects and photos they share over there.
  5. Once, you’ve done all that and you understand what’s going on then order the Sainsmart 8 Channel 5V Solid State Relay Module Board. WARNING, mine took 2 weeks to arrive!
  6. You can search for videos on Youtube on how to connect your Pi to the SSR board, I watched this one. If you understand the GPIO stuff, the SSR board part is pretty simple. The tricky part for me was the electrical part as I have very little knowledge about house electricity.
  7. I purchased: 6 polarized extension chords at Target, 5 for the light string, and 1 for the power source. I am only using 5 channels out of the 8 on the SSR board.
  8. Then I used this amazing step by step photos on how to cut the wires and daisy chain the power source into the relay… and the rest is history :-)
  9. I also needed something to cut the wires with, a small screw driver to tighten the SSR board slots, electrical tape and a jackknife.

Here are some photos and videos:

IMG_2690

raspbery pi, ssr board connected to the lights

IMG_2688

ssr board connected to the extension chords

Here are 3 videos I posted on YouTube with the final results:

972 total views, no views today

Posted in christmas, linux, raspberrypi | 1 Comment

Fedora 21 Extra Backgrounds

If you want to use one of my photos as an official Fedora 21 background.

Try it out:

yum install f21-backgrounds-extras-gnome

My photo of Flagler Beach, FL (w/o any editing)

My photo of Flagler Beach, FL (w/o any editing)

Original: https://www.flickr.com/photos/afsilva2/12178037005/

435 total views, 1 views today

Posted in fedora 21, photography, screenshot, wallpaper | 1 Comment

Having fun with the Raspberry Pi B+

It is Thanksgiving week in the US, and I had some paid time off banked at my job. So, I decided to do a stay home vacation and tinker with something. I decided that “something” would be a Raspberry Pi. A quick search on Amazon, and I ended up ordering the CanaKit Raspberry Pi B+ Ultimate Starter Kit (I will refer to it from now on as “the kit”).

Instagram photo of the unboxing.

Now, I personally don’t need another computer running Linux at home, so I wanted the Raspberry Pi (I will refer to it from now on as “the pi”) to do something I haven’t done before. When I looked at all the LEDs and wires that came with the Starter Kit the first thing that came to mind was Osborne Family Spectacle of Dancing Lights at Disney’s Hollywood Studios. Call me silly, that’s OK!

I had no idea if I would be able to pull it off, but if I could at least understand a bit more of how to make software interact with hardware at the scale in which the Pi claims it could do then my stay home vacation would certainly be a good one.

pi

The Raspberry Pi B+ (photo taken by yours truly)

The kit arrived last Friday (Nov-21), and I wasted no time. First, being completely biased to anything Fedora or Red Hat based, I decided to use NOOBS to install Pidora, and as cool as this Fedora spin is, I quickly noticed it just wasn’t going to be the Linux distribution I should use to make my little Christmas Light show.

I went with the Pi’s recommendation and installed Raspbian, which in a very short amount of time proved itself to be the better distribution to be running on the Pi. You may be asking, what reasons were they? Well, here are a few:

  1. raspi_config which allowed me to do quite a bit of configuration changes to the raspberry pi right off the bet.
  2. LXDE as a window manager. Raspbian’s out of the box needed about 50% less memory than Pidora, which on a little piece of hardware that has 512 MB of RAM this is HUGE!
  3. Included apps: Mathematica, Scratch, Sonic Pi, and the needed python libraries to do some coding with the GPIO pins were all already bundled in Raspbian.
  4. The Raspberry Pi book (and the foundation) recommends Raspbian, so following examples (from the book and online) are much more repeatable in Raspbian.
pi+keyboard

Using a Logitech MK401 seems to be working pretty well with the Pi.

By Friday night, I have the Pi connected to my TV, with Raspbian installed, and connected to the house’s wifi. I run an: apt-get update && apt-get upgrade to update the OS, and now I am ready to look into all the “extras” that came with the kit.

Aside from some very theoretical stuff I had in physics in high school and college about electricity, I have never really had any chance or interest in applying any of that theory anywhere. Terminologies like breadboard, jumper wires, resistors, current, voltage, etc… weren’t foreign words, but they were “theoretical” words for me. So, what did I do? I googled my answers, what else? :-)

First, I used this video on Youtube to learn about the breadboard and the kit. Then I did it myself, and expanded on it by adding extra LEDs.

Now, that I had the lights working the next step was going to be how do I make them “listen to music”?

Another google search, and I found this awesome open soure project for the Pi called: LightshowPi. And it is with this project that and its Google+ Community that I was able to successfuly complete the first phase of this personal project.

board

The CanaKit breadboard, GPIO board, LEDs and resistors.

pi+tv

The raspberry pi connected to a $80 720p TV I bought at Best Buy. It was cheaper than any other LCD monitor around.

Here’s a quick video of the mini-light show:

So, what’s next?

Now, that I’ve gotten my Christmas Light show going (in a very small scale), I want to go a bit bigger. I want to light up my Christmas tree this year using my Pi and LightshowPi, and do something like this. I have ordered a Sainsmart 8 Channel 5V Solid State Relay Module Board hoping I will be able to pull this off by Christmas. And who knows, maybe next year, I will expand and set up lights outdoors for the public.

3,887 total views, 2 views today

Posted in christmas, linux, raspberrypi | 5 Comments

Fix for Flash Fullscreen Issue on GNOME 3

The issue is basically that once you watch 1 video in Fullscreen with Flash any other video will not show up in fullscreen afterwards. Follow these instructions to fix it. Works well on Fedora 20.

106 total views, no views today

Posted in fedora 20, firefox, flash | Leave a comment