#PiCamMobile in Action

33 total views, 1 views today

Posted in raspberrypi, raspbian | Leave a comment


I took my Raspberry Pi Mobile Cam project, and added a functionality to it that allows me to post pictures to twitter.

Keep an eye on the #PiCamMobile hashtag.

135 total views, 3 views today

Posted in raspberrypi, raspbian, twitter | Leave a comment

[Update] Turning a Rapsberry Pi into a portable streaming camera

This week I decided to kick off a new Rapsberry Pi project, since it’s been a bit too long since my last projects (see: Christmas Lights, Musicbox).

For a few months now, I’ve been wanting to play around with a Raspberry Pi Touchscreen, and I’ve been meaning to buy the Pi Camera as well. Therefore, I went ahead and ordered them both from Adafruit. [I went with the¬† 3.5″ PiTFT Touchscreen]

Once they arrived, I started to do some reading online on how to get them installed. The PiTFT requires you to customize your Raspbian install a bit, but the directions were pretty straightforward. The only couple of issues I had to deal with were that at first I didn’t have the screen seated well enough on the GPIO pins, and it didn’t turn on. The other one was a bit more complicated. If I used lightdm to auto-login into LXDE, the screen would go black right after the boot screen. If I logged into just a console (ie disabled lightdm) everything would work fine.

The fix ended having to tell Xorg to use /dev/fb1 as the display device, and to do that you should do the folliwng:

Install framebuffer driver:

sudo apt-get install xserver-xorg-video-fbdev

Create file: /usr/share/X11/xorg.conf.d/99-fbdev.conf

Section "Device"  
  Identifier "myfb"
  Driver "fbdev"
  Option "fbdev" "/dev/fb1"

Original Source

This should allow lightdm to start up and auto-login into Xorg on your Raspberry Pi as shown no the next picture.

20150812_135525_HDROverall the PiTFT is nice enough for the price, but I found the sensitivity of the touchscreen to be sub-optimal. I haven’t tried to see if there is a way to tune it yet, but I will eventually.

To install the PiCam, I just searched on YouTube for a tutorial, and made sure I enabled it on the raspi-config cli program. Like the touchscreen, I feel like I didn’t plug in the camera quite right the first time around, so I had to adjust the ribbon a bit better. One other thing that I did which I can’t recall if it was on any of the instructions I read was to enable SPI via raspi-config.

The picture below has the PiCam up and running.

20150812_164856_HDRThe Raspberry Pi comes with a few tools that allows you to interact with the camera. See them at https://www.raspberrypi.org/documentation/usage/camera/raspicam/

The CLI tools are nice, but I wanted to take it one step further, I wanted to be able to move around with the Pi, and possibly stream live video from the PiCam. [Note: This is not my original idea, other people have done this before, I just wanted to do it as well :-)]

The next step was to try to find something a bit more “user friendly” than a CLI commands for me to do the streaming with. For now, I’ve settled with the Pi Cam Web Interface project.

Again, instructions were pretty straightforward, although, it worked better using Apache as a web server than Ngnix. Given memory is limited, and Ngnix is known for its small memory foot print, I definitely want to try re-installing this using Ngnix again in the near future. It is also worth reminding everyone that after installing Pi Cam Web Interface, and you have set it to auto-boot, you still have to start up the camera via the RPi_Cam_Web_Interface_Installer.sh. I am sure there is a way to make the camera auto-start as well, I just haven’t taken the time to do it. :-)

With Pi Cam Web Interface working, you can easily view live streams from your Pi Cam, by hitting the IP/URL of your Raspberry Pi on a browser within your network (or localhost if on the Pi itself).

The last piece of the puzzle was for me to set up the Pi in a way that I could kick off the local browser via touch screen so I can start seen the video. I decided to install Chromium on the Pi and run it in kiosk mode against localhost. It works really well.


The final product. Mounted PiCam on a Raspberry Pi 2 and PiTFT screen running on battery power.

Oh, and of course the battery. I am using an Anker 12000mah external battery which actually is pretty massive and heavy. I think for demonstration purposes it may be worth picking up a smaller one some time in the future, and a smaller micro-USB cable as well, just to show how compact this project can really be. The case you see on my pictures is just the standard case that comes with the Raspberry Pi 2 when you back one with the Canakit.


A little electical tape to mount the PiCam on the Pi case…

And that’s the project so far! It has been a lot of fun, and I’ve learned a few more things about the capabilities of the Raspberry Pi. I still have quite a few things I want to improve on this particular project like:

  • Hide “Reboot/Shutdown” server from the Pi Cam Web Interface so I can share live streams with friends w/o having to worry they are going to troll the server.
  • Make camera start up under Pi Cam Web Interface automatically after reboot, instead of manually as I am doing now.
  • Auto start Chromium in Kiosk mode. (Right now you have to tap on an icon).
  • Possibly shorter cable and smaller battery.
  • Some memory tuning: use Ngnix, tune RAM usage with raspi-config, possibly kill off other processes that may not be in use, etc.

My dog is never amused when there is a camera pointed at him

One final thought some what unrelated, I became interested on the PiTFT because I want to be able to start/stop my Christmas light show w/o needing network connectivity or a ‘normal’ monitor around. Given the connectors for this PiTFT plugs over the entire GPIO port, I am going to have to figure out how to map the pins needed for the PiTFT to work, while using the other pins for the light show, but that’s the subject for a future project.

[Update 15-AUG-2015]

I worked on refining a bit more this morning, and here’s what I have to share.

1. I switched from Apache to Nginx, and things are running pretty well. Make sure you stop/remove Apache before starting Ngnix.

2. I was able to keep the user/password authentication from my Apache install under Ngnix, but Ngnix doesn’t support .htaccess file, so I had to go under /etc/nginx/sites-enabled/rpicam, and added the last 2 lines in the / (root) location block.

location / {
try_files $uri $uri/ /index.html;
auth_basic "RPi Cam Web Interface Restricted Area";
auth_basic_user_file /usr/local/.htpasswd;

3. I changed the GPU memory from 128 MB to 16MB using raspi-config, and it feels like the PiTFT is responding better to clicks now.

4. I made a copy of the index.php that comes with Pi Cam Web Interface, removed all buttons, and forms, and made this the “public” facing page. (This is the one I would share with anyone who wants to watch the stream coming from my Pi)

5. I renamed the original index.php, and on the script, I have added a check to only allow a person in if they are coming from (ie from the Pi itself), I have also added a stylesheet to the BODY tag to zoom the entire page 75% for better display on the PiTFT, and finally I added a javascript button that allows me to close chromium and get out of kiosk mode.

5,098 total views, 14 views today

Posted in photography, raspberrypi, raspbian, streaming | 2 Comments

Fedora 22: Running Chrome’s Flash plugin on Firefox

See: https://copr.fedoraproject.org/coprs/dacr/freshplayerplugin/

[Update: 2015-08-01] Repo removed. No idea what happened here. :-(

270 total views, 3 views today

Posted in chrome, fedora 22, firefox, flash | Leave a comment

A couple of new articles…

Last week on opensource.com about the STEM project:


And this week, an interview turned into article by the folks on DevOps.com


649 total views, 3 views today

Posted in article, devops | Leave a comment