Showing posts with label single board computer. Show all posts
Showing posts with label single board computer. 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.


Materials

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.


Software

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  \
  gstreamer1.0-plugins-bad



I copied cam_demo_dev.sh 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:

# cam_demo_dev.sh -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 keiththegumstixguru@gumstix.com.

Wednesday, February 15, 2017

There is Nodana...

96Boards

For those of you who don't know about the 96Boards open-specification hardware platform, it's a design spec for single-board computers (SBCs) that enables SoC vendors to provide their hardware in a standard form factor for increased compatibility.  It's also an engaged community working together to develop applications, software, and mezzanine cards for this ecosystem.

96Boards now has 3 different specifications for 3 classes of application.  There's Consumer Edition (CE), with standardized breakouts for both high-speed and low-speed signals, USB ports, HDMI, and so on.  There's also the Enterprise Edition (EE), which is more for server and networking applications.  It's a larger and more free-form design, with a low-speed header, USB and Ethernet, minimum 1 GB DRAM or expandable SODIMM slots, and optional 1 - 16 x PICe.  Finally there's the brand new IoT Edition (IE) spec.  It's designed to be tiny in order to fit anywhere.

All of these specifications have variants that allow hardware developers to add extra bits to their boards, making this a very flexible way of standardizing the important parts of SBCs.

The big benefit is that you can unite developer communities accross platforms.  The mezzanine card or maker project developed for board A will be compatible with board B, and vice versa.  With support from Linaro, providing a common Linux ecosystem for these boards, not even software compatibility should get in your way.

My honest opinion is that this open specification is very cool.

Gumstix is a 96Boards Partner

Yep, we're in cahoots with the folks at 96Boards and Linaro to bring you compliant hardware.  The release of the AeroCore 2 for Dragonboard 410C was only the start.  At the same time, we added the 96Boards Mezzanine Connector module to Geppetto D2O's library so that users can design their own mezzos for other applications.  If you don't know what Geppetto is, you can learn more by going to the Meet Geppetto page, read my earlier posts, or go straight to geppetto.gumstix.com and give it a try.

I did a demo for 96Boards OpenHours, hosted by Mr. Robert Wolff (@sdrobertw) and actually flew my MAV, using a Dragonboard and the AeroCore 2 live in my office -- complete with a visit from the "demo demon".  The whole thing's on YouTube.



...Only Joule

So for those of you who don't know, a little compute module was released last year with quite a lot of juice hidden under its heat dissipator. The Intel® Joule™ module delivers unprecedented compute power in a tiny package.  From its two 100-pin Hirose connectors pour USB 3.0, MIPI LVDS,  PCI Express, HDMI, and a lot of what you already expect from COMs and SoCs.  It also houses its own WiFi and Bluetooth hardware.  All with the power of a quad-core processor akin to the Core-I7s you find in your desktop PCs.

Surprise, surprise, Geppetto's got that too!  You can go in and build your own host board using the Intel module and harness most of what it has to offer.

So a Square Peg and a Round Hole Walk Into a Bar...


On one hand you have this fantastic open spec hardware platform [round hole].  In the other, this epic compute module [square peg].  "those will never fit together," you might say (in fact, one 96Boards community member did).  Well, we gumstixians are very resourceful.  And the spec doesn't restrict the SoC's architecture to ARM, that's just the expectation.  So what did we do?  We took all of the components that make the 96Boards Consumer Edition spec great, we wired it up to the Joule connectors, (tested it), gave it a name, and unleashed it on the unsuspecting masses.

And that is how the Nodana 96Boards Consumer Edition (96BCE) for the Intel Joule module came to be.  Here it is:

Gumstix Nodana Features

The Black Sheep


That's right, all you doubters.  Now you can test your 96Boards projects on a powerful 64-bit multi-core Intel chip.  It's the first of its kind -- the first non-ARM 96Boards device.  Take it for a spin and tell me about what you do with it.  You can order it at store.gumstix.com/nodana-96bce.html

x86 IoT Fun

Psst!  We are also taking the IE spec to this dimension.  Our Radium 96BIE board complies with the 96Boards IoT Edition specification and runs the Intel® Curie™ module.  A 32-bit Quark processor  in bed with an ARCv2 MCU, a 6-axis internal measurement unit (IMU) and an independently programmable Bluetooth controller. Check it out at store.gumstix.com/radium-96bie.html.

Friday, November 4, 2016

How I Got My Dragonboard 410C Airborne

I was recently a guest on 96Boards OpenHours to demonstrate how the Aerocore 2 for Dragonboard 410C can be used to quickly and easily build a working quadcopter.   I even powered it up and tested it out indoors live.

If you want to see what happened, check out the YouTube video. The test flight happens at around the 40-minute mark.


Drones are awesome and not that hard to set up.  You can follow along with me if you're building your own.  Once you've got your rig put together, then you can start adding software to the Dragonboard -- or Any 96Boards CE SBC -- to turn it into a self-piloting, obstacle-avoiding, object-following marvel of automation... or whatever it is you plan to do with it.

To find out more about the Aerocore 2 for Dragonboard 410C, you can read my previous post or watch this promo video

The Parts

 The first step in building your quadcopter is to make sure you have all of the hardware you'll need.  Here's what I had on-hand:



You know you work somewhere cool when you can assemble a drone from hardware lying around the office.

The Prep

