BeagleBone http://robotic-controls.com/ en BeagleBone Internet over USB only http://robotic-controls.com/learn/beaglebone/beaglebone-internet-over-usb-only <span>BeagleBone Internet over USB only</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> <div class="field--item"><a href="/topics/linux" hreflang="en">Linux</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Mon, 08/12/2013 - 14:23</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>Sure, the BeagleBone and BeagleBone Black come with an ethernet port on them, but why have to get another cable out? You might not even be anywhere near the router. The BeagleBone images automatically do network communcations over USB, as shown by how you can go to <a href="192.168.7.2">192.168.7.2</a> from your browser to see the BeagleBone start page and&nbsp;<a style="line-height: 16px;" href="http://192.168.7.2:3000/">http://192.168.7.2:3000/</a>&nbsp;to use the Cloud9 editor hosted on the BeagleBone. The problem is that the host computers do not usually relay network traffic to new interfaces. I don't know why not. It would be nice if you could just connect stuff to any connection and it'd always work, but it's not hard to set up NAT and such once you know how to do it. The connection over USB might be slighlty slower than the dedicated connection, since USB is slower and is sharing the connection with things JTAG communication and mass storage. For all I know, though, the ethernet on the BeagleBone is actually controlled by the same USB controller, so it might not be at all different!<!--break--></p> <p>On the BeagleBone</p> <pre>ifconfig usb0 192.168.7.2<br>route add default gw 192.168.7.1</pre> <p>On Linux computer:</p> <pre>sudo su<br>#eth0 is my internet facing interface, eth3 is the BeagleBone USB connection<br>ifconfig eth3 192.168.7.1<br>iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE iptables --append FORWARD --in-interface eth3 -j ACCEPT echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre> <p>On a Windows computer, I would think you could use the graphical <a href="http://windows.microsoft.com/en-us/windows7/set-up-a-shared-internet-connection-using-ics-internet-connection-sharing">Internet Connection Sharing</a> feature.</p></div> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone%20Internet%20over%20USB%20only&amp;1=http%3A//robotic-controls.com/learn/beaglebone/beaglebone-internet-over-usb-only&amp;2=node/75" token="i7-3JxbirLOO2BMibLAxpomG8xzHYdeMBeaUShmOBQ8"></drupal-render-placeholder></div> </div> Mon, 12 Aug 2013 19:23:54 +0000 Evan Boldt 75 at http://robotic-controls.com BeagleBone Security System http://robotic-controls.com/learn/beaglebone/beaglebone-security-system <span>BeagleBone Security System</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> <div class="field--item"><a href="/topics/linux" hreflang="en">Linux</a></div> <div class="field--item"><a href="/topics/camera" hreflang="en">Camera</a></div> <div class="field--item"><a href="/topics/raspberry-pi" hreflang="en">Raspberry Pi</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Mon, 08/12/2013 - 12:17</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>Since the BeagleBone (and the Raspberry Pi) is Linux based, and has usb ports, it is actually very easy (and cheap) to make a security camera system. All you need are USB webcams. Just about any will do. I got four for $16 on Amazon. More expensive ones might say they have higher resolution, but what they are actually reporting is the still photo quality, not streaming video quality. Unless you get a USB 3.0 webcam, which would not be supported by either hobbyist computer, it is impossible to stream HD (1080) video, but some might be able to 720. Even if it were possible, it becomes difficult to store so many photos or videos of that size. So keep it cheap, but make sure it is Linux compatible (UVC/V4L), which can be difficult to find sometimes.</p> <p>One major limitation of this kind of system is the cord length limit on USB, which is only 2-7 meters (6-17 feet). It should be possible to get around this limitation with the use of hubs and repeaters.</p> <h3>Motion Detection Software</h3> <p>Motion is a great system for security systems. It monitors the camera for any motion and saves pictures or video (or both) only when there is something happening, which is great for saving space.</p> <h4>Installation (BeagleBone)</h4> <p>Motion is actually in the Angstrom package repositories! Why does that surprise me so much? Oh wait. <a href="http://www.angstrom-distribution.org/repo/?pkgname=motion">They're for the wrong architecture</a>&nbsp;ARM7a vs ARM7l. Would it work anyway? No idea. Probably best not to try. Ok, so this isn't going to be as easy as it could be. Download the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/DownloadFiles">source</a> from the motion homepage by finding a link to it in your web browser and then:</p> <pre class="lang-bash">opkg install kernel-module-uvcvideo libavformat-staticdev<br>ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h<br>ln -s /usr/include/libavformat/avformat.h /usr/include/avformat.h<br>ln -s /usr/include/libavformat/avio.h /usr/include/avio.h<br>ln -s /usr/include/libavutil/avstring.h /usr/include/avstring.h<br>ln -s /usr/include/libavutil/attributes.h /usr/include/attributes.h<br> wget $URLGOESHERE<br>tar -xzf motion.tar.gz<br>#it will probably tell you the time is in the future.<br>#BeagleBone does not have the correct time. It has no clock.<br>cd motion-3.2.12/<br>./configure<br>make<br>make install</pre> <p>After all of that, I never got it to compile. I think it might be because the version of ffmpeg currently in the repo is old, but I'm not sure since this seems to have more to do with uvc.</p> <pre class="lang-none">track.c: In function 'uvc_center': track.c:587:29: error: storage size of 'control_s' isn't known track.c:589:24: error: 'V4L2_CID_PRIVATE_BASE' undeclared</pre> <p>If you use an older version of motion (3.2.6), you can get a different error involving jpeglib, but it's no easier to figure out.</p> <p>This is a very good example of why <a href="/learn/beaglebone/beaglebone-black-ubuntu">Ubuntu on the BeagleBone</a> is desirable. The installation process on Ubuntu is as easy as it is for the Raspbian (both are Debian based). So, even though I couldn't get it working in Angstrom, it is still possible to use a BeagleBone for this project</p> <h4>Raspberry Pi Installation</h4> <p>Motion is also in the Raspbian package repositories, which is not surprising since it's basically Debian.</p> <pre>sudo apt-get install motion</pre> <p>Isn't that easy? Why yes. Yes it is.</p> <h4>Configuration</h4> <p>Motion has a very usable configuration file in /etc/motion/motion.conf. Here are some useful configuration options:</p> <pre class="lang-none">width 640<br>height 480<br>framerate 10<br><br># Threshold for number of changed pixels in an image that threshold 1500 <br># The quality (in percent) to be used by the jpeg compression (default: 75) quality 50<br><br># Use ffmpeg to encode mpeg movies in realtime (default: off) ffmpeg_cap_new on<br><br># Target base directory for pictures and films target_dir /var/log/security <br>#break into different folders based on days, not subdivided into hours<br>jpeg_filename %Y%m%d/camera-%t/motions/%H%M%S-%v%q movie_filename %Y%m%d/camera-%t/movie/%v-%Y%m%d%H%M%S # The mini-http server listens to this port for requests (default: 0 = disabled) webcam_port 8081<br># Maximum framerate for webcam streams (default: 1) webcam_maxrate 10<br># Restrict webcam connections to localhost only (default: on) webcam_localhost off </pre> <p>Saving movies instead of just images turns out to be surprisingly efficient. For example, a day in my setup yielded&nbsp;7640 images and only 35 movies, which meant 210MB vs 55MB of storage space. So, to save space, "output_motion off" might be a good change. Saving both kinds of motions (video and stills) at 640x480, 2.3GB could be used on a busy day, but with an average of more like 100MB. Obviously, it will depend on how often things move in your cameras' field of view and what you have your threshold set at. In most cases, you will want a large SD card or maybe even an external USB HDD to store these on.</p> <p>One really cool feature of motion is that it can stream the webcam image over HTTP as an mjpeg. So, by visiting the BeagleBone's address and webcam_port (ex http://beaglebone.local/8081), you can watch the in a browser from somewhere in your own network. However, if you do port forwarding, or the beaglebone has a public IP, you can keep an eye on things from anywhere in the world. It does not, however, have a way to password protect the stream. So keep that in mind before making it public.</p> <h3>Automatic Cleanup</h3> <p>To make sure that the local storage does not fill up, you can delete old data. This can be done automatically based on age using cron and the find program. The following crontab will search for anything over the specified age (in days) and delete it. Note that this does not guarantee that there will be enough disk space. For example, if a few days with lots of motion occur, it could fill up before influx ages enough.</p> <pre>crontab -e <br># m h dom mon dow command 45 1 * * * find /var/log/security/ -maxdepth 1 -ctime +145 -exec rm -rf {} \;<br># delete anything (non-recursively) in /var/log/security older than 145 days</pre></div> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone%20Security%20System&amp;1=http%3A//robotic-controls.com/learn/beaglebone/beaglebone-security-system&amp;2=node/74" token="WyRKB38x7mJfXP51YbPT4af9erMvQNe3bjq7C-86Y_c"></drupal-render-placeholder></div> </div> Mon, 12 Aug 2013 17:17:37 +0000 Evan Boldt 74 at http://robotic-controls.com BeagleBone Black with Angstrom http://robotic-controls.com/learn/beaglebone/beaglebone-black-angstrom <span>BeagleBone Black with Angstrom</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> <div class="field--item"><a href="/topics/linux" hreflang="en">Linux</a></div> <div class="field--item"><a href="/topics/python" hreflang="en">Python</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Sun, 06/02/2013 - 02:52</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>Introduction</h3> <p>Angstrom Linux is what ships on the BeagleBones. It's kind of terrible because I think everyone when they first get it will say, oh I should run opkg upgrade so that everything is up to date. Guess what? That breaks the boot. It won't startup anymore. I don't know how to fix it or what goes wrong. You'll get three LED's on, no USB connection on either the mass media or network, and it'll never come online on the LAN because it won't start up.&nbsp;</p> <p>If you want things to be up to date, you may want to<a href="/learn/beaglebone/beaglebone-black-ubuntu">&nbsp;install Ubuntu</a>.</p> <p>On the other hand, it is pretty lightweight and is pre-configured in a lot of ways that other distros don't have by default. For example, the cloud9 editor is kind of nice.</p> <h3>Installing Images</h3> <p>Whether you have a BeagleBone or BeagleBone Black, you can use the&nbsp;Angstrom-Cloud9-IDE-GNOME-eglibc-ipk*.img.xz</p> <p>They both run ARM7 and the image has the NEON optimization. The image for the BeagleBone Black might have additional features, but it's the same Angstrom with less features as far as I can tell.</p> <pre>sudo su<br>xz -cd ./Angstrom-Cloud9-IDE-GNOME-****.img.xz &gt; /dev/sdd</pre> <p><!--break--></p> <h3>URLs</h3> <p>Check out the tutorial page on <a href="http://beaglebone.local/">http://beaglebone.local/</a>. There are some neat node.js buttons on&nbsp;<a href="http://beaglebone.local/bonescript.html">http://beaglebone.local/bonescript.html</a></p> <p>The very cool Cloud9 IDE is available on&nbsp;<a href="http://beaglebone.local:3000/">http://beaglebone.local:3000/</a>.&nbsp;</p> <p>If you're on windows and don't have an SSH client that you like, there's GateOne SSH client availble in-browser at <a href="http://beaglebone.local:3000/">https://beaglebone.local/</a></p> <p>If those URLs don't work, then you might try replacing beaglebone.local with 192.168.7.2. If that doesn't work, there might be something wrong with your installation. You could re-flash another image.</p> <h3>Tweaks</h3> <h4>Disable GNOME autostart</h4> <p>If you want a graphical environment to develop and test on, that's fine, but a lot of the time your deployment will be headless. Well, you can have your cake and eat it too.</p> <pre>update-rc.d -f gdm remove<br>systemctl disable gdm<br>mv /lib/systemd/system/gdm.service ~/gdm.backup.service<br>systemctl --system daemon-reload</pre> <p>There are probably more steps there than are necessary, but I couldn't get it to stay down for a while, so try them all.</p> <p>Then if you want to start your graphical environment at any point, just login and run <strong>gdm</strong></p> <h4>Install locate</h4> <p>Locate is an awesome tool for searching the filesystem really quickly.</p> <pre>opkg install findutils<br>updatedb</pre> <h4>Run a Script on Startup (cron)</h4> <pre>nano&nbsp;~/startup.sh</pre> <pre>#put something in /tmp/ so we can see if this ran<br>touch /tmp/WINNING<br>#turn off the heartbeat<br>echo 0 &gt; /sys/class/leds/beaglebone\:green\:usr0/brightness</pre> <pre>chmod +x ~/startup.sh<br>env EDITOR=nano crontab -e<br>@reboot /bin/bash /home/root/startup.sh</pre> <h4>Run a Script on Startup (systemd)</h4> <p>Angstrom uses systemd, so it has a few things different than a Debian/Ubuntu system. Not sure why you'd want to do it this way. It's a lot harder than cron.</p> <p>First make a script you want to run on startup. You might just use this bash file to launch all your other processes. If you do, throw a &amp; at the end of each line to run them in background.</p> <pre>nano&nbsp;~/mystartup.sh</pre> <pre>#!/bin/bash touch /tmp/WINNING</pre> <pre>chmod +x ~/mystartup.sh</pre> <p>After making an executable script, make a service for systemd to use.</p> <pre>nano /lib/systemd/system/mystartup.service</pre> <pre>[Unit] Description=My own script to run on startup<br>ConditionPathExists=|/usr/bin After=local-fs.target [Service] Type=oneshot ExecStart=/home/root/mystartup.sh</pre> <pre>systemctl --system daemon-reload<br>systemctl enable mystartup.service</pre> <p>To load it and test it, try:</p> <pre>systemctl start mystartup.service<br>ls -l /tmp/WINNING<br>journalctl</pre> <p>Note that journalctl is apparently the new way of doing a "less /var/log/syslog"</p> <h3>Benchmarks</h3> <p>Compare the benchmarks to those of the Raspberry Pi (<a href="http://elinux.org/RPi_Performance">wiki</a>) using this package (<a href="http://www.roylongbottom.org.uk/Raspberry_Pi_Benchmarks.zip">zip</a>). Also compare to my <a href="/learn/beaglebone/beaglebone-black-ubuntu">Ubuntu BBB tests</a>.</p> <h4>Processor Info</h4> <pre class="code-scroll">root@beaglebone:~# cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 2 (v7l) BogoMIPS : 990.68 Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x3 CPU part : 0xc08 CPU revision : 2 Hardware : Generic AM33XX (Flattened Device Tree) Revision : 0000 Serial : 0000000000000000 </pre> <h4>Dhrystone</h4> <p>At 3059570 dhrystones per second, the BBB with Angstrom is almost 4 times faster than a Raspberry Pi (809061) with Raspbian on it. However, it is about 10% slower than it could be with Ubuntu on it (3319960).</p> <pre class="code-scroll">########################################## Dhrystone Benchmark, Version 2.1 (Language: C or C++) Optimisation Opt 3 32 Bit Register option not selected 10000 runs 0.01 seconds 100000 runs 0.11 seconds 200000 runs 0.18 seconds 400000 runs 0.13 seconds 800000 runs 0.26 seconds 1600000 runs 0.52 seconds 3200000 runs 1.05 seconds 6400000 runs 2.09 seconds Final values (* implementation-dependent): Int_Glob: O.K. 5 Bool_Glob: O.K. 1 Ch_1_Glob: O.K. A Ch_2_Glob: O.K. B Arr_1_Glob[8]: O.K. 7 Arr_2_Glob8/7: O.K. 6400010 Ptr_Glob-&gt; Ptr_Comp: * 94584 Discr: O.K. 0 Enum_Comp: O.K. 2 Int_Comp: O.K. 17 Str_Comp: O.K. DHRYSTONE PROGRAM, SOME STRING Next_Ptr_Glob-&gt; Ptr_Comp: * 94584 same as above Discr: O.K. 0 Enum_Comp: O.K. 1 Int_Comp: O.K. 18 Str_Comp: O.K. DHRYSTONE PROGRAM, SOME STRING Int_1_Loc: O.K. 5 Int_2_Loc: O.K. 13 Int_3_Loc: O.K. 7 Enum_Loc: O.K. 1 Str_1_Loc: O.K. DHRYSTONE PROGRAM, 1'ST STRING Str_2_Loc: O.K. DHRYSTONE PROGRAM, 2'ND STRING From File /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 2 (v7l) BogoMIPS : 297.40 Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x3 CPU part : 0xc08 CPU revision : 2 Hardware : Generic AM33XX (Flattened Device Tree) Revision : 0000 Serial : 0000000000000000 From File /proc/version Linux version 3.8.13 (koen@rrMBP) (gcc version 4.7.3 20130205 (prerelease) (Linaro GCC 4.7-2013.02-01) ) #1 SMP Mon May 20 17:07:58 CEST 2013 Nanoseconds one Dhrystone run: 326.84 Dhrystones per Second: 3059570 VAX MIPS rating = 1741.36 </pre> <h4>OpenSSL</h4> <p>Again, the BBB on Angstrom proves to be significantly faster than the Raspberry Pi. About 4 times faster or way more. However, the comparison to the BBB with Ubuntu are actually the opposite. Angstrom is faster by about 10%. The difference? No NEON FPU optimizations on Ubuntu!</p> <pre class="code-scroll">root@beaglebone:~# openssl speed;<br>OpenSSL 1.0.0j 10 May 2012 built on: Wed Apr 3 21:06:55 CEST 2013 options:bn(64,32) rc4(ptr,int) des(idx,risc1,2,long) aes(partial) idea(int) blowfish(idx) compiler: arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 --sysroot=/build/v2012.12/build/tmp-angstrom_v2012_12-eglibc/sysroots/olinuxino-a13 -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes md2 0.00 0.00 0.00 0.00 0.00 mdc2 2200.18k 2903.10k 3079.22k 3123.71k 3131.59k md4 5415.82k 20091.55k 62372.30k 131555.57k 194939.46k md5 4617.55k 16804.97k 50871.15k 102349.66k 145803.90k hmac(md5) 7419.73k 25105.91k 67753.84k 117279.85k 149212.21k sha1 4689.06k 15086.80k 37111.10k 58582.77k 70082.56k rmd160 4321.96k 13657.71k 33189.03k 51514.42k 61322.19k rc4 51274.46k 57055.08k 58599.86k 59068.36k 59196.82k des cbc 15641.44k 16844.09k 17096.95k 17186.71k 17143.13k des ede3 5966.27k 6118.46k 6149.65k 6173.80k 6179.74k idea cbc 15220.99k 16040.11k 16331.43k 16378.86k 16340.16k seed cbc 21797.27k 23300.32k 23793.27k 23880.09k 23956.81k rc2 cbc 13306.59k 14101.91k 14234.37k 14302.09k 14325.00k rc5-32/12 cbc 0.00 0.00 0.00 0.00 0.00 blowfish cbc 27004.49k 29706.03k 30572.82k 30746.37k 30866.58k cast cbc 26993.30k 29720.81k 30501.50k 30798.77k 30854.70k aes-128 cbc 27466.35k 29851.57k 30765.55k 31029.95k 31033.71k aes-192 cbc 23934.83k 25819.16k 26408.67k 26625.71k 26651.49k aes-256 cbc 21310.20k 22657.92k 23204.56k 23356.48k 23362.27k camellia-128 cbc 28544.43k 31191.34k 31965.01k 32352.21k 32362.51k camellia-192 cbc 23092.30k 24841.16k 25474.06k 25586.30k 25650.86k camellia-256 cbc 23167.57k 24852.70k 25346.39k 25612.71k 25614.38k sha256 4648.14k 11368.65k 21020.95k 26654.38k 29045.86k sha512 969.92k 3858.49k 5574.64k 7650.79k 8548.17k whirlpool 1872.39k 3901.80k 6372.60k 7553.37k 7996.82k aes-128 ige 25801.92k 28261.82k 29148.35k 29319.28k 28924.91k aes-192 ige 22733.70k 24548.07k 25245.12k 25323.28k 25036.29k aes-256 ige 20328.61k 21757.95k 22204.79k 22366.69k 22090.91k sign verify sign/s verify/s rsa 512 bits 0.002286s 0.000191s 437.4 5244.1 rsa 1024 bits 0.011637s 0.000559s 85.9 1790.5 rsa 2048 bits 0.068425s 0.001828s 14.6 546.9 rsa 4096 bits 0.444783s 0.006260s 2.2 159.7 sign verify sign/s verify/s dsa 512 bits 0.001946s 0.002152s 513.9 464.7 dsa 1024 bits 0.005539s 0.006413s 180.5 155.9 dsa 2048 bits 0.018094s 0.021652s 55.3 46.2 sign verify sign/s verify/s 160 bit ecdsa (secp160r1) 0.0011s 0.0048s 935.6 210.4 192 bit ecdsa (nistp192) 0.0011s 0.0052s 873.1 192.9 224 bit ecdsa (nistp224) 0.0015s 0.0069s 679.8 144.8 256 bit ecdsa (nistp256) 0.0020s 0.0099s 509.9 100.8 384 bit ecdsa (nistp384) 0.0041s 0.0218s 245.0 45.8 521 bit ecdsa (nistp521) 0.0093s 0.0490s 107.4 20.4 163 bit ecdsa (nistk163) 0.0040s 0.0081s 247.2 124.2 233 bit ecdsa (nistk233) 0.0078s 0.0154s 128.3 65.1 283 bit ecdsa (nistk283) 0.0119s 0.0276s 84.3 36.2 409 bit ecdsa (nistk409) 0.0283s 0.0632s 35.3 15.8 571 bit ecdsa (nistk571) 0.0634s 0.1443s 15.8 6.9 163 bit ecdsa (nistb163) 0.0040s 0.0087s 252.3 115.5 233 bit ecdsa (nistb233) 0.0076s 0.0166s 130.8 60.3 283 bit ecdsa (nistb283) 0.0118s 0.0302s 84.6 33.2 409 bit ecdsa (nistb409) 0.0284s 0.0718s 35.2 13.9 571 bit ecdsa (nistb571) 0.0637s 0.1660s 15.7 6.0 op op/s 160 bit ecdh (secp160r1) 0.0041s 246.8 192 bit ecdh (nistp192) 0.0044s 229.8 224 bit ecdh (nistp224) 0.0057s 174.7 256 bit ecdh (nistp256) 0.0083s 121.1 384 bit ecdh (nistp384) 0.0177s 56.6 521 bit ecdh (nistp521) 0.0406s 24.6 163 bit ecdh (nistk163) 0.0039s 255.5 233 bit ecdh (nistk233) 0.0075s 132.8 283 bit ecdh (nistk283) 0.0136s 73.6 409 bit ecdh (nistk409) 0.0312s 32.1 571 bit ecdh (nistk571) 0.0718s 13.9 163 bit ecdh (nistb163) 0.0042s 236.7 233 bit ecdh (nistb233) 0.0082s 121.3 283 bit ecdh (nistb283) 0.0152s 65.7 409 bit ecdh (nistb409) 0.0357s 28.0 571 bit ecdh (nistb571) 0.0825s 12.1&nbsp;</pre></div> <section> </section> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone%20Black%20with%20Angstrom&amp;1=http%3A//robotic-controls.com/learn/beaglebone/beaglebone-black-angstrom&amp;2=node/67" token="byDXR5-v5ZggKQUroFy9re2_KYmVsNajFfUBQTQqhRw"></drupal-render-placeholder></div> </div> Sun, 02 Jun 2013 07:52:44 +0000 Evan Boldt 67 at http://robotic-controls.com http://robotic-controls.com/learn/beaglebone/beaglebone-black-angstrom#comments BeagleBone Black Built-In LEDs http://robotic-controls.com/learn/beaglebone/beaglebone-black-built-leds <span>BeagleBone Black Built-In LEDs</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Sat, 06/01/2013 - 17:46</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>About each LED</h3> <p>There are four user LEDs on the BeagleBone. You can modify them, but they each have their own purposes by default. USER0 is the closest to the top in the picture at the right, and USER3 is the bottom one closest to the ethernet port.</p> <p class="float-right"><a href="/sites/default/files/images/beaglebone-leds.jpg"><img src="/sites/default/files/styles/medium/public/images/beaglebone-leds.jpg" alt="" width="152" height="220" style="float: right;" class="image-medium soft"></a>&nbsp;</p> <ul> <li>USER0 is the heartbeat indicator from the Linux kernel.</li> <li>USER1 turns on when the SD card is being accessed</li> <li>USER2 is an activity indicator. It turns on when the kernel is not in the idle loop.</li> <li>USER3 turns on when the onboard eMMC is being accessed.</li> </ul> <p>You can change each of the LED's behaviors at the following locations:</p> <pre class="lang-none">/sys/class/leds/beaglebone\:green\:usr0/<br>/sys/class/leds/beaglebone\:green\:usr1/<br>/sys/class/leds/beaglebone\:green\:usr2/<br>/sys/class/leds/beaglebone\:green\:usr3/</pre> <p>Yeah, the LEDs are blue, but the folder is called green for some reason. Also, those colons make BASH freak out a bit, so pay attention to escape them.</p> <p>If you explore those directories, things start to get interesting.<!--break--></p> <p>First, any write operatoins will require root privileges. The use of IO redirection will require that you be the root account, not just use sudo. This is only really applicable if you are not using Angstrom, where the root account is the default account.</p> <pre class="lang-none">root@beaglebone:~# cd&nbsp;/sys/class/leds/beaglebone\:green\:usr0/</pre> <pre>root@beaglebone:/sys/class/leds/beaglebone:green:usr0# ls -l <br>total 0 -rw-r--r-- 1 root root 4096 Jan 1 00:08 brightness lrwxrwxrwx 1 root root 0 Jan 1 00:08 device -&gt; ../../../gpio-leds.8 -r--r--r-- 1 root root 4096 Jan 1 00:08 max_brightness drwxr-xr-x 2 root root 0 Jan 1 00:08 power lrwxrwxrwx 1 root root 0 Jan 1 00:08 subsystem -&gt; ../../../../../class/leds -rw-r--r-- 1 root root 4096 Jan 1 00:08 trigger -rw-r--r-- 1 root root 4096 Jan 1 00:00 uevent<br><br>root@beaglebone:/sys/class/leds/beaglebone:green:usr0# cat trigger<br>none nand-disk mmc0 mmc1 timer oneshot [heartbeat] backlight gpio cpu0 default-on transient </pre> <p>You can see that USER0 is in hearbeat trigger mode. I find that heartbeat to be annoying (it's so bright!). Let's get rid of it</p> <h3>Take Over a USER LED</h3> <p>You can change what LED blinks to indicate by changing the trigger. For example, GPIO would indicate GPIO activity.</p> <p>In order to change these, you will need to become root by either using <strong>sudo bash</strong> or <strong>sudo su</strong></p> <p>Sudo alone will not help because of the I/O redirection used in these commands. You could do sudo nano trigger instead.</p> <pre class="lang-none">root@beaglebone:/sys/class/leds/beaglebone:green:usr0# echo none &gt; trigger<br>root@beaglebone:/sys/class/leds/beaglebone:green:usr0# cat trigger<br>[none] nand-disk mmc0 mmc1 timer oneshot heartbeat backlight gpio cpu0 default-on transient <br>root@beaglebone:/sys/class/leds/beaglebone:green:usr0# echo 0 &gt; brightness</pre> <h3>Blinking a USER LED</h3> <p>Just a simple BASH loop:</p> <pre>while true; do echo 255 &gt; brightness ; sleep 1; echo 0 &gt; brightness; sleep 1; done;</pre> <p>OR you can use the timer built-in trigger</p> <pre>echo timer &gt; trigger<br>echo 500 &gt; delay_off<br>echo 50 &gt; delay_on</pre> <p>You can even use it as a sort of PWM to dim the LED. There should be another way to do this, but this is all I've found.</p> <pre>echo timer &gt; trigger<br>echo 1 &gt; delay_on<br>echo 12 &gt; delay_off</pre> <p>Interestingly, I think this should behave similar to the heartbeat. If the system crashes it would turn on or off completely.</p></div> <section> </section> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone%20Black%20Built-In%20LEDs&amp;1=http%3A//robotic-controls.com/learn/beaglebone/beaglebone-black-built-leds&amp;2=node/69" token="TgBVnN4ZGD4_jph0lry3lU11t5K_8btsPw-7tlfTXaA"></drupal-render-placeholder></div> </div> Sat, 01 Jun 2013 22:46:20 +0000 Evan Boldt 69 at http://robotic-controls.com http://robotic-controls.com/learn/beaglebone/beaglebone-black-built-leds#comments BeagleBone http://robotic-controls.com/learn/beaglebone <span>BeagleBone</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> <div class="field--item"><a href="/topics/python" hreflang="en">Python</a></div> <div class="field--item"><a href="/topics/linux" hreflang="en">Linux</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Sat, 06/01/2013 - 17:44</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>Introduction</h3> <p><a href="/sites/default/files/images/BBB-Top.jpg"><img src="/sites/default/files/styles/medium/public/images/BBB-Top.jpg" alt="The BeagleBone Black is a $45 Linux desktop / microcontroller" width="220" height="165" style="float: right;" class="image-medium soft float-right"></a>The BeagleBone is like a combination between a microcontroller (like Arduino) and a small Linux desktop. It is most similar to a Raspberry Pi, but with more pinouts and a faster processor. The BeagleBone has several variants, the most recent edition being the BeagleBone Black (aka BBB), which retails for $45 USD.&nbsp;</p> <p>It is a great choice if you are going to add image or video processing to your robot. An Arduino is nowhere near powerful enough to handle images. Arduino, however, is extremely easy to use and extremely well documented with a massive community.&nbsp;</p> <p><a href="/sites/default/files/images/BBB-Bottom.jpg"><img src="/sites/default/files/styles/medium/public/images/BBB-Bottom.jpg" width="220" height="165" style="clear: right;" class="image-medium soft float-right"></a>Against a Raspberry Pi, it's a harder choice to make. It's more expensive, but has a processor that's faster and capable of running ARMv7 operating systems like Ubuntu and Android, where a Raspberry Pi is substantially more limited. A Raspberry Pi is easier to use and has a much larger community behind it, but the BeagleBone has some powerful hardware features. If you are undecided, the good news is that they are both really cheap, both run Python, and have very similar ways of accessing GPIO (the /sys/ directory), so really you could change your mind midway through a project and not face too much of a setback.</p></div> <section> </section> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone&amp;1=http%3A//robotic-controls.com/learn/beaglebone&amp;2=node/70" token="AdvZ7bngiaXNPQj0Xoqe69tG8qxGm89BO3WIIXievxM"></drupal-render-placeholder></div> </div> Sat, 01 Jun 2013 22:44:59 +0000 Evan Boldt 70 at http://robotic-controls.com http://robotic-controls.com/learn/beaglebone#comments BeagleBone Black Pins http://robotic-controls.com/node/68 <span>BeagleBone Black Pins</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Sat, 06/01/2013 - 13:44</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>Pinout Tables</h3> <p>These tables are based on the <a href="http://robotic-controls.com/sites/default/files/learn/BBB_SRM.pdf">BeagleBone Black System Reference Manual</a> (Creative Commons) by Gerald Coley of BeagleBoard.org. They aren't really available anywhere else on the internet, so I thought I'd transcribe them into a more available format.<!--break--></p> <p>The PROC column is the pin number on the processor.</p> <p>The PIN column is the pin number on the expansion header.</p> <p>The MODE columns are the mode setting for each pin. Setting each mode to align with the mode column will give that function on that pin. Each pin's mode can be set individually.</p> <p>Note that the MODE5 column is absent. That is not a typo. It just doesn't do anything. The only exception is GPIO0_7 in expansion header P9 has a&nbsp;mmc0_sdwp</p> <table class="table-compact" border="0" cellspacing="0" cellpadding="0"><caption>Expansion Header P8 Pinout</caption> <thead> <tr><th>PIN</th><th>PROC</th><th>NAME</th><th>MODE0</th><th>MODE1</th><th>MODE2</th><th>MODE3</th><th>MODE4</th><th>MODE6</th><th>MODE7</th></tr> </thead> <tbody> <tr> <td>1,2</td> <td style="text-align: center;" colspan="9">GND</td> </tr> <tr> <td>3</td> <td>R9</td> <td>GPIO1_6</td> <td>gpmc_ad6</td> <td>mmc1_dat6</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[6]</td> </tr> <tr> <td>4</td> <td>T9</td> <td>GPIO1_7</td> <td>gpmc_ad7</td> <td>mmc1_dat7</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[7]</td> </tr> <tr> <td>5</td> <td>R8</td> <td>GPIO1_2</td> <td>gpmc_ad2</td> <td>mmc1_dat2</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[2]</td> </tr> <tr> <td>6</td> <td>T8</td> <td>GPIO1_3</td> <td>gpmc_ad3</td> <td>mmc1_dat3</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[3]</td> </tr> <tr> <td>7</td> <td>R7</td> <td>TIMER4</td> <td>gpmc_advn_ale</td> <td>&nbsp;</td> <td>timer4</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[2]</td> </tr> <tr> <td>8</td> <td>T7</td> <td>TIMER7</td> <td>gpmc_oen_ren</td> <td>&nbsp;</td> <td>timer7</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[3]</td> </tr> <tr> <td>9</td> <td>T6</td> <td>TIMER5</td> <td>gpmc_be0n_cle</td> <td>&nbsp;</td> <td>timer5</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[5]</td> </tr> <tr> <td>10</td> <td>U6</td> <td>TIMER6</td> <td>gpmc_wen</td> <td>&nbsp;</td> <td>timer6</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[4]</td> </tr> <tr> <td>11*</td> <td>R12</td> <td>GPIO1_13</td> <td>gpmc_ad13</td> <td>lcd_data18</td> <td>mmc1_dat5*</td> <td>mmc2_dat1</td> <td>eQEP2B_in</td> <td>&nbsp;</td> <td>gpio1[13]</td> </tr> <tr> <td>12*</td> <td>T12</td> <td>GPIO1_12</td> <td>gpmc_ad12</td> <td>lcd_data19</td> <td>mmc1_dat4*</td> <td>mmc2_dat0</td> <td>EQEP2A_IN</td> <td>&nbsp;</td> <td>gpio1[12]</td> </tr> <tr> <td>13*</td> <td>T10</td> <td>EHRPWM2B</td> <td>gpmc_ad9</td> <td>lcd_data22</td> <td>mmc1_dat1*</td> <td>mmc2_dat5</td> <td>ehrpwm2B</td> <td>&nbsp;</td> <td>gpio0[23]</td> </tr> <tr> <td>14*</td> <td>T11</td> <td>GPIO0_26</td> <td>gpmc_ad10</td> <td>lcd_data21</td> <td>mmc1_dat2*</td> <td>mmc2_dat6</td> <td>ehrpwm2_tripzone</td> <td>&nbsp;</td> <td>gpio0[26]</td> </tr> <tr> <td>15*</td> <td>U13</td> <td>GPIO1_15</td> <td>gpmc_ad15</td> <td>lcd_data16</td> <td>mmc1_dat7*</td> <td>mmc2_dat3</td> <td>eQEP2_strobe</td> <td>&nbsp;</td> <td>gpio1[15]</td> </tr> <tr> <td>16*</td> <td>V13</td> <td>GPIO1_14</td> <td>gpmc_ad14</td> <td>lcd_data17</td> <td>mmc1_dat6*</td> <td>mmc2_dat2</td> <td>eQEP2_index</td> <td>&nbsp;</td> <td>gpio1[14]</td> </tr> <tr> <td>17*</td> <td>U12</td> <td>GPIO0_27</td> <td>gpmc_ad11</td> <td>lcd_data20</td> <td>mmc1_dat3*</td> <td>mmc2_dat7</td> <td>ehrpwm0_synco</td> <td>&nbsp;</td> <td>gpio0[27]</td> </tr> <tr> <td>18</td> <td>V12</td> <td>GPIO2_1</td> <td>gpmc_clk_mux0</td> <td>lcd_memory_clk</td> <td>gpmc_wait1</td> <td>mmc2_clk</td> <td>&nbsp;</td> <td>mcasp0_fsr</td> <td>gpio2[1]</td> </tr> <tr> <td>19*</td> <td>U10</td> <td>EHRPWM2A</td> <td>gpmc_ad8</td> <td>lcd_data23</td> <td>mmc1_dat0*</td> <td>mmc2_dat4</td> <td>ehrpwm2A</td> <td>&nbsp;</td> <td>gpio0[22]</td> </tr> <tr> <td>20*</td> <td>V9</td> <td>GPIO1_31</td> <td>gpmc_csn2</td> <td>gpmc_be1n</td> <td>mmc1_cmd*</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[31]</td> </tr> <tr> <td>21*</td> <td>U9</td> <td>GPIO1_30</td> <td>gpmc_csn1</td> <td>gpmc_clk</td> <td>mmc1_clk*</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[30]</td> </tr> <tr> <td>22</td> <td>V8</td> <td>GPIO1_5</td> <td>gpmc_ad5</td> <td>mmc1_dat5</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[5]</td> </tr> <tr> <td>23</td> <td>U8</td> <td>GPIO1_4</td> <td>gpmc_ad4</td> <td>mmc1_dat4</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[4]</td> </tr> <tr> <td>24</td> <td>V7</td> <td>GPIO1_1</td> <td>gpmc_ad1</td> <td>mmc1_dat1</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[1]</td> </tr> <tr> <td>25</td> <td>U7</td> <td>GPIO1_0</td> <td>gpmc_ad0</td> <td>mmc1_dat0</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[0]</td> </tr> <tr> <td>26</td> <td>V6</td> <td>GPIO1_29</td> <td>gpmc_csn0</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio1[29]</td> </tr> <tr> <td>27*</td> <td>U5</td> <td>GPIO2_22</td> <td>lcd_vsync*</td> <td>gpmc_a8</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[22]</td> </tr> <tr> <td>28*</td> <td>V5</td> <td>GPIO2_24</td> <td>lcd_pclk*</td> <td>gpmc_a10</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[24]</td> </tr> <tr> <td>29*</td> <td>R5</td> <td>GPIO2_23</td> <td>lcd_hsync*</td> <td>gpmc_a9</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[23]</td> </tr> <tr> <td>30*</td> <td>R6</td> <td>GPIO2_25</td> <td>lcd_ac_bias_en*</td> <td>gpmc_a11</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[25]</td> </tr> <tr> <td>31*</td> <td>V4</td> <td>UART5_CTSN</td> <td>lcd_data14*</td> <td>gpmc_a18</td> <td>eQEP1_index</td> <td>mcasp0_axr1</td> <td>uart5_rxd</td> <td>uart5_ctsn</td> <td>gpio0[10]</td> </tr> <tr> <td>32*</td> <td>T5</td> <td>UART5_RTSN</td> <td>lcd_data15*</td> <td>gpmc_a19</td> <td>eQEP1_strobe</td> <td>mcasp0_ahclkx</td> <td>mcasp0_axr3</td> <td>uart5_rtsn</td> <td>gpio0[11]</td> </tr> <tr> <td>33*</td> <td>V3</td> <td>UART4_RTSN</td> <td>lcd_data13*</td> <td>gpmc_a17</td> <td>eQEP1B_in</td> <td>mcasp0_fsr</td> <td>mcasp0_axr3</td> <td>uart4_rtsn</td> <td>gpio0[9]</td> </tr> <tr> <td>34*</td> <td>U4</td> <td>UART3_RTSN</td> <td>lcd_data11*</td> <td>gpmc_a15</td> <td>ehrpwm1B</td> <td>mcasp0_ahclkr</td> <td>mcasp0_axr2</td> <td>uart3_rtsn</td> <td>gpio2[17]</td> </tr> <tr> <td>35*</td> <td>V2</td> <td>UART4_CTSN</td> <td>lcd_data12*</td> <td>gpmc_a16</td> <td>eQEP1A_in</td> <td>mcasp0_aclkr</td> <td>mcasp0_axr2</td> <td>uart4_ctsn</td> <td>gpio0[8]</td> </tr> <tr> <td>36*</td> <td>U3</td> <td>UART3_CTSN</td> <td>lcd_data10*</td> <td>gpmc_a14</td> <td>ehrpwm1A</td> <td>mcasp0_axr0</td> <td>&nbsp;</td> <td>uart3_ctsn</td> <td>gpio2[16]</td> </tr> <tr> <td>37*</td> <td>U1</td> <td>UART5_TXD</td> <td>lcd_data8*</td> <td>gpmc_a12</td> <td>ehrpwm1_tripzone</td> <td>mcasp0_aclkx</td> <td>uart5_txd</td> <td>uart2_ctsn</td> <td>gpio2[14]</td> </tr> <tr> <td>38*</td> <td>U2</td> <td>UART5_RXD</td> <td>lcd_data9*</td> <td>gpmc_a13</td> <td>ehrpwm0_synco</td> <td>mcasp0_fsx</td> <td>uart5_rxd</td> <td>uart2_rtsn</td> <td>gpio2[15]</td> </tr> <tr> <td>39*</td> <td>T3</td> <td>GPIO2_12</td> <td>lcd_data6*</td> <td>gpmc_a6</td> <td>&nbsp;</td> <td>eQEP2_index</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[12]</td> </tr> <tr> <td>40*</td> <td>T4</td> <td>GPIO2_13</td> <td>lcd_data7*</td> <td>gpmc_a7</td> <td>&nbsp;</td> <td>eQEP2_strobe</td> <td>pr1_edio_data_out7</td> <td>&nbsp;</td> <td>gpio2[13]</td> </tr> <tr> <td>41*</td> <td>T1</td> <td>GPIO2_10</td> <td>lcd_data4*</td> <td>gpmc_a4</td> <td>&nbsp;</td> <td>eQEP2A_in</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[10]</td> </tr> <tr> <td>42*</td> <td>T2</td> <td>GPIO2_11</td> <td>lcd_data5*</td> <td>gpmc_a5</td> <td>&nbsp;</td> <td>eQEP2B_in</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[11]</td> </tr> <tr> <td>43*</td> <td>R3</td> <td>GPIO2_8</td> <td>lcd_data2*</td> <td>gpmc_a2</td> <td>&nbsp;</td> <td>ehrpwm2_tripzone</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[8]</td> </tr> <tr> <td>44*</td> <td>R4</td> <td>GPIO2_9</td> <td>lcd_data3*</td> <td>gpmc_a3</td> <td>&nbsp;</td> <td>ehrpwm0_synco</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[9]</td> </tr> <tr> <td>45*</td> <td>R1</td> <td>GPIO2_6</td> <td>lcd_data0*</td> <td>gpmc_a0</td> <td>&nbsp;</td> <td>ehrpwm2A</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[6]</td> </tr> <tr> <td>46*</td> <td>R2</td> <td>GPIO2_7</td> <td>lcd_data1*</td> <td>gpmc_a1</td> <td>&nbsp;</td> <td>ehrpwm2B</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio2[7]</td> </tr> </tbody> </table> <p>&nbsp;* some pins are used by the internal storage (eMMC), and HDMI. 11-21 are used by eMMC. &nbsp;27-46 are used by HDMI.&nbsp;</p> <table class="table-compact" border="0" cellspacing="0"><caption>Expansion Header P9 Pinout</caption> <thead> <tr><th>PIN</th><th>PROC</th><th>NAME</th><th>MODE0</th><th>MODE2</th><th>MODE3</th><th>MODE4</th><th>MODE6</th><th>MODE7</th></tr> </thead> <tbody> <tr> <td>1,2</td> <td colspan="8" align="CENTER">GND</td> </tr> <tr> <td>3,4</td> <td colspan="8" align="CENTER">DC_3.3V</td> </tr> <tr> <td>5,6</td> <td colspan="8" align="CENTER">VDD_5V</td> </tr> <tr> <td>7,8</td> <td colspan="8" align="CENTER">SYS_5V</td> </tr> <tr> <td>9</td> <td colspan="8" align="CENTER">PWR_BUT</td> </tr> <tr> <td>10</td> <td>A10</td> <td>RESET_OUT</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>11</td> <td>T17</td> <td>gpmc_wait0</td> <td>mii2_crs</td> <td>gpmc_csn4</td> <td>rmii2_crs_dv</td> <td>mmc1_sdcd</td> <td>uart4_rxd_mux2</td> <td>gpio0[30]</td> </tr> <tr> <td>12</td> <td>U18</td> <td>gpmc_be1n</td> <td>mii2_col</td> <td>gpmc_csn6</td> <td>mmc2_dat3</td> <td>gpmc_dir</td> <td>mcasp0_aclkr_mux3</td> <td>gpio1[28]</td> </tr> <tr> <td>13</td> <td>U17</td> <td>gpmc_wpn</td> <td>mii2_rxerr</td> <td>gpmc_csn5</td> <td>rmii2_rxerr</td> <td>mmc2_sdcd</td> <td>uart4_txd_mux2</td> <td>gpio0[31]</td> </tr> <tr> <td>14</td> <td>U14</td> <td>gpmc_a2</td> <td>mii2_txd3</td> <td>rgmii2_td3</td> <td>mmc2_dat1</td> <td>gpmc_a18</td> <td>ehrpwm1A_mux1</td> <td>gpio1[18]</td> </tr> <tr> <td>15</td> <td>R13</td> <td>gpmc_a0</td> <td>gmii2_txen</td> <td>rmii2_tctl</td> <td>mii2_txen</td> <td>gpmc_a16</td> <td>ehrpwm1_tripzone</td> <td>gpio1[16]</td> </tr> <tr> <td>16</td> <td>T14</td> <td>gpmc_a3</td> <td>mii2_txd2</td> <td>rgmii2_td2</td> <td>mmc2_dat2</td> <td>gpmc_a19</td> <td>ehrpwm1B_mux1</td> <td>gpio1[19]</td> </tr> <tr> <td>17</td> <td>A16</td> <td>spi0_cs0</td> <td>mmc2_sdwp</td> <td>I2C1_SCL</td> <td>ehrpwm0_synci</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio0[5]</td> </tr> <tr> <td>18</td> <td>B16</td> <td>spi0_d1</td> <td>mmc1_sdwp</td> <td>I2C1_SDA</td> <td>ehrpwm0_tripzone</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio0[4]</td> </tr> <tr> <td>19</td> <td>D17</td> <td>uart1_rtsn</td> <td>timer5</td> <td>dcan0_rx</td> <td>I2C2_SCL</td> <td>spi1_cs1</td> <td>&nbsp;</td> <td>gpio0[13]</td> </tr> <tr> <td>20</td> <td>D18</td> <td>uart1_ctsn</td> <td>timer6</td> <td>dcan0_tx</td> <td>I2C2_SDA</td> <td>spi1_cs0</td> <td>&nbsp;</td> <td>gpio0[12]</td> </tr> <tr> <td>21</td> <td>B17</td> <td>spi0_d0</td> <td>uart2_txd</td> <td>I2C2_SCL</td> <td>ehrpwm0B</td> <td>&nbsp;</td> <td>EMU3_mux1</td> <td>gpio0[3]</td> </tr> <tr> <td>22</td> <td>A17</td> <td>spi0_sclk</td> <td>uart2_rxd</td> <td>I2C2_SDA</td> <td>ehrpwm0A</td> <td>&nbsp;</td> <td>EMU2_mux1</td> <td>gpio0[2]</td> </tr> <tr> <td>23</td> <td>V14</td> <td>gpmc_a1</td> <td>gmii2_rxdv</td> <td>rgmii2_rxdv</td> <td>mmc2_dat0</td> <td>gpmc_a17</td> <td>ehrpwm0_synco</td> <td>gpio1[17]</td> </tr> <tr> <td>24</td> <td>D15</td> <td>uart1_txd</td> <td>mmc2_sdwp</td> <td>dcan1_rx</td> <td>I2C1_SCL</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio0[15]</td> </tr> <tr> <td>25</td> <td>A14</td> <td>mcasp0_ahclkx</td> <td>eQEP0_strobe</td> <td>mcasp0_axr3</td> <td>mcasp1_axr1</td> <td>EMU4_mux2</td> <td>&nbsp;</td> <td>gpio3[21]</td> </tr> <tr> <td>26</td> <td>D16</td> <td>uart1_rxd</td> <td>mmc1_sdwp</td> <td>dcan1_tx</td> <td>I2C1_SDA</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio0[14]</td> </tr> <tr> <td>27</td> <td>C13</td> <td>mcasp0_fsr</td> <td>eQEP0B_in</td> <td>mcasp0_axr3</td> <td>mcasp1_fsx</td> <td>EMU2_mux2</td> <td>&nbsp;</td> <td>gpio3[19]</td> </tr> <tr> <td>28</td> <td>C12</td> <td>mcasp0_ahclkr</td> <td>ehrpwm0_synci</td> <td>mcasp0_axr2</td> <td>spi1_cs0</td> <td>eCAP2_in_PWM2_out</td> <td>&nbsp;</td> <td>gpio3[17]</td> </tr> <tr> <td>29</td> <td>B13</td> <td>mcasp0_fsx</td> <td>ehrpwm0B</td> <td>&nbsp;</td> <td>spi1_d0</td> <td>mmc1_sdcd_mux1</td> <td>&nbsp;</td> <td>gpio3[15]</td> </tr> <tr> <td>30</td> <td>D12</td> <td>mcasp0_axr0</td> <td>ehrpwm0_tripzone</td> <td>&nbsp;</td> <td>spi1_d1</td> <td>mmc2_sdcd_mux1</td> <td>&nbsp;</td> <td>gpio3[16]</td> </tr> <tr> <td>31</td> <td>A13</td> <td>mcasp0_aclkx</td> <td>ehrpwm0A</td> <td>&nbsp;</td> <td>spi1_sclk</td> <td>mmc0_sdcd_mux1</td> <td>&nbsp;</td> <td>gpio3[14]</td> </tr> <tr> <td>32</td> <td>&nbsp;</td> <td colspan="7" align="CENTER">VADC</td> </tr> <tr> <td>33</td> <td>C8</td> <td colspan="7" align="CENTER">AIN4</td> </tr> <tr> <td>34</td> <td>&nbsp;</td> <td colspan="7" align="CENTER">AGND</td> </tr> <tr> <td>35</td> <td>A8</td> <td colspan="7" align="CENTER">AIN6</td> </tr> <tr> <td>36</td> <td>B8</td> <td colspan="7" align="CENTER">AIN5</td> </tr> <tr> <td>37</td> <td>B7</td> <td colspan="7" align="CENTER">AIN2</td> </tr> <tr> <td>38</td> <td>A7</td> <td colspan="7" align="CENTER">AIN3</td> </tr> <tr> <td>39</td> <td>B6</td> <td colspan="7" align="CENTER">AIN0</td> </tr> <tr> <td>40</td> <td>C7</td> <td colspan="7" align="CENTER">AIN1</td> </tr> <tr> <td rowspan="2" align="CENTER">41#</td> <td>D14</td> <td>xdma_event_intr1</td> <td>&nbsp;</td> <td>tclkin</td> <td>clkout2</td> <td>timer7_mux1</td> <td>EMU3_mux0</td> <td>gpio0[20]</td> </tr> <tr> <td>D13</td> <td>mcasp0_axr1</td> <td>eQEP0_index</td> <td>&nbsp;</td> <td>Mcasp1_axr0</td> <td>emu3</td> <td>&nbsp;</td> <td>gpio3[20]</td> </tr> <tr> <td rowspan="2" align="CENTER">42@</td> <td>C18</td> <td>eCAP0_in_PWM0_out</td> <td>uart3_txd</td> <td>spi1_cs1</td> <td>pr1_ecap0_ecap<br>_capin_apwm_o</td> <td>spi1_sclk</td> <td>xdma_event_intr2</td> <td>gpio0[7]</td> </tr> <tr> <td>B12</td> <td>Mcasp0_aclkr</td> <td>eQEP0A_in</td> <td>Mcaspo_axr2</td> <td>Mcasp1_aclkx</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>gpio3[18]</td> </tr> </tbody> </table> <h3>Selecting Modes</h3> <p>Using the "everything is a file" sys directory, you can use BASH or whatever to change the mode number for the pin in the NAME column.</p> <pre>echo 7 &gt; /sys/kernel/debug/omap_mux/gpmc_ad4<br>echo 36 &gt; /sys/class/gpio/export<br>echo out &gt; /sys/class/gpio/gpio32/direction<br>echo 1 &gt; /sys/class/gpio/gpio32/value</pre> <p>If you are using windows, TI has this GUI you can use called <a href="http://www.ti.com/tool/pinmuxtool">PinMuxTool / Pin Mux Utility</a>. The BBB is AM335x r2 based.</p> <p>The above only works if you're using the older kernel. The new 3.8 based kernel is missing this nifty pin mux feature. However, you can still check what they're muxed at even if you can't change them easily at runtime by looking at</p> <pre>/sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups</pre> <pre class="code-scroll code-scroll-tall">root@arm:/sys/kernel/debug/pinctrl/44e10800.pinmux# cat pingroups <br>registered pin groups:<br>group: pinmux_userled_pins<br>pin 21 (44e10854)<br>pin 22 (44e10858)<br>pin 23 (44e1085c)<br>pin 24 (44e10860)<br><br>group: pinmux_rstctl_pins<br>pin 20 (44e10850)<br><br>group: pinmux_i2c0_pins<br>pin 98 (44e10988)<br>pin 99 (44e1098c)<br><br>group: pinmux_i2c2_pins<br>pin 94 (44e10978)<br>pin 95 (44e1097c)<br><br>group: pinmux_emmc2_pins<br>pin 32 (44e10880)<br>pin 33 (44e10884)<br>pin 0 (44e10800)<br>pin 1 (44e10804)<br>pin 2 (44e10808)<br>pin 3 (44e1080c)<br>pin 4 (44e10810)<br>pin 5 (44e10814)<br>pin 6 (44e10818)<br>pin 7 (44e1081c)<br><br>group: pinmux_userled_pins<br>pin 21 (44e10854)<br>pin 22 (44e10858)<br>pin 23 (44e1085c)<br>pin 24 (44e10860)<br><br>group: mcasp0_pins<br>pin 107 (44e109ac)<br>pin 103 (44e1099c)<br>pin 101 (44e10994)<br>pin 100 (44e10990)<br>pin 106 (44e109a8)<br><br>group: nxp_hdmi_bonelt_pins<br>pin 108 (44e109b0)<br>pin 40 (44e108a0)<br>pin 41 (44e108a4)<br>pin 42 (44e108a8)<br>pin 43 (44e108ac)<br>pin 44 (44e108b0)<br>pin 45 (44e108b4)<br>pin 46 (44e108b8)<br>pin 47 (44e108bc)<br>pin 48 (44e108c0)<br>pin 49 (44e108c4)<br>pin 50 (44e108c8)<br>pin 51 (44e108cc)<br>pin 52 (44e108d0)<br>pin 53 (44e108d4)<br>pin 54 (44e108d8)<br>pin 55 (44e108dc)<br>pin 56 (44e108e0)<br>pin 57 (44e108e4)<br>pin 58 (44e108e8)<br>pin 59 (44e108ec)<br><br>group: nxp_hdmi_bonelt_off_pins<br>pin 108 (44e109b0)</pre> <h3>Check Pin Statuses</h3> <pre>root@beaglebone:~# cat /sys/kernel/debug/gpio GPIOs 0-31, gpio: GPIOs 32-63, gpio: gpio-52 (eMMC_RSTn ) out lo gpio-53 (beaglebone:green:usr) out lo gpio-54 (beaglebone:green:usr) out lo gpio-55 (beaglebone:green:usr) out hi gpio-56 (beaglebone:green:usr) out lo gpio-59 (McASP Clock Enable P) out hi GPIOs 64-95, gpio: GPIOs 96-127, gpio: </pre> <h3>Power Limitations</h3> <p>Be careful about this one, there are some much lower limits than you might be used to</p> <table border="0"> <tbody> <tr> <td>Pin Type</td> <td>Maximum Voltage</td> <td>Maximum Current</td> </tr> <tr> <td>AIN</td> <td><strong>1.8V</strong></td> <td>&nbsp;</td> </tr> <tr> <td>GPIO</td> <td><strong>3.3V</strong></td> <td>4mA - 6mA</td> </tr> <tr> <td>VDD 3.3</td> <td>3.3V</td> <td>250mA</td> </tr> <tr> <td>VDD 5V</td> <td>5V*</td> <td>1000mA *</td> </tr> <tr> <td>SYS 5V</td> <td>5V</td> <td>250mA</td> </tr> <tr> <td>VDD ADC</td> <td><strong>1.8V</strong></td> <td>0?</td> </tr> <tr> <td>SYS 5V</td> <td>5V</td> <td>250mA</td> </tr> </tbody> </table> <p style="text-align: center;">* VDD only works when the 5V barrel jack is used</p> <h3 style="text-align: left;">i2c</h3> <p>It is recommended that you use I2C2 on pins 19 and 20 with the /dev/i2c-3 device.</p> <table border="0"> <tbody> <tr> <td>Mode Name</td> <td>Port</td> <td>Physical Pin Number</td> <td>Block Device</td> </tr> <tr> <td>I2C1</td> <td>P9</td> <td>17 &amp; 18 or 24 &amp; 26</td> <td>?</td> </tr> <tr> <td>I2C2</td> <td>P9</td> <td>19 &amp; 20 or 21 &amp; 22</td> <td>/dev/i2c-3</td> </tr> </tbody> </table> <p>To check which i2c interfaces are avaible, check</p> <pre>root@arm:~# ls -l /dev/i2c*<br>crw-rw---- 1 root i2c 89, 0 Jun 5 04:34 /dev/i2c-0 crw-rw---- 1 root i2c 89, 1 Jun 5 04:34 /dev/i2c-1</pre> <p>To see what addresses are being used, try the i2cdetect command. In the below example, I have a temperature sensor hooked up to pins 19 and 20 that is using 48. Also note that the UU addresses are being used by the system and are unavailable.</p> <pre>root@beaglebone:~# i2cdetect -y -r 3 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --</pre></div> <div class="field field--name-field-attachments field--type-file field--label-inline"> <div class="field--label">Attachments</div> <div class="field--items"> <div class="field--item"><span class="file file--mime-application-pdf file--application-pdf icon-before"><span class="file-icon"><span class="icon glyphicon glyphicon-file text-primary" aria-hidden="true"></span></span><span class="file-link"><a href="http://robotic-controls.com/sites/default/files/learn/BBB_SRM.pdf" type="application/pdf; length=3019015" title="Open file in new window" target="_blank" data-toggle="tooltip" data-placement="bottom">BBB_SRM.pdf</a></span><span class="file-size">2.88 MB</span></span></div> </div> </div> <section> </section> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone%20Black%20Pins&amp;1=http%3A//robotic-controls.com/node/68&amp;2=node/68" token="pBZ_Zwap-FX3-a6LeCCHeeX2k2tu5AFj9TEieyyxYgw"></drupal-render-placeholder></div> </div> Sat, 01 Jun 2013 18:44:43 +0000 Evan Boldt 68 at http://robotic-controls.com http://robotic-controls.com/node/68#comments BeagleBone Black with Ubuntu http://robotic-controls.com/learn/beaglebone/beaglebone-black-ubuntu <span>BeagleBone Black with Ubuntu</span> <div class="field field--name-field-topics field--type-entity-reference field--label-inline"> <div class="field--label">Topics</div> <div class="field--items"> <div class="field--item"><a href="/topics/beaglebone" hreflang="en">BeagleBone</a></div> <div class="field--item"><a href="/topics/ubuntu" hreflang="en">Ubuntu</a></div> <div class="field--item"><a href="/topics/python" hreflang="en">Python</a></div> <div class="field--item"><a href="/topics/linux" hreflang="en">Linux</a></div> </div> </div> <span><span lang="" about="/users/evan-boldt" typeof="schema:Person" property="schema:name" datatype="">Evan Boldt</span></span> <span>Tue, 05/28/2013 - 22:13</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h3>Introduction</h3> <p>The BeagleBone Black is a very powerful and affordable microcontroller - superior to an Arduino Uno in a lot of ways. It's fast enough to be used as a desktop computer, yet it has more pinouts than an Uno. With the BeagleBone Black priced at $45, it's really a great value compared to an Arduino ($35) or even a Raspberry Pi ($35).</p> <p>An Arduino, while power-efficient and reliable, is incapable of high performance use cases like image processing. Even the ARM based Arduino Due is thousands of times slower than the BeagleBone Black. It can't even parse a JPEG (the library won't fit in the flash). A BeagleBone or Raspberry Pi, however, can easily process live streams from USB webcams and OpenCV.</p> <p><a href="/sites/default/files/images/beaglebone-black_0.jpg"><img src="/sites/default/files/styles/medium/public/images/beaglebone-black_0.jpg" alt="" width="220" height="165" class="image-medium soft float-right"></a>The BeagleBone Black is significantly faster and more capable than the comperable $35 Raspberry Pi Model B. Both have the same RAM, HDMI out, and Ethernet, but the BeagleBone Black has superior IO (more and faster) and has a faster processor capable of running Ubuntu, where the Raspberry Pi cannot due to its older architecture. Remember, Raspberry Pi was intended to be an educational tool to teach kids to program, not to help you hack together a robot. The BBB has two extra processors dedicated to effectively manage the pinouts.</p> <p>The downside? The pre-installed OS (Angstrom) at this point in time will break if you do a package upgrade. Not only will it never boot again once it finishes updating, but it also uses too much of the /tmp/ filesystem and stalls halfway though. You can run Ubuntu on it, but there isn't much of a point, since it's basically incapable of having a desktop UI or using OpenGL as far as I can tell. There's no reason why it shouldn't be possible. In fact, LXDE and XFCE sort of work.&nbsp; This leads to the bigger problem. The documentation, support, and community behind BeagleBone is nowhere near that of the Raspberry Pi, let alone Arduino (which has the best <em>by far</em>).<!--break--></p> <h3>Setup</h3> <p>A lof of this information is based on the <a href="http://elinux.org/BeagleBoardUbuntu">BeagleBone Ubuntu wiki</a>.</p> <h4>Installing to an SD Card</h4> <p>From a Linux computer that has the target microSD card in, download a recent .tar.xz from <a href="http://elinux.org/BeagleBoardUbuntu">this wiki</a> or <a href="http://robotic-controls.com/sites/default/files/learn/ubuntu-13.04-console-armhf-2013-05-18.tar.xz">our upload</a> of the 13.04 image, in case theirs disappears. Then run these bash commands:</p> <pre class="lang-none">tar xJf ubuntu-13.04-console-armhf-2013-05-18.tar.xz<br>cd ubuntu-13.04-console-armhf-2013-05-18<br>sudo ./setup_sdcard.sh --mmc /dev/sdd --uboot bone_dtb --svideo-ntsc --swap_file 1024</pre> <p>Be sure to change /dev/sdd to whatever the SD card is on your computer. If you are using a european TV/monitor, you should set it to PAL instead of NTSC. It seems to default to PAL though. If you get flickering, also consider finding a more powerful power supply for the BeagleBone. Supposedly, it needs 500mA of 5V, but it seems to like to have more than that available.</p> <p>The copy process can take a while - especially the rootfs file sync phase. Be patient.</p> <h4>Boot</h4> <p><a href="http://robotic-controls.com/sites/default/files/images/beaglebone-boot.jpg"><img src="/sites/default/files/styles/medium/public/images/beaglebone-boot.jpg" alt="" width="220" height="165" class="image-medium soft float-right"></a>Plug in the microSD card with the contacts facing down. It sticks out about an eigth of an inch when all the way in. It doesn't quite seem to be in all the way, but it is.</p> <p>Push down the user boot button. Keep it down while plugging it in. The boot button is the button right next to the microSD card slot. After pressing the button while powering on the first time, it will not be necessary again.</p> <p>Eventually, you'll see the penguin at the right and you can stop holding the button down. If you pay attention to the LEDs, you can see when the OS is loaded too.</p> <h4>SSH Access</h4> <p>You can either get a keyboard, micro HDMI to HDMI cable, HDMI TV or monitor, and a mini usb power cable, or you can just plug it into a desktop with the mini USB cable.</p> <p>To access the Ubuntu loaded BeagleBone Black by SSH over USB, use this command:</p> <pre class="lang-none">ssh ubuntu@192.168.7.2</pre> <p>The password will be temppwd. To change the password, just run "passwd" once you log in.</p> <h4>Internet</h4> <p>In order to access the internet do download the extra packages, you'll need to plug in an ethernet cable. Theoretically, you should be able to forward the desktop's connection with a bridge, but it is probably more trouble than it's worth. Network Manager on ubuntu has an easy way to share connections though. "Edit connections..." then edit the BeagleBone's USB connection (probably Wired Connection 2). In the IPv4 tab, change the "method" to "shared". I assume something similar can be done on Windows.</p> <h4>Swapfile</h4> <p>Add a swapfile, if it wasn't by your install process.</p> <pre class="lang-none">sudo mkdir -p /var/cache/swap/ sudo dd if=/dev/zero of=/var/cache/swap/swapfile bs=1M count=1024 sudo chmod 0600 /var/cache/swap/swapfile sudo mkswap /var/cache/swap/swapfile sudo swapon /var/cache/swap/swapfile<br><br>sudo nano /etc/fstab<br>/var/cache/swap/swapfile none swap sw 0 0</pre> <h4>Install Packages?</h4> <p>There are a few packages provided in the /boot/ directory.&nbsp; They might already be installed, but I think they are not installed by default due to licensing or something.</p> <pre class="lang-none">cd /boot/uboot/tools/pkgs sudo bash ti-omapconf.sh<br>sudo bash imx-sdma-firmware.sh<br>sudo bash ti-omapdrm.sh<br>sudo bash ti-tidspbridge.sh<br>sudo bash ti-uim.sh<br>sudo bash ti-wlink-firmware.sh</pre> <h4>XFCE Graphics (Don't Bother)</h4> <p>It's easy to install the graphical environment. It might be impossible to get it to work though. The installation will use up an additional 1 GB of space on top of the default install size of 0.5 GB, so it may not be a great idea to do on a 2GB card.&nbsp;</p> <pre class="lang-none">sudo apt-get update<br>sudo apt-get install xubuntu-desktop<br>sudo shutdown -r now</pre> <p>This install takes about an hour, and includes really a full desktop linux desktop. This is probably more than you want.</p> <p><a href="http://robotic-controls.com/sites/default/files/images/beaglebone-xfce.jpg"><img src="/sites/default/files/styles/medium/public/images/beaglebone-xfce.jpg" alt="" width="220" height="132" class="image-medium soft float-right"></a>Mine seems to crash after a few seconds of being booted into a graphical environment. It doesn't matter what environment I choose either. I've tried XFCE, LXDE, and Unity under LightDM and LXDM. XFCE comes the closest to staying on the longest. Unity does not work due to a lack of OpenGL. &nbsp;There do not seem to be any drivers for it available yet.</p> <p><a href="http://robotic-controls.com/sites/default/files/images/beaglebone-unity_0.jpg"><img src="/sites/default/files/styles/medium/public/images/beaglebone-unity_0.jpg" alt="" width="220" height="139" class="image-medium float-left soft"></a>I don't think Unity will work at all, since compiz can't find OpenGL extensions, but the lightdm login will come up, as you can see. Before you get too down on not having a familiar environment, don't worry about it! Just get a good way of syncing between the BeagleBone Black and your desktop. That way you can keep your faster and familiar computing environment and keep your BeagleBone slim and specialized for what you're actually using it for.</p> <h4>Sync</h4> <p>I chose <a href="http://labs.bittorrent.com/experiments/sync.html">BitTorrent Sync</a> due to the simplicity to set up. It isn't open source, but neither is Dropbox and a lot of us still use it. It is one of the few sync options that offers very easy to install ARM-compatible builds. There is a trick to setting it up though, you have to add a symlink first.</p> <pre class="lang-none">wget http://btsync.s3-website-us-east-1.amazonaws.com/btsync_arm.tar.gz<br>tar xzf btsync_arm.tar.gz<br>rm btsync_arm.tar.gz LICENSE.TXT<br>sudo ln -s /lib/arm-linux-gnueabihf/ld-linux.so.3 /lib/ld-linux.so.3<br>./btsync</pre> <p>Then just take a browser and visit <a href="http://192.168.7.2:8888/">http://192.168.7.2:8888/</a>&nbsp;if it is connected by USB, or <a href="http//arm.local:8888/">http//arm.local:8888/</a>&nbsp;if on LAN.</p> <p>If you are more concerned about privacy and open source software, maybe check out building your own with rsync, or look at <a href="https://github.com/philcryer/lipsync">lipsync</a>, which uses rsync and some filesystem monitoring.</p> <h4>Bash Autocomplete</h4> <p>Autocomplete when tab is pressed (practically necessary!). It is for some reason necessary to install it and then reinstall it, which is definitely odd, but whatever.</p> <pre class="lang-none">sudo apt-get install bash-completion<br>sudo apt-get install --reinstall bash-completion</pre> <h4>Locale</h4> <p>Set your locale, so it stops bugging you about it being set to C by default.</p> <pre class="lang-none">sudo nano /etc/default/locale<br>LANG=en_US.utf8<br><br>sudo locale-gen en_US.utf8</pre> <h4>Local Bin Folder</h4> <p>Add a home bin directory</p> <pre class="lang-none">mkdir ~/bin<br>nano ~/.bashrc<br>#append to the bottom to automatically add home bin to the path<br>PATH=$PATH:/$HOME/bin/</pre> <h4>Dim the Lights</h4> <p><img src="/sites/default/files/styles/medium/public/images/beaglebone-bright.jpg" alt="" width="220" height="165" class="image-medium soft float-right">Put some masking tape or painter's tape over those 4 LED's because they are really annoyingly bright. That might sound like a joke, but if you have it blinking in the corner of your eye non-stop for hours it will actually start to give you a headache. They never stop blinking either. One of them is the Linux Kernel Heartbeat light.</p> <p>They're brighter than normal LEDs too. Why? Dunno. They're blue? Blue LEDs are usually dimmer though. It's hard to even take a picture of the board while it's on! I really can't believe how rediculously annoying they are...</p> <p>Alternatively, instead of putting tape over it, you could run this to actually turn them off. That's probably the right way to do this. Really, it's just the heartbeat that's annoying, but you can turn off the rest too if you want.</p> <pre># just turn off the heartbeat<br>echo 0 &gt; /sys/class/leds/beaglebone\:green\:usr0/brightness<br># get rid of the rest too<br>echo 0 &gt; /sys/class/leds/beaglebone\:green\:usr1/brightness<br>echo 0 &gt; /sys/class/leds/beaglebone\:green\:usr2/brightness<br>echo 0 &gt; /sys/class/leds/beaglebone\:green\:usr3/brightness</pre> <p>If you're worried you won't be able to tell if it crashes, just look at the LAN leds or any of the other 3 indicators. They're always blinking too.</p> <h4>Run a script at startup</h4> <p>So here is a really neat trick:</p> <pre>nano /home/ubuntu/bin/startup.sh</pre> <pre>#! /bin/bash<br>echo 0 &gt; /sys/class/leds/beaglebone\:green\:usr0/brightness</pre> <pre>chmod +x /home/ubuntu/bin/startup.shsudo su<br>sudo crontab -e</pre> <pre>@reboot /bin/bash /home/ubuntu/bin/startup.sh</pre> <p>Isn't cron cool?</p> <h4>Set Up Python</h4> <p>GPIO is done essentially by just writting and writing to the special /sys/ folder. Check out <a href="https://github.com/alexanderhiam/PyBBIO">this</a> github project for a more familiar interface for it.</p> <p>Allow python to interface with i2c.</p> <pre class="lang-none">sudo apt-get install python-smbus</pre> <h3>Benchmarks</h3> <p>Compare the benchmarks to those of the Raspberry Pi (<a href="http://elinux.org/RPi_Performance">wiki</a>) using this package (<a href="http://www.roylongbottom.org.uk/Raspberry_Pi_Benchmarks.zip">zip</a>). Also compare to my&nbsp;<a href="/learn/beaglebone/beaglebone-black-angstrom">Angstrom BBB tests</a>.</p> <h4>Dhrystone</h4> <p>Running whetstone on the Beaglebone Black with Ubuntu compiled with just -O3 yields 3,319,960 dhrystones per second. A Raspberry Pi nets 809,061.5. The BeagleBone was able to do 4.1 times more operations per second. This is also 10% faster than the same BeagleBone Black with Angstrom, the default Linux distrobution, which ran at&nbsp;3,059,570. The same test ran on a desktop computer with an AMD Phenom II x4 965 gets around&nbsp;25,062,657. That's more 10% of a pretty powerful desktop, which I think is somewhat impressive.</p> <pre class="lang-none code-scroll">gcc dhry_1.c dhry_2.c dhry.h cpuidc.c -lm -O3 -o dhry<br>./dhry<br>##########################################<br><br>Dhrystone Benchmark, Version 2.1 (Language: C or C++)<br><br>Optimisation Opt 3 32 Bit<br>Register option not selected<br><br> 10000 runs 0.01 seconds <br> 100000 runs 0.10 seconds <br> 200000 runs 0.20 seconds <br> 400000 runs 0.21 seconds <br> 800000 runs 0.24 seconds <br> 1600000 runs 0.48 seconds <br> 3200000 runs 0.96 seconds <br> 6400000 runs 1.93 seconds <br> 12800000 runs 3.86 seconds <br><br>Final values (* implementation-dependent):<br><br>Int_Glob: O.K. 5 Bool_Glob: O.K. 1<br>Ch_1_Glob: O.K. A Ch_2_Glob: O.K. B<br>Arr_1_Glob[8]: O.K. 7 Arr_2_Glob8/7: O.K. 12800010<br>Ptr_Glob-&gt; Ptr_Comp: * 94584<br> Discr: O.K. 0 Enum_Comp: O.K. 2<br> Int_Comp: O.K. 17 Str_Comp: O.K. DHRYSTONE PROGRAM, SOME STRING<br>Next_Ptr_Glob-&gt; Ptr_Comp: * 94584 same as above<br> Discr: O.K. 0 Enum_Comp: O.K. 1<br> Int_Comp: O.K. 18 Str_Comp: O.K. DHRYSTONE PROGRAM, SOME STRING<br>Int_1_Loc: O.K. 5 Int_2_Loc: O.K. 13<br>Int_3_Loc: O.K. 7 Enum_Loc: O.K. 1 <br>Str_1_Loc: O.K. DHRYSTONE PROGRAM, 1'ST STRING<br>Str_2_Loc: O.K. DHRYSTONE PROGRAM, 2'ND STRING<br><br><br>From File /proc/cpuinfo<br>processor : 0<br>model name : ARMv7 Processor rev 2 (v7l)<br>BogoMIPS : 198.72<br>Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls <br>CPU implementer : 0x41<br>CPU architecture: 7<br>CPU variant : 0x3<br>CPU part : 0xc08<br>CPU revision : 2<br><br>Hardware : Generic AM33XX (Flattened Device Tree)<br>Revision : 0000<br>Serial : 0000000000000000<br><br><br>From File /proc/version<br>Linux version 3.8.13-bone18 (root@imx6q-sabrelite-1gb) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #1 SMP Thu May 16 21:04:48 UTC 2013<br><br><br>Nanoseconds one Dhrystone run: 301.21<br>Dhrystones per Second: 3319960<br>VAX MIPS rating = 1889.56</pre> <h4>OpenSSL</h4> <p>This benchmark shows numbers that are 2-10x faster than those on the Raspberry Pi . However, Angstrom is faster by about 10%. The difference? Perhaps this package has no NEON FPU optimizations on Ubuntu. I also believe the BeagleBone has a special cryptography processor which might not be taken advantage of in this test. The Dhrystone test was compiled, this OpenSSL and is probably missing some optimization argument that the Angstrom package had.</p> <pre class="lang-none code-scroll">OpenSSL 1.0.1c 10 May 2012<br>built on: Tue Mar 19 19:30:47 UTC 2013<br>options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr) <br>compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DOPENSSL_NO_TLS1_2_CLIENT -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM<br>The 'numbers' are in 1000s of bytes per second processed.<br>type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes<br>md2 0.00 0.00 0.00 0.00 0.00 <br>mdc2 0.00 0.00 0.00 0.00 0.00 <br>md4 7130.44k 28511.10k 79135.70k 142166.02k 185522.60k<br>md5 6735.29k 22954.62k 61948.74k 107186.00k 136339.07k<br>hmac(md5) 6964.12k 23296.17k 62451.29k 107847.13k 136203.64k<br>sha1 6698.12k 20571.23k 46889.18k 69689.54k 81622.11k<br>rmd160 5756.90k 16751.42k 36409.79k 51751.17k 58911.17k<br>rc4 64964.35k 72925.41k 76732.39k 77427.41k 77922.96k<br>des cbc 17184.97k 18237.05k 18618.82k 18752.60k 18739.89k<br>des ede3 6574.42k 6735.54k 6804.62k 6794.36k 6817.50k<br>idea cbc 0.00 0.00 0.00 0.00 0.00 <br>seed cbc 21670.10k 22990.09k 23573.99k 23608.01k 23745.80k<br>rc2 cbc 12701.57k 13378.96k 13576.59k 13579.82k 13613.01k<br>rc5-32/12 cbc 0.00 0.00 0.00 0.00 0.00 <br>blowfish cbc 27309.24k 29968.99k 30775.05k 31125.82k 31069.32k<br>cast cbc 26848.41k 29213.50k 30071.18k 30396.65k 30340.54k<br>aes-128 cbc 37250.31k 40851.65k 42063.71k 42548.23k 42491.55k<br>aes-192 cbc 31962.79k 34354.75k 35324.32k 35672.31k 35698.43k<br>aes-256 cbc 28581.52k 30449.05k 31271.64k 31611.70k 31551.61k<br>camellia-128 cbc 26676.56k 28496.71k 29167.33k 29344.13k 29277.50k<br>camellia-192 cbc 21532.49k 22621.60k 23114.57k 23195.84k 23143.08k<br>camellia-256 cbc 21538.22k 22695.82k 23031.27k 23209.75k 23145.82k<br>sha256 9965.51k 24221.62k 43539.86k 54826.95k 58500.20k<br>sha512 4207.69k 16757.43k 25271.78k 35145.54k 39798.78k<br>whirlpool 1579.78k 3265.95k 5289.78k 6313.06k 6654.97k<br>aes-128 ige 34714.63k 38142.11k 39508.96k 39855.59k 39798.33k<br>aes-192 ige 29820.66k 32531.41k 33528.70k 33661.52k 33790.63k<br>aes-256 ige 27038.57k 29091.23k 29929.06k 30019.98k 30137.21k<br>ghash 49881.45k 60961.91k 65236.19k 66256.57k 66803.29k<br> sign verify sign/s verify/s<br>rsa 512 bits 0.001070s 0.000107s 934.7 9379.4<br>rsa 1024 bits 0.006119s 0.000332s 163.4 3009.0<br>rsa 2048 bits 0.039563s 0.001208s 25.3 827.6<br>rsa 4096 bits 0.285143s 0.004634s 3.5 215.8<br> sign verify sign/s verify/s<br>dsa 512 bits 0.001092s 0.001191s 915.9 839.5<br>dsa 1024 bits 0.003264s 0.003762s 306.3 265.8<br>dsa 2048 bits 0.011669s 0.013505s 85.7 74.0<br> sign verify sign/s verify/s<br> 160 bit ecdsa (secp160r1) 0.0006s 0.0024s 1577.7 416.5<br> 192 bit ecdsa (nistp192) 0.0008s 0.0033s 1219.0 301.0<br> 224 bit ecdsa (nistp224) 0.0010s 0.0045s 959.1 224.2<br> 256 bit ecdsa (nistp256) 0.0013s 0.0058s 770.0 171.2<br> 384 bit ecdsa (nistp384) 0.0030s 0.0155s 331.5 64.4<br> 521 bit ecdsa (nistp521) 0.0064s 0.0351s 156.9 28.5<br> 163 bit ecdsa (nistk163) 0.0020s 0.0067s 495.7 149.8<br> 233 bit ecdsa (nistk233) 0.0042s 0.0122s 238.0 82.2<br> 283 bit ecdsa (nistk283) 0.0064s 0.0219s 155.9 45.6<br> 409 bit ecdsa (nistk409) 0.0171s 0.0488s 58.4 20.5<br> 571 bit ecdsa (nistk571) 0.0409s 0.1130s 24.4 8.9<br> 163 bit ecdsa (nistb163) 0.0020s 0.0072s 505.1 138.4<br> 233 bit ecdsa (nistb233) 0.0042s 0.0134s 239.8 74.5<br> 283 bit ecdsa (nistb283) 0.0064s 0.0247s 155.1 40.5<br> 409 bit ecdsa (nistb409) 0.0172s 0.0549s 58.3 18.2<br> 571 bit ecdsa (nistb571) 0.0410s 0.1288s 24.4 7.8<br> op op/s<br> 160 bit ecdh (secp160r1) 0.0020s 501.6<br> 192 bit ecdh (nistp192) 0.0028s 358.5<br> 224 bit ecdh (nistp224) 0.0037s 272.1<br> 256 bit ecdh (nistp256) 0.0050s 201.4<br> 384 bit ecdh (nistp384) 0.0130s 77.2<br> 521 bit ecdh (nistp521) 0.0295s 33.9<br> 163 bit ecdh (nistk163) 0.0033s 301.6<br> 233 bit ecdh (nistk233) 0.0060s 167.9<br> 283 bit ecdh (nistk283) 0.0109s 91.5<br> 409 bit ecdh (nistk409) 0.0241s 41.4<br> 571 bit ecdh (nistk571) 0.0559s 17.9<br> 163 bit ecdh (nistb163) 0.0036s 281.4<br> 233 bit ecdh (nistb233) 0.0066s 152.2<br> 283 bit ecdh (nistb283) 0.0122s 81.9<br> 409 bit ecdh (nistb409) 0.0274s 36.5<br> 571 bit ecdh (nistb571) 0.0638s 15.7</pre> <h4>7z</h4> <p>A Raspberry Pi would be expected to run 321 MIPS. Ubuntu BeagleBone gets 502 with the standard package, and 510 if you compile p7zip, showing that compiling is not really worth the effort unless it is a very important library that is proving to be a bottleneck for you.</p> <pre class="code-scroll">ubuntu@arm:~$ 7z b 7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=en_US.utf8,Utf16=on,HugeFiles=on,1 CPU) RAM size: 495 MB, # CPU hardware threads: 1 RAM usage: 419 MB, # Benchmark threads: 1 Dict Compressing | Decompressing Speed Usage R/U Rating | Speed Usage R/U Rating KB/s % MIPS MIPS | KB/s % MIPS MIPS 22: 345 99 341 336 | 7291 99 662 658 23: 329 98 341 336 | 7176 99 661 657 24: 315 98 344 339 | 7061 99 659 655 25: 304 98 354 347 | 6929 99 655 651 ---------------------------------------------------------------- Avr: 98 345 339 99 659 655 Tot: 99 502 497</pre> <h3>Switching Back to Angstrom</h3> <p>To revert to the default install, the image it shipped with is available here: <a href="http://beagleboard.org/latest-images">http://beagleboard.org/latest-images</a>. I like the one that comes with GNOME though.</p> <pre># backup<br>sudo dd if=/dev/sdX bs=8M | xz -c &gt; myBeagleUbuntu.img.xz<br># re-image<br>xz -cd Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.04.13.img.xz &gt; /dev/sdX</pre></div> <div class="field field--name-field-attachments field--type-file field--label-inline"> <div class="field--label">Attachments</div> <div class="field--items"> <div class="field--item"><span class="file file--mime-application-octet-stream file--general icon-before"><span class="file-icon"><span class="icon glyphicon glyphicon-file text-primary" aria-hidden="true"></span></span><span class="file-link"><a href="http://robotic-controls.com/sites/default/files/learn/ubuntu-13.04-console-armhf-2013-05-18.tar.xz" type="application/octet-stream; length=128496596" title="Open file in new window" target="_blank" data-toggle="tooltip" data-placement="bottom">ubuntu-13.04-console-armhf-2013-05-18.tar.xz</a></span><span class="file-size">122.54 MB</span></span></div> </div> </div> <section> </section> <div class="field field--name-field-disqus field--type-disqus-comment field--label-above"> <div class="field--label">Disqus</div> <div class="field--item"><drupal-render-placeholder callback="Drupal\disqus\Element\Disqus::displayDisqusComments" arguments="0=BeagleBone%20Black%20with%20Ubuntu&amp;1=http%3A//robotic-controls.com/learn/beaglebone/beaglebone-black-ubuntu&amp;2=node/66" token="JBcU9RflPUSRmsbaG20ewX9ZtTcMhYQ0pkTS4WtRRw4"></drupal-render-placeholder></div> </div> Wed, 29 May 2013 03:13:50 +0000 Evan Boldt 66 at http://robotic-controls.com http://robotic-controls.com/learn/beaglebone/beaglebone-black-ubuntu#comments