This respository contains all the settings and software required to setup MachineKit on a BeagleBone Black for controlling the Pocket NC v2.
This document is in progress, it may not be complete or correct
# with wget
wget https://rcn-ee.com/rootfs/bb.org/testing/2017-02-12/machinekit/bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz
# with curl
curl -O https://rcn-ee.com/rootfs/bb.org/testing/2017-02-12/machinekit/bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz
xzcat bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz > bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img
# on linux /dev/sdX on Mac /dev/rdiskX (on Mac you can use diskutil list to find what X is, make sure you use diskutil unmountDisk /dev/diskX)
sudo dd bs=1m if=bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img of=/dev/<sdcard>
Insert the SD card into the BBB and power it on over USB. Connect to the BBB and enable the flasher script on boot. Then reboot to flash the image.
ssh [email protected]
sudo sed -i 's/^#cmdline=init=\/opt\/scripts\/tools\/eMMC\/init-eMMC-flasher-v3.sh$/cmdline=init=\/opt\/scripts\/tools\/eMMC\/init-eMMC-flasher-v3.sh/' /boot/uEnv.txt
sudo reboot
We're going to change the machinekit user name to pocketnc by creating a temporary user, giving it sudo privileges, changing the machinekit user to pocketnc using the temporary user, then deleting the temporary user.
# use username/password machinekit/machinekit
ssh [email protected]
sudo adduser temporary
sudo adduser temporary sudo
exit
ssh [email protected]
# The next command will error if there are any processes running owned by the machinekit user.
# It will list the process id. Run `sudo kill <process id>` for every process until the following command goes through.
sudo usermod -l pocketnc machinekit
sudo usermod -d /home/pocketnc -m pocketnc
exit
# password should still be machinekit
ssh [email protected]
# change password to pocketnc (or whatever you like)
passwd
# Setup no password for sudo
# on the last line change machinekit to pocketnc
# it should look like (no #):
# pocketnc ALL=NOPASSWD: ALL
sudo visudo
sudo deluser temporary
sudo rm -r /home/temporary
sudo ln -s /home/pocketnc /home/machinekit
sudo sh -c "cat <<EOF > /etc/issue.net
Debian GNU/Linux 8
Pocket NC Image (based on Machinekit Debian Image 2017-02-12)
Support/FAQ: http://www.pocketnc.com/faq
default username:password is [pocketnc:pocketnc]
EOF"
sudo cp /etc/issue.net /etc/issue
# Uncomment line #iface eth0 inet dhcp in /etc/network/interfaces
sudo sed -i 's/^#iface eth0 inet dhcp$/iface eth0 inet dhcp/' /etc/network/interfaces
# Change hostname from beaglebone to pocketnc
sudo sed -i 's/beaglebone/pocketnc/g' /etc/hosts
sudo sed -i 's/beaglebone/pocketnc/g' /etc/hostname
sudo reboot
sudo apt-get update
sudo apt-get upgrade
# disable lightdm (the windowing system)
sudo systemctl disable lightdm
sudo systemctl disable apache2
sudo systemctl stop apache2
sudo pip install tornado # currently 4.5.2
sudo apt-get install graphviz graphviz-dev # 2.38.0-7
sudo pip install pygraphviz --install-option="--include-path=/usr/include/graphviz/" --install-option="--library-path=/usr/lib/graphviz"
sudo pip install netifaces
git clone --recursive https://github.com/PocketNC/pocketnc.git
cd pocketnc
sudo ./enableServices.sh
./postUpdate.sh
mkdir ~/ncfiles
sudo reboot
cd /opt/scripts/tools/
sudo ./update_kernel.sh --bone-rt-channel --lts-4_14
sudo reboot
sudo sed -i 's/^#uboot_overlay_addr0=\/lib\/firmware\/<file0>.dtbo$/uboot_overlay_addr0=\/lib\/firmware\/PocketNCdriver-00A0.dtbo/' /boot/uEnv.txt