To keep this post brief, I'm going to glaze over the following steps.  They're fairly straightforward and unrelated and ubiquitous in MAV deployment so there are plenty of instructions available on the web.


  1. Assemble your drone kit.
    • Do not attach the rotor blades yet. You really don’t want your drone unexpectedly taking flight in the middle of your office/house/garage.
  2. The 12V battery connector and regulator on the Aerocore can handle the main battery’s output but there is no built-in connector on the drone or the battery.  
  3. solder-highlight.png
    • You can solder some jumper wires onto one of the motor power terminals on the base plate of your drone (circled in green here)
  4. Make sure you’ve flashed your Dragonboard with Linux. Linaro’s Debian 16.09 was used for this demo.
  5. Build QGroundControl.
  6. On your dragonboard 410C install the necessary packages
    • $ sudo apt-get update && sudo apt-get install python-wxgtk3.0 python-pip python-numpy python-dev libxml2-dev libxslt-dev gstreamer1.0-tools
    • $ sudo pip install pymalink
    • $ sudo pip install mavproxy
  7. Bind your satelite DSM receiver with your radio

(UPDATE:  Since the original project was completed, something about the pymavlink pip package has changed and will no longer install dependencies correctly.  therefore, add python-lxml to your apt-get command before installing pymavlink and mavproxy)

Put It All Together

Now the fun stuff can begin!  It's time to get everything hooked up and ready to fly.

Step 1: Attach your boards

With this thing going up in the air, you won't want your hardware sliding around at all so it's good to put some thought into how your boards are mounted.  The chassis I'm using doesn't have what I'd call a universal mounting system, so I made my own.  The box for an Intel Edison turned out to be just the right size and very sturdy.  I've already been using one on the rover in my RTK project to house a Beaglebone Black.

Some zip ties, screws and risers quickly transformed the cardboard box into a mounting bracket for my Dragonboard.  A touch of shameless self-promotion and it's ready.

Board goes on brackets, Aerocore on board.  I used a bit of electrical tape to hold the receiver in place and was ready to wire it up.

Pro-Tip:

MAVs tend to have alarm buzzers, used to indicate low battery and signal loss.  This is very important when in flight, but when you're setting everything up it can be really annoying.  Thankfully, the buzzer on the Aerocore 2 has a bypass circuit. After soldering a 2-pin header on the underside of the Aerocore, directly underneath the buzzer, you can use a jumper to deactivate the alarm.  For obvious reasons, I don't recommend hard-wiring the alarm bypass.  The picture to the right should help you find the two vias to connect.


  Step 2: Connect Wiring

One benefit of using a box as a mounting bracket is that it has proved to be the ideal place to hide excess wiring.  I cut a small opening in the bottom of the box and fed all of my wires in and through.  I got my hands on a webcam and managed to squeeze its base and cable in there too.  I labeled the following image so you can see where the various connections are.

Not having previous experience with MAVs, I had no idea what order to hook the electronic speed control PWMs in.  It took me a while, but I figured it out.  I put together an infographic for the rest of the amateur MAVers so that you don't have to struggle like I did.

Step 3: Software

The final pre-flight step is to configure your software.  There are three steps:
  1. Flash PX4 firmware to the MCU
  2. Start data pipeline on the Dragonboard
  3. Calibrate on-board sensors

QGroundControl makes programming and configuring your drone a snap.  Open up the program and go to the setup tab (Selection_065.png).  Along the left-hand side will be a button labeled “Firmware”. When you click on this button and then connect the Areocore 2 MCU’s “stm console” via USB, QGC will guide you through the flash process.
microcontroller-console.png

The rest of the pre-flight work can be done over WiFi on the Dragonboard. Going wire-free will also make calibration a little easier.

Disconnect the USB cable from your Aerocore and connect the battery. Once the MCU and Dragonboard boot, SSH into the Dragonboard and enter the following command:

mavproxy.py --master=/dev/ttyMSM1 --baudrate 115200 --out xxx.xxx.xxx.xxx:14550 --aircraft MyCopter
Where xxx.xxx.xxx.xxx is the IP address of your PC.

Once the MAVlink command interface comes up on the Dragonboard, QGC should be able to connect to your drone. If it does not connect correctly, you may have to add a UDP connection to QGC’s settings.  The setup screen should look simmilar to the following screenshot:

drone_setup.png

If this is the first time your Aerocore has been configured, the cicles that appear green in this shot will be red and you will not be able to deploy your drone until they all appear green.

Configuring your drone and calibrating the sensors is very straightforward thanks to the self-explanatory interface in QGC.  Click on each item along the left-hand side in turn -- apart from “Firmware”, which you have already done -- and follow the on-screen instructions.  Once all the lights are green, you’re ready to fly.

The final, and completely optional steps are getting the camera feed from the Dragonboard to QGC, and attaching a Pre-GO GPS module.  

Adding a GPS module is very easy.  Once it’s connected, it will work right away.  Connect it to the 5-pin molex connector next to the DSM satellite receiver connector.  Power down your drone and plug the module in using the included cable, and it's ready.  I added mine last thing right before the live test flight and it worked with no set-up required.

The video streamer, like the MAVlink proxy, is a single command on the Dragonboard:


gst-launch-1.0 uvch264src initial-bitrate=1000000 average-bitrate=1000000 iframe-period=1000 \
   device=/dev/video0 name=src auto-start=true src.vidsrc ! video/x-h264,width=1920,height=1080, \
   framerate=24/1 ! h264parse ! rtph264pay ! udpsink host=xxx.xxx.xxx.xxx port=5600


With both the proxy and the video feed running on the Dragonboard, your flight screen will look something like this:

in-flight.png

If you have added a Pre-GO GPS module, your drone’s location will appear in the navigation map seen here in the inset. You can switch the primary view between the video stream and the navigation map by clicking on the inset in the bottom left-hand corner.

 

And There You Have It...

You now have yourself a working drone.