Showing posts with label camera. Show all posts
Showing posts with label camera. Show all posts

Friday, March 16, 2018

Aerocore 2CD for Dragonboard 410C Camera and Display Demo

Today was the 96Boards Open Hours demo for the next Aerocore 2 MAV board.  I set up a test rig, hooked up 2 OV5640 CSI-2 cameras and a DSI OLED display and showed the 96Boards community what the Aerocore 2CD for Dragonboard 410C can do.

If you tuned in, thanks for watching.  If not, I'll add a link to the YouTube video as soon as it's up.  Either way, I promised to make all of the resources I used to get this demo up and running so that you can do it too.

I first demonstrated the Aerocore 2 for Dragonboard 410C on a quadrocopter drone last year, and wrote a how-to post about setting it up. This time, there was no drone, but instead there were 2 5.0MP cameras and a 5.5" OLED display.

So this is how I got my Dragonboard 410C to do all kinds of cool video tricks:

Getting Ready

Before I dive into the setup procedure, let's just talk about what we're really doing.  The Dragonboard 410C is really an exceptional SBC with lots of neat features, including high-speed and low-speed mezzanine connectors.  The inclusion of the high-speed header on the Dragonboard, and incidentally as part of the 96Boards CE spec, means that hardware developers can create expansion boards that have high speed features like SATA, PCI-express, or USB3.0.

The new Aerocore 2CD takes advantage of this high-speed connector to provide 3 high-speed LVDS interfaces: 2x 2-lane CSI-2 camera connectors and 1x DSI display connector.  In order to demonstrate these new features, I am going to connect 2 KLT-OV5640 camera modules, and an OSD055A AMOLED display to the Dragonboard, and using only GStreamer commands in some simple BASH scripts, I will stream camera 1, camera 2, or both cameras concurrently, over UDP to my desktop PC.

Then I will stream the same camera output to the XFCE interface on the connected OLED display.


the bits


It's not a bad idea to make some mounting brackets for the cameras and display to make it a more manageable rig.  For my demo I designed something in FreeCAD and printed it off on my personal 3D printer.  Also there are simple brackets you can make that will hold the cameras' connectors in place.


In addition to the hardware above I used the following files:

On my desktop I'm running Ubuntu 16.4.

Assembly and Setup

Bracket1 and Bracket2 have spaces in which the cameras sit.  The forward camera fits sung, but the rear bracket's camera mount was a little too thin on one side so it doesn't hold it still on its own.  That's okay though because I was already planning on taping them down for the demo.  At this point I also attached the display's ribbon cable to the Aerocore (pads up).

The standoffs connect to the topside of the Areocore board with 2.2mm screws but, due to some scaling issues with my 3D printer, the diameter of the screw holes was just a bit too big so I found two risers with slightly wider threads, which worked nicely.

Almost done...
Next, I attached these brackets to the display panel's frame.  I'd tried mounting the panel inside the frame but they're very delicate and I broke my first one.  That's going to take a redesign.

I connected the DSI ribbon (pads down) to the back of the display and taped the display down inside the frame's bevel.  Carefully.  Finally, I attached the Dragonboard to the underside of the Aerocore.

Down-facing camera peeks out past SD card
I copied the SD card image to a 16GB SD with dd card and expaneded the root filesystem's partition with gparted (the disk image's rootfs partition is only 2GB to reduce download and dd time). With the card in the Dragonboard's SD card reader, it was time to fire it up.

I plugged it in, lights began to flash, bootlog messages came up on the console, and then... nothing...  The OLED display stayed dark.  Why?

Well the Dragonboard's HDMI interface has a little secret:  It's really HDMI over DSI!  The video output to the HDMI device is muxed with the DSI lines on the HS header.  You select one or the other with one of the S6 dipswitches on the Dragonboard's backside.  So once I toggled that to off and powered up my board again, up came my XFCE desktop!  Cool!

XFCE up and running!
I installed the GStreamer plugins on both my desktop PC and on the Dragonboard 410C.  Gumstix's Yocto images use the Smart package tool:

