Following on from Getting started with Dragonboard 410c
For my project to work, I need the following:
- Internet connectivity
- Webcam
- Python
- OpenCV
- GPIO
I decided to tackle the software elements first as those were the areas I was least familiar with.
Trouble with Wifi
Now that I had a working Linux install my next step was to get the Wifi connected. That was very straight forward, or so I thought. The Linaro/Debian desktop provided a status bar widget where you could select the Wifi and enter pass code. I did that an it connected just fine. However, shortly after it dropped out reporting that it was disconnected. I moved the board slightly and it reconnected.
I tried a range of different locations and even turned off the Rii keyboard incase that was interfering with it. Nothing improved the situation. However, I did have a USB to Ethernet dongle from work which I plugged in and connected up. That was detected automatically I was now on the net reliably. If I have time I'll investigate the Wifi further but for my purposes the Ethernet is just fine.
I installed Bonjour on my desktop and was able to connect to the Dragonboard by name using SSH without any issues.
Camera
I was expecting the camera to cause me problems as it was an old one from my Dad's junk box.
I plugged it in and ran lsusb, it correctly detected it as a Logitech QuickCam Express.
To test the camera I installed "streamer", and captured a test picture of a cat. I've yet to play with the settings on streamer so this is just a low colour version.
Python
I wanted to use Python to control my project as it is quick and easy to prototype code like this. I also wanted to communicate with the internet for the purpose of notify the user, so I installed Pycurl too.
To install Pycurl, I need to install PIP (the python package manager), so I used the get-pip.py script to do that. I had to install a few pre-requisites too.
sudo apt-get update sudo apt-get install libcurl4-openssl-dev python-dev pip install pycurl
To test PyCurl was working, I downloaded a simple web page.
from StringIO import StringIO
import pycurl
import signal,sys
def call_api(url):
r = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, url)
c.setopt(c.CONNECTTIMEOUT, 10)
c.setopt(c.TIMEOUT, 60)
c.setopt(c.WRITEFUNCTION, r.write)
c.perform()
c.close()
return r.getvalue()
def main():
r = call_api("http://csb.stanford.edu/class/public/pages/sykes_webdesign/05_simple.html")
print r
# Handle exit and kill from OS
def set_exit_handler(func):
signal.signal(signal.SIGTERM, func)
def on_exit(sig, func=None):
print "exit handler triggered"
sys.exit(1)
# Run program
if __name__ == '__main__':
set_exit_handler(on_exit)
sys.exit(main())
OpenCV
After trying to compile software on the Arduino Yún last year, I expected that OpenCV was going to be an issue. However, I followed the instructions to install any dependencies, and configured the make file. That all went smoothing. The compile took a couple of hours, I was not surprised as OpenCV is quite sophisticated.
It compiled successfully, but I've yet to test it as it was quite late when it finished.
Next up GPIO, there's a few different libraries for this but Intel's MRAA seems to have the most potential for what I'm trying to achieve.
Reference





Top Comments