Difference between revisions of "BeagleBone"

From Robert-Depot
Jump to: navigation, search
(Make a Service)
(Make a Service)
Line 158: Line 158:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
==Make a Service==
 
==Make a Service==
#make a service file: <syntaxhighlight lang="bash">
+
make a service file:  
 +
<syntaxhighlight lang="bash">
 
vi /lib/systemd/system/cvxmirror.service
 
vi /lib/systemd/system/cvxmirror.service
 
</syntaxhighlight>
 
</syntaxhighlight>
#'''cvxmirror.service''': <syntaxhighlight lang="bash">
+
'''cvxmirror.service''':  
 +
<syntaxhighlight lang="bash">
 
[Unit]
 
[Unit]
 
Description=Runs looping convex mirror code
 
Description=Runs looping convex mirror code
Line 173: Line 175:
 
WantedBy=multi-user.target
 
WantedBy=multi-user.target
 
</syntaxhighlight>
 
</syntaxhighlight>
#make links: <syntaxhighlight lang="bash">
+
make links:
 +
<syntaxhighlight lang="bash">
 
cd /etc/systemd/system/
 
cd /etc/systemd/system/
 
ln /lib/systemd/cvxmirror.service cvxmirror.service
 
ln /lib/systemd/cvxmirror.service cvxmirror.service
 
</syntaxhighlight>
 
</syntaxhighlight>
#make system take notice: <syntaxhighlight lang="bash">
+
make system take notice:  
 +
<syntaxhighlight lang="bash">
 
systemctl daemon-reload
 
systemctl daemon-reload
 
</syntaxhighlight>
 
</syntaxhighlight>
#start service manually: <syntaxhighlight lang="bash">
+
start service manually:  
 +
<syntaxhighlight lang="bash">
 
systemctl start cvxmirror.service
 
systemctl start cvxmirror.service
 
</syntaxhighlight>
 
</syntaxhighlight>
#enable on startup: <syntaxhighlight lang="bash">
+
stop service manually:
 +
<syntaxhighlight lang="bash">
 +
systemctl stop cvxmirror.service
 +
</syntaxhighlight>
 +
enable on startup:  
 +
<syntaxhighlight lang="bash">
 
systemctl enable cvxmirror.service
 
systemctl enable cvxmirror.service
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 11:45, 30 November 2013

<<< back to Wiki Home

Setup

Copy OS to microSD card

  • Download OS (.img.xz)
  • unzip
  • figure out what your card is. check df before and after inserting the card:
df -h
  • unmount the drive:
diskutil unmountDisk /dev/disk2s1
  • copy image to drive:
dd if=Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.06.20.img of=/dev/rdisk2 bs=1m

Default boot from SD card

  • boot beaglebone while holding the S2 button (by SD card reader). this boots from the sd card.
  • move the MLO file from /media/BEAGLEBONE/ to a safe place:
mkdir backup
mv /media/BEAGLEBONE/MLO backup
  • The beaglebone will now boot from microSD until you replace the MLO file.

What Kernel am I running

  • uname -a

other

Debugging

TTL Cable

954bbb_MED.jpg

(RED IS NOT CONNECTED)

ssh not working

want to allow processes to keep running?

OpenCV

python-opencv

  • install python opencv bindings:
opkg install python-opencv

potrace

gphoto2

  • install libusb-1.0-dev
opkg install libusb-1.0-dev
./configure
make
make install

GPIO

PyBBIO

other

gpio - http://beaglebone.cameon.net/home/using-the-gpios

Hardware

C920

capture

streaming

dash cam

Servo

Serial Communication

Ubuntu

Angstrom

  • update opkg:
    • opkg update
  • install pyserial:
    • opkg install python-pyserial

Pockesphinx

Audio

  • purchase usb sound card.
  • connect stereo microphone.
  • record audio with arecord:
    • arecord -D sysdefault -t wav -c 2 -r 44100 -f S16_LE -v binaural2.wav
  • play audio:
    • aplay binaural2.wav
  • use the ALSA mixer to set recording levels, output levels, etc.:
    • alsamixer

Debian

Installing Ubuntu

Curses

  • install python-curses:
    • opkg install python-curses

Run a Script on Login (Start a Service)

Make a Shell Script

launch_mirror.sh - launches a python script as detached screen session

#!/bin/bash

cd /home/root/convexmirror
/usr/bin/screen -dmS mirror /home/root/convexmirror/convex_mirror.py

make the scrip user executable

chmod u+x

Make a Service

make a service file:

vi /lib/systemd/system/cvxmirror.service

cvxmirror.service:

[Unit]
Description=Runs looping convex mirror code
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/home/root/convexmirror/launch_mirror.sh

[Install]
WantedBy=multi-user.target

make links:

cd /etc/systemd/system/
ln /lib/systemd/cvxmirror.service cvxmirror.service

make system take notice:

systemctl daemon-reload

start service manually:

systemctl start cvxmirror.service

stop service manually:

systemctl stop cvxmirror.service

enable on startup:

systemctl enable cvxmirror.service

http://www.nunoalves.com/open_source/?p=308 http://kezhong.wordpress.com/2011/11/19/creating-my-own-systemd-service-files-on-fedora-16x86_64/

Other