MachineKit Installation on BeagleBone Black

2,423 views
Skip to first unread message

Michel Scory

unread,
Mar 3, 2015, 1:37:27 PM3/3/15
to machi...@googlegroups.com
Hello,

I'm a retired software engineer.  I'm building a CNC router for myself.  I'd like to use MachineKit on a BeagleBone Black.  Having read a lot of things on your blog, it is still not clear for me how to do that.  I'm not at all comfortable with Linux, that could explain my problem.  So:

- I make an image using this compressed file.  I can boot the BBB with it. But was it the thing to do ?  How can now start LinuxCNC ?  This image is updated twice a week.  Is it already operationnal ?  Any restrictions?

- I also found this.  Have I to use that procedure instead of the MachineKit image ?  Is it obsolete ?

Thanks for your help
Kind regards

Michel

Doug LaRue

unread,
Mar 3, 2015, 2:26:59 PM3/3/15
to machi...@googlegroups.com
I'm just starting too but have a background with/on Linux and so far I've done these steps to get the BBB working so far(not running a machine yet though):

1) find and download an image for the BBB
2) extract the image since it's compressed and then xfer that image to a microSD card. Not copy the file but image the microSD
3) move microSD to the BBB, connect USB cable and power up the BBB. Watch for lots of blinking lights.
4) you should get a network device created on your computer connected to the BBB
5) log into the BBB over the network( ssh -X machi...@beaglebone.local ) using the ssh program on your computer( you might have to get that )
the password for the login is "machinekit"
6) start LinxCNC by entering "linuxcnc &"
7) if you have an XServer running on your host computer you will see the Axis GUI of LinuxCNC.

You can also connect a HDMI screen, mouse and keyboard to the BBB and do all this directly on the BBB just like it's a full computer. Instead of using ssh you will just need to click a LinuxCNC icon once logged in or open a terminal window and enter that "linuxcnc &" command.

Then it's all about configuring the software for your hardware.
Doug

Kent A. Reed

unread,
Mar 3, 2015, 2:29:26 PM3/3/15
to machi...@googlegroups.com
On 03/03/2015 01:37 PM, Michel Scory wrote:
> Hello,
>
> I'm a retired software engineer. I'm building a CNC router for
> myself. I'd like to use MachineKit on a BeagleBone Black. Having
> read a lot of things on your blog, it is still not clear for me how to
> do that. I'm not at all comfortable with Linux, that could explain my
> problem. So:
>

Hi, Michel.

I'd strongly suggest you divide and conquer. Since you're not
comfortable with Linux and you know nothing yet about Machinekit, how
about you learn about them separately from learning about getting a
BeagleBone Black set up to work with your router. For the latter, you
can get substantial information on Charles Steinkuehler's blog which has
become part of the Machinekit community. See http://blog.machinekit.io
(but, please, read through the rest of the machinekit.io site too:
http://machinekit.io)

For the former, I'd suggest you create a Debian 7 (Wheezy) virtual
machine on whatever system you use now, whether Microsoft Windows or
some Linux distro. I'd suggest you use Oracle VirtualBox Manager as the
basis for creating a virtual machine. I've used it in both Windows and
Linux with good results. Once the virtual machine is created, you can
follow the install-from-packages instructions on http://machinekit.io to
get Machinekit going. Then you can play with LinuxCNC (the executable
CNC controller which comes with Machinekit) to gain familiarity with the
program and its components.

Regards,
Kent



Doug LaRue

unread,
Mar 3, 2015, 2:39:00 PM3/3/15
to machi...@googlegroups.com
@Kent has a good idea about getting basic familiarity with Linux and I would like to offer up a couple of other options to doing that besides creating virtual machines and going that route( unless you already know and use virtual machines ):

1) download Ubuntu LXde( http://lxde.org/ ) and burn a DVD to boot your computer from that. ie you boot your computer off the DVD and play without messing with anything on your computers hard disk.

2) connect a display, keyboard, mouse to your BBB and play with Linux from the microSD image you would have to setup and install in the BBB. If you mess anything up on the microSD then you just copy the original image back onto it and start over.

just becoming familiar with clicking on things in linux, finding file browsers, opening up a terminal window, etc should be enough to get going with before jumping right to MachineKit.

Doug

Charles Steinkuehler

unread,
Mar 3, 2015, 3:02:13 PM3/3/15
to machi...@googlegroups.com
On 3/3/2015 12:37 PM, Michel Scory wrote:
> - I make an image using this compressed file
> <http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#BBW.2FBBB_.28All_Revs.29_Machinekit>.
> I can boot the BBB with it. But was it the thing to do ? How can now
> start LinuxCNC ? This image is updated twice a week. Is it already
> operationnal ? Any restrictions?

