NOTICE:Images are now generated by Robert Nelson as part of the standard BeagleBone OS image suite. You can find the latest Machinekit uSD card image at this link.
I have created a turn-key Machinekit BeagleBone SD Card image, based on the official Debian release for the BeagleBone using Robert C Nelson's omap-image-builder scripts and the Machinekit software to allow easy experimentation and to promote the use of Machinekit and LinuxCNC in the 3D printer and maker communities.
NOTE: While I said "turn-key" above, if you are unfamiliar with Linux in general you should not be playing with this setup. I assume if you are wanting to be on this particular bleeding edge you are comfortable typing commands at a Linux command prompt and editing configuration files.
Supported CapesMost of the capes on the Hardware Capes page that are actually available have example configurations in the latest images. If you have questions about a particular cape, please ask on the Machinekit list.
- username: machinekit
- password: machinekit
- login as user machinekit
- use the sudo command, no password required
- Reduce image size by removing the documentation build dependencies for LinuxCNC
- This saves over 1G of space, making the 4G eMMC on the new RevC BeagleBone a useful size (the previous image fit, but just barely and was 100% full before adding any user files!)
- Update the kernel and build scripts, including the new eMMC flasher from RCN
- Switch to the official BeagleBone Debian image as a base, now that the RevC BeagleBone ships with 4GB eMMC and Debian installed by default
- Switch to using Machinekit repositories instead of LinuxCNC, since the universal RTOS support required for running on a BeagleBone is not part of the upcoming LinuxCNC 2.6 release.
- Updated kernel that runs at full speed (the bone33 Xenomai kernel on the previous image was stuck at whatever sluggish speed the boot-loader configured!)
- MANY changes, both big and small related to switching to the BeagleBone version of Debian, for example lxde and systemd are used instead of xfce and sysvinit. If you have issues with the basic Linux environment, first check for BeagleBone Debian specific information, then fall back to standard Debian documentation. See the Support page for links.
- Switch to lightdm to fix issues with consolekit permissions (fixes disabled shutdown/reboot buttons, broken USB auto-mounting, etc)
- Update to latest bone33 kernel
- Update to latest RCN build scripts and Debian 7.3
- Create 4GB image file for users w/o access to an appropriate Linux box for running setup_sdcard.sh
- Switch to 3.8.13xenomai-bone23 kernel
- Leave HDMIN (no audio) enabled by default in uEnv.txt
- Add xfce desktop and netsurf web browser
- Remove apache and udhcpd
- Remove linuxcnc user from admin group to enable existing NOPASSWD setting in sudoers.d to work properly:
gpasswd -d linuxcnc admin
- Switch ~/linuxcnc working copy to MachineKit branch:
cd ~/linuxcnc git fetch origin git checkout -t origin/MachineKit cd src make sudo make setuid
- Disable HDMI and eMMC on boot for BeagleBone Black (conflicts with default BeBoPr pinout)
- Build and install device tree overlay files when creating image
- Install missing packages when creating image
- Add startup script to check for and optionally load any required device tree overlays and export any needed GPIO pins
- Source LinuxCNC rip-environment in .bashrc so LinuxCNC is ready to run at login
- Initial Release
Write the SD card
The following instructions are for Linux, and assume you are comfortable typing commands at the console. Adafruit has some good instructions for imaging the uSD card if you are using Windows or Mac. I also have some (dated) instructions you may find useful if you only have a windows machine and the BeagleBone.
Download the compressed prebuilt image file:
md5sum debian-7.4-machinekit-armhf-2014-05-19-4gb.img.xz a38cadbf40ba18f8b1f1d9ea2fcf9a06 debian-7.4-machinekit-armhf-2014-05-19-4gb.img.xz
xzcat debian-7.4-machinekit-armhf-2014-05-19-4gb.img.xz | dd bs=1024 of=/dev/sdX
username: machinekit password: machinekit
Write the eMMC (RevC ONLY!)UPDATE: The eMMC Flasher image need to have the eMMC device enabled. Edit the uEnv.txt file on the FAT partition, and change the optargs= line to read:
NOTE: Some versions of the eMMC flasher will automatically shut down the BeagleBone. If your BeagleBone turns off, it has been successfully flashed. If there is an error, all for LEDs will flash in unison.
Disk SpaceWARNING: The first Machinekit images based on the BeagleBone Debian image were virtually unusable on a 4GB storage device (either a 4GB uSD card or the RevC on-board 4GB eMMC). Do not try to use one of these images with a 4GB device, make sure you have a newer image (the *.xz image size should be well under 1 GB). If you are using a larger uSD card, you will probably want to run the /opt/scripts/tools/grow_partition.sh script to use all available storage space.
Open a console window and launch LinuxCNC:
- Select the example configuration that matches your hardware (I suggest starting with the CRAMPS configuration if you don't have any hardware) and launch LinuxCNC
- Take the machine out of Emergency Stop (click the big red X)
- Turn the machine on (click the power button next to the big red X)
- Home all axis: Click each axis radio button (X, Y, Z, A, in turn) then click the "home axis" button
- Run the default LinuxCNC gcode program by clicking the "play" button or the Machine -> Run program menu item.
There is a great LinuxCNC User Manual and much more available at the documentation page on the LinuxCNC website.
I will release updates to the SD card image as development progresses, but there should be little or no need to re-image your card from scratch. The OS is Debian Wheezy, and you can stay current on packages and security updates with the usual apt/aptitude tools.
The LinuxCNC code in the image is a full git clone of the repository where BeagleBone development is taking place. To update your LinuxCNC install simply:
cd ~/linuxcnc/src git pull origin make sudo make setuid
If you see the following:
bash: line 0: echo: write error: File exists Error loading device tree overlay file: BB-LCNC-BEBOPR BeBoPr.hal:10: program '/home/linuxcnc/linuxcnc/configs/BeagleBone/BeBoPr/setup.sh' failed, returned 1 Shutting down and cleaning up LinuxCNC...
... then you likely have a resource conflict while trying to load the device tree overlay, perhaps a BeBoPr without a Bridge and you did not modify uEnv.txt. You cannot safely unload device tree overlays, so if you run into this problem, verify the optargs= line in /boot/uboot/uEnv.txt, fix as appropriate to your setup, and reboot.
PLEASE do not ask for support in the comments section!
I am actively monitoring the Beagle Board Google Group and the LinuxCNC user list and developer list. If you have problems, please ask for help in one of these places as appropriate. You may e-mail me directly, but preference will be given to folks who ask questions via the appropriate list, where others can help answer your questions and where the answered questions become a store of knowledge that benefits the whole community.