TL-WR703N Example Project 4 : Webcam Streaming

Connecting a webcam and using the router to stream video around the place should be one of the easiest things to do. A bit too easy in that I neglected to provide simple instructions on how to set it up.

mjpg-streamer and the necessary drivers are included in the standard images I provide on the TP-Link TL-WR703N project page.

Preliminary steps :-

  1. Get a router, load it with the standard image.
  2. Set-up wireless or any other networking changes.  See an example here.
  3. Plug in the camera

Now there are two ways to get mjpg-streamer to auto-start, there is an easy way and an elegant way.

  • Easy way : Just add the command to the auto start script using LuCi…
  • Elegant way : Edit the configuration files /etc/init.d/mjpg-streamer and /etc/config/mjpg-streamer

I prefer the easy way you are less likely to screw it up.  First we should check that the camera works well with mjpg-streamer…

  1. Telnet/SSH into the router
  2. Run the following command :

    mjpg_streamer -i “./input_uvc.so -n -r VGA -f 6 -d /dev/video0” -o “./output_http.so -p 8080 -n”

    This command uses VGA (640×480) resolution “-r VGA” at 6 frames per second “-f 6”.

  3. If that doesn’t work and an error appears, it most likely means your camera doesn’t support JPEG images.  If so, try the following command instead :

    mjpg_streamer -i “./input_uvc.so -n -q 60 -r QVGA -f 6 -d /dev/video0” -o “./output_http.so -p 8080 -n”

    This command forces mjpg-streamer to convert into raw into JPEG at (-q) quality 60, at resolution (-r) QVGA, this can be “160×120” for example.  The frame rate is specified by the -f (6).  This method is MUUUUUUUUCH more CPU intensive and you might have to tweak the resolution and frame rate down.

  4. Using a device connected to the router, use a web browser (e.g. Chrome) to connect to the following to get a live view:

    http://192.168.1.1:8080/?action=stream

    You can also get a single snapshot at:

     http://192.168.1.1:8080/?action=snapshot

  5. If you need to play around with the commands, use CTRL-C to kill mjpg-streamer and try again.  Avoid high resolutions (e.g. 1920×1080) as that will just crash the router.  I used 640×480 at 25 frames per second relatively happily on a JPEG enabled camera (e.g. Logitech/Microsoft ones, not the cheap no brand ones).
  6. Once you have a workable set-up, copy the command you have and put it into the local start-up.  Append the command line with an ampersand “&” so it runs in the background.  e.g.

    mjpg_streamer -i “./input_uvc.so -n -r VGA -f 6 -d /dev/video0” -o “./output_http.so -p 8080 -n” &

    Hint – In Luci, select the Systems tab, then select Startup, scroll down to the Local Startup section and add your command to the box and press save and apply.

Enjoy? 🙂

Chumby + iPhone + Android + Mecanum Wheels

Couldn’t resist extending the software test on the mecanum wheel base…video comes later this time…

The ‘quick and nasty’ software files are still the same as in the previous post.  Pure software test only, couldn’t resist the temptation to try it via WiFi on a stock Chumby instead of USB tethering.  As such the hardware frame is a bit too flimsy and the batteries aren’t enough to power the Chumby without brown-out resets.  These will be improved upon soon 🙂

This demonstrates the ‘touch’ (initialize) and ‘swipe’ (move/offset) control on touch screens.  Will try the DeviceMotion Javascript API on iOS 4.2 devices (iPhone 4G/iPad) if I can get my hands on that filth… 😛

Continue reading “Chumby + iPhone + Android + Mecanum Wheels”

EasySync USB-CAN Bus Adapter – Works great in Ubuntu after some fiddling

Neat little package
Neat little package

The toys just keep coming in!  Another one of those wallet killing impulsive orders whilst I was sick in bed last week just arrived today, a USB-CAN bus converter module by EasySync that promises a great interface and should work in Linux!  This will give a little bump start to my Mazda CAN Bus / mChumby projects.

Note : EasySync UK’s online form doesn’t allow international shipping but a short E-mail or two managed that.  There is a US subsidiary with US and international shipping, but the international shipping rates on the US site is plain ridiculous [$68USD to ship a $88 device to Australia].

Note 2 : I hear the interface is mimicking the Lawicel CAN-USB interface…only hearsay…

Plugged it in – didn’t work.  Doh!  Took a peek at the manual and website, nothing on Linux other than “Linux drivers provided”… So much for the marketing material, guess I have to try make it work myself.  (Yes I got it working, read on for the quick run-down post aimed at helping others)

Continue reading “EasySync USB-CAN Bus Adapter – Works great in Ubuntu after some fiddling”

Ubuntu 9.04 – Jaunty Jackalope AMD64 (64 bit)

I’ve finally made the jump and using the AMD64 version of Ubuntu as my primary installation.  There are a couple of tricky things to deal with, primarily with closed sourced applications such as Adobe Flash Plugin and Skype which are two applications I need to use.

How to install Adobe Flash Plugin 64 Bit for Ubuntu 9.04

A lot of the tutorials/guides online will tell you to use nspluginwrapper or similar.  Adobe has released an ‘alpha’ version of their 64 bit player which is pretty stable so far…

Download it from :-http://labs.adobe.com/downloads/flashplayer10.html

Unpack the archive and copy the only file to the Firefox plugins folder in ‘/usr/lib/firefox-addons/plugins‘ :-

sudo cp libflashplayer.so /usr/lib/firefox-addons/plugins

How to install Skype 64 bit for Ubuntu 9.04

You would think you could just go to www.skype.com and ask for a download and it’ll be like the Adobe site detecting that you have a 64 bit system right?  Wrong (at time of writing).  Annoyingly that’ll just let you download an i386 package!

You could manually remedy this by downloading the AMD64 .deb package from :-
http://www.skype.com/go/getskype-linux-ubuntu-amd64

Everything else?

So far the respositories have been kind to me… but i’ll update if I run into any other troubles 🙂

Voila happy 64 bit Ubuntu’ing.

Essential Free Software for a Windows Install

Yesterday I went and bought a laptop for my dad to learn how to use computers and the internet.  A base install of windows is not functional nor safe enough to let loose on the internet without some additional software.  Being an avid fan of things that are free, I went and downloaded the latest versions of free software that I thought would be essential for this new PC.

I hope this post is useful for other people, but its really a lazy way of me bookmarking everything in-case I have to do it again.

Continue reading “Essential Free Software for a Windows Install”

Parametric Modelling in Google Sketchup and Ponoko friendly SVG export for Sketchup

The problem

I’ve recently signed up Ponoko’s Prime account and wanted to get something made.  I rather into a rather annoying problem, Alibre Xpress doesn’t have a SVG export.  I needed a way to design something and export it as SVG.

I’ll admit the long post title is a problem too 🙂

Continue reading “Parametric Modelling in Google Sketchup and Ponoko friendly SVG export for Sketchup”

Compiling a toolchain for ARM7 under Ubuntu

Well this chronicles my first attempt at compiling a toolchain for programming ARM’s in ELF code.

Why do I need a toolchain for programming ARMs?

  1. I found a LPC2378-STK development board in my room
  2. I want to give ARM programming a try (PS WinAVR is great for programming AVRs)
  3. I found I have some spare ARM7 LPC2378’s lying around (WTF?) and thought I’ll actually complete my Chumby Speedometer on my car project!

Continue reading “Compiling a toolchain for ARM7 under Ubuntu”