The image you listed is the best one to start with, and yes you simply
use it to boot the BBB.

If you're using the HDMI out on the BBB with a USB mouse/keyboard, just
click on the "launcher" button (lower left-hand corner) and you'll be
able to run Machinekit (probably still labeled LinuxCNC on the images)
and select a configuration. You can use "sim" configurations
(simulation) which don't require any hardware, or one of the ARM
configurations setup for the BeagleBone (these will generally run w/o
the required cape, but you obviously won't be able to actually move motors).

From there it's a matter of tuning the configuration to your machine.

There are many other options, including running via X11 port forwarding
or using one of the new remote interfaces, but IMHO using HDMI is the
easiest way to get started.

--
Charles Steinkuehler
cha...@steinkuehler.net

signature.asc

Viesturs Lācis

unread,
Mar 3, 2015, 3:34:43 PM3/3/15
to machi...@googlegroups.com


On Tuesday, March 3, 2015 at 9:39:00 PM UTC+2, Doug LaRue wrote:

1) download Ubuntu LXde( http://lxde.org/ ) and burn a DVD to boot your computer from that. ie you boot your computer off the DVD and play without messing with anything on your computers hard disk.

I would like to add that app called "unetbootin" (http://unetbootin.sourceforge.net/) is a great tool to create bootable usb drive from ISO image. I like it that way because:
1) it is easy to scratch/damage the disk in machine shop environment
2) it is very easy to update the image on the usb drive (simply download the new image and rerun the process with unetbootin), while it is not possible with dvd-r discs (it is possible with dvd-rw discs)
3) that image takes about 1GB on flash drive, and since I have it placed on 4GB drive, I still am using that extra space on the same usb device also for storage (for less risk of deleting important files I simply created new folder, in which I place all my stuff)

Robert Nelson

unread,
Mar 3, 2015, 3:41:32 PM3/3/15
to Viesturs Lācis, Machinekit Mailing List
Oh don't use unetbootin!!!

http://bugs.debian.org/775689

Now days, both ubuntu/debian produce hybrid *.iso's that can be dd'ed
directly to your usb flash media. (or burnt to a cd/dvd)

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Viesturs Lācis

unread,
Mar 3, 2015, 3:46:28 PM3/3/15
to machi...@googlegroups.com, viestur...@gmail.com


On Tuesday, March 3, 2015 at 10:41:32 PM UTC+2, Robert Nelson wrote:

Oh don't use unetbootin!!!

http://bugs.debian.org/775689

Now days, both ubuntu/debian produce hybrid *.iso's that can be dd'ed
directly to your usb flash media. (or burnt to a cd/dvd)

Ok, thanks for correction, did not know that. That might explain some difficulties I have had with some of my installs not starting up on first boot...
But how is a windows user supposed to create bootable usb drive? That phrase about dd'ing seems like a use of some linux command/tool.

sam sokolik

unread,
Mar 3, 2015, 3:49:50 PM3/3/15
to machi...@googlegroups.com
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Visit this group at http://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Michel Scory

unread,
Mar 3, 2015, 3:50:49 PM3/3/15
to machi...@googlegroups.com
Thanks so much to everybody.  With your help, I succeeded in starting LinuxCNC on a XWindow on my Windows PC (XMing - Putty).  BBB was already connected to my home network.

Next step: I will try to connect it using Wifi ... and learn a little bit more about Linux and MachineKit !

Kind regards
Michel

Viesturs Lācis

unread,
Mar 3, 2015, 4:09:11 PM3/3/15
to machi...@googlegroups.com


On Tuesday, March 3, 2015 at 10:49:50 PM UTC+2, samcoinc wrote:

Thank you! 

Michel Scory

unread,
Mar 31, 2015, 7:32:37 AM3/31/15
to machi...@googlegroups.com
Hello,

My first CNC is now built.  I installed a wifi repeater with a RJ45 plug on it.  The BBB is connected to the repeater (Netgear WN3000RP 30€) and so I can access the BBB remotely without any change in the Linux configuration.

I have now to make a proper configuration file.  Being new with LinuxCNC or Machinekit, I'm a bit confused.  If I could get a configuration to start with, it would greatly help me:

- BeagleBone Black with Bebopr++ (mapping the entries is the most difficult part for me)
- for info: gantry style with 3 axis (Leadshine DM556)

Thanks
Kind regards

Michel

Alexander Rössler

