Vision Thing

Enter Your Project for a chance to win an Oscilloscope Grand Prize Package for the Most Creative Vision Thing Project!

Back to The Project14 homepage

Project14 Home
Monthly Themes
Monthly Theme Poll

 

Poop Buster Setup

Beaglebone AI is used to control a x-y gantry robot by controlling it via USB serial port. some videos are attached towards the later part of this blog

poopbuster with makeblock

 

My Journey

I initially struggle with the insufficient disk space on my Beaglebone AI but solve it

Not enough disk space for apt upgrade on Beaglebone AI

 

along the way, we get to know from the community that a fan is needed for BeagleBone AI, else it risks running into overheating. Tariq Ahmad has offered us a fan and mayermakes has made a cap for it, while it is also mentioned inBeagleBone AI (BB-AI) - Getting Started

 

i also find that the wifi on Beaglebone AI is not stable and keep dropping. It is best to use ethernet.

 

supplementary tool

  • install makeblock orion driver

          Learning Arduino Programming – Open-source Arduino Robot Building Platform|Makeblock Learning Resource

          since i am using Orion — Select Arduino Uno in the arduino IDE and its respective COM port.

also, download the makeblock libraries at Makeblock-library-for-Arduino: Makeblock library for Arduino

 

Install processing

  1. Download and install Processing-2.1.2. http://processing.org/
  2. Install the Processing library, controlP5 -- copy the whole folder to C:\Users\xxx\Documents\Processing\libraries
  3. Open the GRemote.pde by Processing, DIY the code and click the “run” button to test it.

Note: can't really use processing due to much works need to done in short time

 

Install serialport for use bonescript

in terminal, type sudo npm install -g serialport

after that, type echo BB-UART4 > /sys/devices/bone_capemgr.*/slots

 

Install minicom

sudo apt-get install minicom

 

i use a Logitech webcam connected to the Beaglebone AI. Photo here shows the x y gantry. This is using MJPG-Streamer. Instruction as in https://www.hackster.io/175809/tidl-on-beaglebone-ai-1ee263

it is also discussed in more details in the AI with Beaglebone section below

gantry

 

Useful Commands

[1] shutdown -> sudo shutdown -h now

[2] reboot -> sudo reboot

[3] to update kernel

cd /opt/scripts

git pull

sudo tools/update_kernel.sh

[4] in nano editor, ^ means ctrl key, e.g:  ^X is ctrl+X , ctrl+o is saving file, it will prompt for filename and we press enter

[5] to clear terminal screen, use clear

[6] v4l2-ctl --list-devices to list the camera connected.

 

Pinout

 

The board photo i grab from https://github.com/beagleboard/beaglebone-ai/wiki/Quick-Start-Guide  shows the subsystem layout

i get to know its pin is compatible with other beaglebone and below pinout is what i get from https://beagleboard.org/Support/bone101 . pin 8 can on P9 header can be used to power up the Nidec fan provided by Tariq.

To check whether our BB AI is alive and kicking, connect to the board via USB at 192.168.7.2. We will reach the screen below.

This can be further referred at https://beagleboard.org/getting-started

 

X-Y Gantry

 

my X-Y gantry is driven by 2 stepper motors. To drive a stepper motor, i use makeblock orion

it has getting started guide here Makeblock Orion – Open-source Arduino Robot Building Platform|Makeblock Learning Resource

Communication between Beaglebone AI and makeblock orion (Arduino Uno with some connectors for makeblock modules)

i use Beaglebone AI to control Makeblock Orion

on terminal, the Makeblock is found to be /dev/ttyUSB0

snippet of code that setup a serial port listener as well as a writer

this is the testing during development

 

AI with Beaglebone AI

The only viable example seems like https://www.hackster.io/175809/tidl-on-beaglebone-ai-1ee263  with the TI TIDL library

i have to admit that after looking at the classifiction.tidl.cpp i have not much clues what it is doing

these codes are screenshot from classification.tidl.cpp

to run it, after press run and type password, it takes up to 4-5 minutes for me to able to use MJPG-Streamer to look at the picture

before that, it will shows the error screen below "beaglebone.local refues to connect"

after it is ready, it suppose to detect object. my BeagleBone AI with the Nidec fan is detected as a cellular phone

To understand TIDL, watch this 13 minutes clip https://training.ti.com/texas-instruments-deep-learning-tidl-overview

 

the C66x is capable for running deep learning inference. The embedded vision engine (EVE) is a subsystem with coprocessor to provide further video processing and deep learning acceleration. The AM5749 on beaglebone AI contains 2x EVE. As of current, the TIDL supports spatial data input (ie. Video, image, TOF, radar etc)

 

More details about the workflow can be found at http://downloads.ti.com/mctools/esd/docs/tidl-api/intro.html

However, the url to download the convertor tool is down, so I don’t try with the TIDL translator tool

http://downloads.ti.com/mctools/esd/docs/tidl-api/example.html contains a lot of examples on how to use the TIDL API.

 

to run the example need to use sudo, ie. debian@beaglebone:/usr/share/ti/examples/tidl/ssd_multibox$ sudo ./ssd_multibox

 

To view processed image, I use eog. Install it by using

sudo apt-get install eog

 

Problems Encountered

this section mainly list down problem i cannot resolve

-The beaglebone AI HDMI output works with my normal PC monitor. But it fail to output to my Seeedstudio 10.1 inch display. Originally want to use the 10.1' display as a console. Anyhow i also notice that the Beaglebone AI runs significantly slower when it is connected to a monitor and keyboard, so the incentive to stay connected via USB type-C is a bigger pull.

-non availability of tool for doing deep learning model conversion into TIDL format. even if it is available, i doubt i have time to explore

 

Reference

[1] https://www.instructables.com/id/Wireless-Arduino-Control-Using-the-BeagleBone-Blac/

[2] bonescript https://github.com/jadonk/bonescript

 

Wifi Command Reference --> this is unstable. better use ethernet

[1] connect to wifi .

debian@beaglebone:/var/lib/cloud9$ sudo connmanctl⏎

Note: wifi  enable wifi

[sudo] password for debian: temppwd⏎

connmanctl> scan wifi⏎

Scan completed for wifi

connmanctl> services⏎

  MyWifi wifi_1234567890_1234567890123456_managed_psk

connmanctl> agent on⏎

Agent registered

connmanctl> connect wifi_1234567890_1234567890123456_managed_psk⏎

Agent RequestInput wifi_1234567890_1234567890123456_managed_psk

  Passphrase = [ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]

  WPS = [ Type=wpspin, Requirement=alternate ]

Passphrase? MySecretPassphrase⏎

Connected wifi_1234567890_1234567890123456_managed_psk

connmanctl> quit⏎

debian@beaglebone:/var/lib/cloud9$