# smart update
# smart install gstreamer1.0 gstreamer1.0-plugins-good  \

I copied to the dragonboard and tested out the video feed to the DSI display.  The script is set up so that you can do that, or stream it over TCP/UDP for any or all cameras.

To stream it to your PC, type this at the Dragonboard's command prompt:

# -i <host-ip-address> -c N

where <host-ip-address> is your PC's address and N is '1' for the downward-facing camera, '2' for the front camera, and '3' for both together.

To stream it to the display, just omit  ' -i <host-ip-address>'.

Okay, Next!

That's it.  That's all I had to do. I hope I get the chance to put this stuff on a drone or robot and do some OpenCV work.

Meanwhile, I think I'll write up a quickstart guide for the storefront, a little more formally.  I'm still trying to get my LoRa gateway outside and I've got some bugs in the backlog, but I'm sure I'll get back to Aerocore, MAVs or robotics-type projects soon.

Hey, if you have any ideas for new projects, let me know! Follow me on Twitter @gstixguru or drop me an email at

Friday, March 17, 2017

Gumstix Pi Compute Boards are CM3-Ready

If you follow me on twitter (@gstixguru), you might know that I recently ordered an RPi CM3.  Lots of people have been contacting us to find out how well our Pi Compute boards support the new, faster module, so I found a bit of time to play around with it.  I'd worked with the original CM on our dev board for my GPS and RTK project a year ago with great success, and was looking forward to getting back to the Pi Compute boards.

First Steps

As always, my first step was to flash a brand new image onto the CM's eMMC.  I downloaded the latest Raspbian Jessie Lite ISO and mounted my CM on a Gumstix Pi FastFlash.  Next, I ran rpiboot, plugged the board into my USB hub and CROSSED MY FINGERS!

RPi CM3 on a FastFlash getting flashed. Pardon the clutter.
So what happened next?  Exactly what should:  the eMMC was mounted to my file system like any unpartitioned flash drive would be.  So I dd'ed the image, moved the module over to the Gumstix Pi Compute Dev Board and got ready to Pi.

First Boot

At first, all I wanted was proof of life.  That and I was sure the default wpa supplicant and network interfaces config would not get me on the WiFi network.  So I screen'ed in and powered up the board.  And yes, the console came to life, spewing forth those familiar Linux startup messages.  No kernel panic, no errors, no problem.  So far so good. Raspbian Lite was up and running.  Oh, all the things I should test: GPIOs, I2C, SPI....  BORING!

Let's start with USB (Oh, and get the WiFi up and running while we're at it; screen is not my friend and SSH makes me smile:).  The WiFi dongle goes into the port and lsusb shows a list of devices.  And there it is.

Bus 001 Device 002: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

Beautiful.  I fix up /etc/network/interfaces and add the office WiFi network to wpa_supplicant.config and shut it down.  Time to set this asside and get back to my other tasks.

Day 2

Before ditching the USB console connection, I have to go into raspi-config and enable the SSH host, and reconfigure the daemon:

sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh_server
After a restart, ssh works fine.

Let's got straight up the food chain to the camera!  That's what I want to see!  I want to get that Sony IMX219 taking stills and recording videos.  I want to see those LVDS signals in action.  The CSI-2 camera connector is by far my favorite feature of the dev board.  So while I was in raspi-config, I made sure to enable the camera as well.

Here's my Frankenberry Pi camera rig, ready to go, I hope.
So I hooked it up, fired up the module and... nothing.  Did I forget something?  Of course I did! I needed the device tree overlay blob for the camera.  Oops.  OK, so I grab the binary, -- I get the one for both camera and display, just because I can -- copy it to the boot partition and restart.

And did it work?  See for yourself:
Me and my clipboard.
Edit: Here's me trying to pretend I'm not being recorded by the Pi Camera:


I also took a few minutes and got the USB-Ethernet board fired up, and yes, everything works great.
I am very happy.  Stay tuned!  I have a Raspberry Pi DSI display around here somewhere and I want to get that up and running too.