unread,
Mar 31, 2015, 8:56:51 AM3/31/15
to Michel Scory, machi...@googlegroups.com
Take a look at
https://github.com/machinekit/machinekit/tree/master/configs/ARM/BeagleBone/BeBoPr%2B%2B
there are some example configs for different machines and the BeBoPr++
--
Alexander

Michel Scory

unread,
Mar 31, 2015, 8:17:41 PM3/31/15
to machi...@googlegroups.com, michel...@gmail.com
Thank you Alexander.
 I'm trying to understand how it works.  Not easy as I never worked with Linux or Unix.  Cross fingers !

Regards
Michel

Michel Scory

unread,
Apr 2, 2015, 4:48:47 AM4/2/15
to machi...@googlegroups.com, michel...@gmail.com
Hello,

If I've understood Pepper and Polulu are onboard drivers.  I'm going to use offboard drivers.  So, the I/O addreses should be different and I didn't find these addresses in the BeBoPr++ user manual.  Anyway I would be happy to understand the mapping with the hardware.  More specifically I found the following instructions in the Hal configuration file:

loadrt hal_bb_gpio ouput_pins=107,126,217,218,224,226 input_pins=108,109,110,114,117,118
or
setp [pruconf](driver).stepgen.00.steppin 0x4C

Are these references (108,109, ...) and addresses (0x4C) described anywhere ?

Bas de Bruijn

unread,
Apr 2, 2015, 6:03:36 AM4/2/15
to Michel Scory, machi...@googlegroups.com, michel...@gmail.com


On 02 Apr 2015, at 10:48, Michel Scory <michel...@gmail.com> wrote:

Hello,

If I've understood Pepper and Polulu are onboard drivers.  I'm going to use offboard drivers.  So, the I/O addreses should be different and I didn't find these addresses in the BeBoPr++ user manual.  Anyway I would be happy to understand the mapping with the hardware.  More specifically I found the following instructions in the Hal configuration file:

Pepper and pololu are drivers you can attach to the bebopr++ board.
If you want to get the signals you can just wire then to the appropriate banks. So instead of a pololu module just get the signal from the hardware.

The pins you want are the ones with "steppin" and "stepdir"

Bas (de B)


loadrt hal_bb_gpio ouput_pins=107,126,217,218,224,226 input_pins=108,109,110,114,117,118
or
setp [pruconf](driver).stepgen.00.steppin 0x4C

Are these references (108,109, ...) and addresses (0x4C) described anywhere ?

Thanks for your help
Kind regards

Michel


Michel Scory

unread,
Apr 2, 2015, 6:53:15 AM4/2/15
to machi...@googlegroups.com, michel...@gmail.com
Hello Bas,

Thanks for your reply.
 
"So instead of a pololu module just get the signal from the hardware."  Obviously.  But how can I do that ?  I need adresses.  Somewhere I have to define a mapping between the hardware and variables or something like that.  So I need hardware adresses where I can get signals.  The Hal file seems to be designed to do that.  I found pin number references (where are they described ?) and addresses (like 0x4C).  I would be happy to get a description: which addresses are corresponding to which pins or hardware signals.

All this stuff is probably obvious for many people.  Again I'm new in this area and no expertise with Linux.

Bas Laarhoven

unread,
Apr 2, 2015, 8:53:02 AM4/2/15
to Michel Scory, machi...@googlegroups.com

Michel,

There main difference between a 4-axis (Pololu) configuration and 5-axis (external stepper) one is in the enable signals. Otherwise the X, Y, Z and A STEP and DIRECTION signals are the same for all configurations. Two of the four enable signals used for the on-board stepper modules are used for the fifth (B) axis when using off-board stepper drivers and only one (TAKE-5, XTRUDR & J5-BOB) or two enable signals (PEPPER) are used for the external stepper configurations.

If you're using only 4 axis with off-board drivers, you should be able to use the BeBoPr++/Pololu configuration (configs/ARM/BeagleBone/BeBoPr++/Pololu/BeBoPr++). _Only_ if you want to use the 5th (B) axis, some changes are needed and you'll need to configure pins and addresses. The four axes configuration should work as is. But you have to make sure you get a working set because MachineKit is a moving target and sometimes the changes break the existing configurations.

The above Pololu configuration uses active low enable signals (pulled high in ESTOP). Depending on your hardware it may be necessary to invert this signal. If you start with the enable (actually it's disable) leads to the drivers disconnected you should be able to move the axes. Does that work? The next step would be to configure the enable signal, but let's take one step at a time.

-- Bas (L.)

Charles Steinkuehler

unread,
Apr 2, 2015, 9:13:14 AM4/2/15
to machi...@googlegroups.com
What Bas said. :)

...but to specifically answer your question about the pin numbers like
0x4C and 108, those are the old cryptic values and are somewhat
documented in this spreadsheet:

