Cylon adaptor for the Beaglebone Black single-board computer
This module provides an adaptor for the BeagleBone Black single-board computer (http://beagleboard.org/Products/BeagleBone+Black/)
Want to use Ruby on robots? Check out our sister project Artoo (http://artoo.io)
Want to use the Go programming language to power your robots? Check out our sister project Gobot (http://gobot.io).
Installing Cylon.js for the BeagleBone Black is pretty easy, but must be done on the Beaglebone Black itself, or on another Linux computer. Due to I2C device support, the module cannot be installed on OS X or Windows.
$ npm install cylon cylon-beaglebone
var Cylon = require'cylon';// Initialize the robotCylonrobotconnections:beaglebone: adaptor: 'beaglebone'devices:led: driver: 'led' pin: 'P9_12'button: driver: 'button' pin: 'P9_14'mybuttonon'push' myledtoggle;start;
You will likely want to connect your development machine to your BeagleBone Black while working on your code. You can do this easily, just by connecting to the BeagleBone Black over USB. Then, you can connect to the BBB using Network-Over-USB, and upload driver or configuration changes.
Furthermore, the Analog to Digital Converters (ADC) cannot handle more than 1.8V input, so keep this in mind when connecting to analog devices, or risk burning up your BBB.
For OS X, some drivers need to be installed to allow Network-Over-USB access to the BeagleBone black. You can find the instructions on the BeagleBone site's getting started page.
Once you've installed the drivers and connected to the BeagleBone over USB, you can just SSH into it.
The BBB should have an IP address of
For Linux machines, you will need to create a udev rule. You can find the instructions on the BeagleBone site's getting started page.
To connect to the BeagleBone Black from your Linux machine, save this script as
bbb.sh (or whatever name you'd prefer).
Executing the script will then SSH into the BBB.
#!/bin/bashsudo -- sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'sudo iptables -A POSTROUTING -t nat -j MASQUERADEssh email@example.com
For Windows, some drivers need to be installed to allow Network-Over-USB access to the BeagleBone black. You can find the instructions on the BeagleBone site's getting started page.
The connection process for Windows is a bit more involved. But when you're done, it should be just as simple to connect to the board.
By default, the BeagleBone's login credentials are:
You may need to create a bootable SD card with the BBB Debian Linux distro.
To find the name of the SD card on OS X, use the
$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS Macintosh HD 499.4 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk1 1: DOS_FAT_32 UNTITLED 15.9 GB disk1s1
In this case, the SD card's name is
Before you proceed, be sure to eject the mounted volume:
$ diskutil umount /dev/disk1s1
On most Linux distros, the
df -h command should help you determine the name of your SD card.
The image we're using is the official modified Debian distro provided by BeagleBoard, so we'll download it directly from them: http://debian.beagleboard.org/images/bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz.
Once the image has downloaded, uncompress it like this:
The final step is to flash the image onto the SD card.
You can do so by running this command (be sure to update the
of section to point to the SD card name you found earlier!):
$ sudo dd bs=1M if=./bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdb && sudo sync
Insert SD card into your (powered-down) board, hold down the USER/BOOT button (if using Black) and apply power, either by the USB cable or 5V adapter.
After SSHing into the BeagleBone Black, save the following script into
Be sure to do this on the BBB.
This will allow your BeagleBone Black to share your computer's internet connection.
#!/bin/bashROUTE=`route | grep 0.0.0.0 | wc -l`
After the script is saved, it will automatically run when the BeagleBone Black boots, so you only have to do this step once.
At this point, we have a full Debian Linux OS set up, and can connect over SSH to the BBB. Now, we need to adjust the SD card's partitions, to give us space to install dependencies and do some work.
First, login to the board over SSH, and run this series of commands:
$ fdisk /dev/mmcblk0 d 2 n p 2 w $ shutdown -r now
After the board finishes restarting, log back in and resize the filesystem on the SD card before another restart:
$ resize2fs /dev/mmcblk0p2 $ shutdown -r now
After this restart has completed, log back in, and check the partition has been correctly resized:
$ df -h
/dev/root partition should take up the entire size of the SD card.
With this done, we're now ready to start running Cylon directly on the BeagleBone Black.
We're busy adding documentation to our web site at http://cylonjs.com/ please check there as we continue to work on Cylon.js
Version 0.15.0 - Compatibility with Cylon 1.0.0
Version 0.14.2 - Fixes implementation for i2c.
Version 0.14.1 - Adaptor now accepts callbacks and passes back the pinNum in events
Version 0.14.0 - Compatibility with Cylon 0.22.0
Version 0.13.2 - Fixes issue with first run using a PWM pin
Version 0.13.1 - Fixes issue with servo write
Version 0.13.0 - Compatibility with Cylon 0.21.0
Version 0.12.0 - Compatibility with Cylon 0.20.0
Version 0.11.0 - Compatibility with Cylon 0.19.0
Version 0.10.0 - Compatibility with Cylon 0.18.0
Version 0.9.0 - Compatibility with Cylon 0.16.0
Version 0.8.1 - Add peerDependencies to package.json
Version 0.8.0 - Compatibility with Cylon 0.15.0
Version 0.7.0 - Compatibility with Cylon 0.14.0, remove node-namespace.
Version 0.6.0 - Update to Cylon 0.12.0
Version 0.5.1 - Bugfix for i2cread, and more examples
Version 0.5.0 - Update to cylon 0.11.0, migrated to pure JS
Version 0.4.0 - Update to cylon 0.10.0
Version 0.3.0 - Release for cylon 0.9.0
Version 0.2.0 - Release for cylon 0.8.0
Version 0.1.0 - Initial release
Copyright (c) 2013-2015 The Hybrid Group. Licensed under the Apache 2.0 license.