https://github.com/cdsteinkuehler/beaglebone-black-pinmux/blob/hal_pru_generic/pinmux.ods

The new much-less-cryptic values (which can be used with any recent
package based install) allow you to simply use 8xx and 9xx for the P8
and P9 pins. Or in other words, if you want to tie something to P8 pin
9, you'd use the value 809.

...but as Bas said, you probably just need to hook some wires to your
external driver, and shouldn't have to mess with assigning pin numbers
since that's already done in the example configuration.
>> <mailto:machinekit+...@googlegroups.com>.
>> Visit this group at http://groups.google.com/group/machinekit.
>> For more options, visit https://groups.google.com/d/optout.
>


--
Charles Steinkuehler
cha...@steinkuehler.net

Michel Scory

unread,
Apr 2, 2015, 9:32:01 AM4/2/15
to machi...@googlegroups.com, michel...@gmail.com
Thank you Charles.  I'm going to read these documents.
Starting the Polulu config, I get the following messages:

LINUXCNC - 2.7.0~pre0
Machine configuration directory is '/home/machinekit/linuxcnc/configs/ARM.BeagleBone.BeBoPr++.Pololu'
Machine configuration file is 'BeBoPr++.ini'
Starting LinuxCNC...
io started
halcmd loadusr io started
Cape "cape-bebopr-brdg" with EEPROM in slot 0 is not active
Need to load overlay
Loading overlay "cape-bebopr-pp:R3" ... bash: line 0: echo: write error: No such file or directory
Failed
Loading overlay "cape-bebopr-brdg:R2" ... bash: line 0: echo: write error: File exists
Failed
Loading overlay "BB-LCNC-BEBOPRBR" ... bash: line 0: echo: write error: No such file or directory
Failed
task pid=9731
emcTaskInit: using builtin interpreter
Shutting down and cleaning up LinuxCNC...
Cleanup done

Using lineardelta within the Polulu subdir:
LINUXCNC - 2.7.0~pre0
Machine configuration directory is '/home/machinekit/linuxcnc/configs/ARM.Beagle                                                                                        Bone.BeBoPr++.Pololu-1'
Machine configuration file is 'lineardelta.ini'
Starting LinuxCNC...
io started
halcmd loadusr io started
Cape "cape-bebopr-brdg" with EEPROM in slot 0 is not active
Need to load overlay
Loading overlay "cape-bebopr-pp:R3" ... bash: line 0: echo: write error: No such                                                                                         file or directory
Failed
Loading overlay "cape-bebopr-brdg:R2" ... bash: line 0: echo: write error: File                                                                                         exists
Failed
Loading overlay "BB-LCNC-BEBOPRBR" ... bash: line 0: echo: write error: No such                                                                                         file or directory
Failed
lineardelta.hal:31: insmod failed, returned -1
See the log and output of 'dmesg' for more information.
Shutting down and cleaning up LinuxCNC...
Cleanup done
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/machinekit/linuxcnc_debug.txt
and
    /home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

I probably have to fix these problems before anything else.  Would it be a wiring problem ?

Thanks
Michel 

Bas Laarhoven

unread,
Apr 2, 2015, 9:41:03 AM4/2/15
to Michel Scory, machi...@googlegroups.com
On 2-4-2015 15:32, Michel Scory wrote:
Thank you Charles.  I'm going to read these documents.
Starting the Polulu config, I get the following messages:

LINUXCNC - 2.7.0~pre0
Machine configuration directory is '/home/machinekit/linuxcnc/configs/ARM.BeagleBone.BeBoPr++.Pololu'
Machine configuration file is 'BeBoPr++.ini'
Starting LinuxCNC...
io started
halcmd loadusr io started
Cape "cape-bebopr-brdg" with EEPROM in slot 0 is not active
Need to load overlay
Loading overlay "cape-bebopr-pp:R3" ... bash: line 0: echo: write error: No such file or directory
Failed
Loading overlay "cape-bebopr-brdg:R2" ... bash: line 0: echo: write error: File exists
Failed
Loading overlay "BB-LCNC-BEBOPRBR" ... bash: line 0: echo: write error: No such file or directory
Failed
task pid=9731
emcTaskInit: using builtin interpreter
Shutting down and cleaning up LinuxCNC...
Cleanup done


Can you send me the output of 'cat /sys/device/bone_capemgr.*/slots ? It should look similar to the output below.

root@beaglebone:~# cat /sys/devices/bone_capemgr.9/slots
 0: 54:P---L BeBoPr (3D-printer/CNC) Cape,R2,www.bebopr.info,cape-bebopr-brdg
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

There's probably a problem with some path. These have changed a lot lately, it's a moving target for me :-/

-- Bas (L.)


Charles Steinkuehler

unread,
Apr 2, 2015, 10:50:56 AM4/2/15
to machi...@googlegroups.com
On 4/2/2015 8:41 AM, Bas Laarhoven wrote:
>
> Can you send me the output of 'cat /sys/device/bone_capemgr.*/slots ? It
> should look similar to the output below.
>
> root@beaglebone:~# cat /sys/devices/bone_capemgr.9/slots
> 0: 54:P---L BeBoPr (3D-printer/CNC)
> Cape,R2,www.bebopr.info,cape-bebopr-brdg
> 1: 55:PF---
> 2: 56:PF---
> 3: 57:PF---
> 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
> 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
>
> There's probably a problem with some path. These have changed a lot
> lately, it's a moving target for me :-/

There's an issue with the script that looks for the cape. It doesn't
see the cape is already loaded via EEPROM (as above) so it goes through
trying to load three or so different capes, all of which fail (since
they conflict with the already loaded cape). I didn't try fixing this
before MRRF since the errors are generally benign and don't keep a
proper configuration from working.

--
Charles Steinkuehler
cha...@steinkuehler.net

Charles Steinkuehler

unread,
Apr 2, 2015, 10:55:49 AM4/2/15
to machi...@googlegroups.com
On 4/2/2015 8:32 AM, Michel Scory wrote:
>
> Using lineardelta within the Polulu subdir:
>
> LINUXCNC - 2.7.0~pre0
> Machine configuration directory is
> '/home/machinekit/linuxcnc/configs/ARM.Beagle
>
> Bone.BeBoPr++.Pololu-1'
> Machine configuration file is 'lineardelta.ini'
> Starting LinuxCNC...
> io started
> halcmd loadusr io started
> Cape "cape-bebopr-brdg" with EEPROM in slot 0 is not active
> Need to load overlay
> Loading overlay "cape-bebopr-pp:R3" ... bash: line 0: echo: write error: No
> such
> file or directory
> Failed
> Loading overlay "cape-bebopr-brdg:R2" ... bash: line 0: echo: write error:
> File
> exists
> Failed
> Loading overlay "BB-LCNC-BEBOPRBR" ... bash: line 0: echo: write error: No
> such
> file or directory
> Failed

The errors up to here are probably OK. The script doesn't detect that
the cape is already loaded and keeps trying to load a few alternate
versions.

> lineardelta.hal:31: insmod failed, returned -1

This is your real problem, and was recently fixed. See the list
archives for the details if you want to modify your existing setup (the
PRUBIN path in your ini file and the PRU driver load command in the HAL
file), or just update to the latest version of the Machinekit packages
("apt-get update" followed by "apt-get upgrade") and start over with a
new sample configuration.

Details:

https://github.com/machinekit/machinekit/commit/62d85415d9f25b9a06507e27e0b7d4a552f02968

--
Charles Steinkuehler
cha...@steinkuehler.net

Bas Laarhoven

unread,
Apr 2, 2015, 11:04:29 AM4/2/15
to Charles Steinkuehler, machi...@googlegroups.com
Indeed, I only wanted to make sure that a proper overlay was active.
BTW: This error can be prevented by disabling the bebopr_brdg overlay in
the uEnv.txt.
That is also necessary when using the DECAMUX that needs the bebopr_pp
overlay
instead of the bebopr_brdg.

-- Bas

Michel Scory

unread,
Apr 2, 2015, 11:21:54 AM4/2/15
to machi...@googlegroups.com, michel...@gmail.com
Hello Bas,

Here is the content of the file:

machinekit@beaglebone:/sys/devices/bone_capemgr.9$ head -100 slots
 0: 54:P---L BeBoPr (3D-printer/CNC) Cape,R2,www.bebopr.info,cape-bebopr-brdg
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-L Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 

Bas Laarhoven

unread,
Apr 2, 2015, 6:14:56 PM4/2/15
to Michel Scory, machi...@googlegroups.com
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Visit this group at http://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Good, this confirms that the BeBoPr's EEPROM is valid and found, and the DT overlay is loaded.

Did you succeed with Charles' suggestion from his latest mail?

-- Bas (L.)

Michel Scory

unread,
Apr 2, 2015, 6:36:35 PM4/2/15
to machi...@googlegroups.com, michel...@gmail.com
It works !!

Thank so much everybody.

Now, I have to clean up the config files (I understood that I have to negate the enable signal) and understand them a little bit more.

Kind regards
Michel
Reply all
Reply to author
Forward
0 new messages