Verison 1.0.3 Release
Based on Buildbotics 0.4.14
This commit is contained in:
41
docs/bbdev-chroot.md
Normal file
41
docs/bbdev-chroot.md
Normal file
@@ -0,0 +1,41 @@
|
||||
This document describes how to setup a Buildbotics development environment
|
||||
on a Debian based system inside a chroot. Building in the chroot ensures that
|
||||
you have a clean and consistent build environment unaltered by other packages
|
||||
or manual changes.
|
||||
|
||||
# Install packages required to create chroot
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install binutils debootstrap
|
||||
|
||||
# Create chroot environment
|
||||
|
||||
mkdir bbdev
|
||||
sudo debootstrap --arch amd64 stable bbdev http://deb.debian.org/debian
|
||||
|
||||
# Copy downloaded files (optional)
|
||||
To speed things up you can copy to large downloads, if you already have them,
|
||||
into the chroot.
|
||||
|
||||
sudo mkdir -p bbdev/opt/bbctrl-firmware/src/bbserial/
|
||||
sudo cp 2017-11-29-raspbian-stretch-lite.zip bbdev/opt/bbctrl-firmware/
|
||||
sudo cp raspberrypi-kernel_1.20171029-1.tar.gz bbdev/opt/bbctrl-firmware/src/bbserial/
|
||||
|
||||
# Enter the chroot
|
||||
|
||||
sudo mount --bind /proc bbdev/proc
|
||||
sudo mount --rbind /sys bbdev/sys
|
||||
sudo mount --rbind /dev bbdev/dev
|
||||
sudo chroot bbdev
|
||||
cd /opt
|
||||
|
||||
Now, follow the instructions in [development.md](development.md) from with in
|
||||
the chroot.
|
||||
|
||||
# Exit the chroot
|
||||
To exit the chroot:
|
||||
|
||||
exit
|
||||
sudo umount bbdev/dev
|
||||
sudo umount bbdev/sys
|
||||
sudo umount bbdev/proc
|
||||
BIN
docs/buildbotics_architecture_overview.png
Normal file
BIN
docs/buildbotics_architecture_overview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 333 KiB |
BIN
docs/buildbotics_controller.png
Normal file
BIN
docs/buildbotics_controller.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 203 KiB |
68
docs/cross_compile_rpi_kernel_module.md
Normal file
68
docs/cross_compile_rpi_kernel_module.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Install the cross compiler
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-arm-linux-gnueabihf
|
||||
|
||||
# Determine the correct kernel version on the target pi
|
||||
|
||||
dpkg-query -l raspberrypi-kernel
|
||||
|
||||
# Get the kernel source for the correct kernel version
|
||||
|
||||
wget https://github.com/raspberrypi/linux/archive/raspberrypi-kernel_1.20171029-1.tar.gz
|
||||
tar xf raspberrypi-kernel_1.20171029-1.tar.gz
|
||||
cd linux-raspberrypi-kernel_1.20171029-1
|
||||
|
||||
# Prep the kernel source
|
||||
|
||||
KERNEL=kernel7
|
||||
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
|
||||
make -j 8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare
|
||||
|
||||
# Create hello.c module
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static int hello_init(void) {
|
||||
printk(KERN_ALERT "Hello world!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hello_exit(void) {
|
||||
printk(KERN_ALERT "Goodbye cruel world!\n");
|
||||
}
|
||||
|
||||
module_init(hello_init);
|
||||
module_exit(hello_exit);
|
||||
|
||||
# Create a Makefile
|
||||
|
||||
CROSS := arm-linux-gnueabihf-
|
||||
DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
obj-m := hello.o
|
||||
|
||||
all:
|
||||
$(MAKE) ARCH=arm CROSS_COMPILE=$(CROSS) -C kernel M=$(DIR) modules
|
||||
|
||||
clean:
|
||||
$(MAKE) ARCH=arm CROSS_COMPILE=$(CROSS) -C kernel M=$(DIR) clean
|
||||
|
||||
# Compile the module
|
||||
|
||||
ln -sf path/to/rpi-kernel kernel
|
||||
make
|
||||
|
||||
# Copy module to rpi
|
||||
|
||||
scp hello.ko pi.local:
|
||||
|
||||
# Load it on the pi
|
||||
|
||||
sudo insmod hello.ko
|
||||
|
||||
# Look for message in syslog
|
||||
|
||||
tail /var/log/syslog
|
||||
106
docs/development.md
Normal file
106
docs/development.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# Buildbotics CNC Controller Development Guide
|
||||
|
||||
This document describes how to setup your environment for Buildbotics CNC
|
||||
controller development on Debian Linux. Development on systems other than
|
||||
Debian Linux are not supported.
|
||||
|
||||
## Installing the Development Prerequisites
|
||||
|
||||
On a Debian Linux (9.6.0 stable) system install the required packages:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential git wget binfmt-support qemu \
|
||||
parted gcc-avr avr-libc avrdude pylint3 python3 python3-tornado curl \
|
||||
unzip python3-setuptools gcc-arm-linux-gnueabihf bc sudo
|
||||
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
## Getting the Source Code
|
||||
|
||||
git clone https://github.com/buildbotics/bbctrl-firmware
|
||||
|
||||
## Build the Firmware
|
||||
|
||||
cd bbctrl-firmware
|
||||
make
|
||||
|
||||
## Build GPlan Module
|
||||
|
||||
GPlan is a Python module written in C++. It must be compiled for ARM so that
|
||||
it can be used on the Raspberry Pi. This is accomplished using a chroot, qemu
|
||||
and binfmt to create an emulated ARM build environment. This is faster and
|
||||
more convenient than building on the RPi itself. All of this is automated.
|
||||
|
||||
make gplan
|
||||
|
||||
The first time this is run it will take quite awhile as it setups up the build
|
||||
environment. You can run the above command again later to build the latest
|
||||
version.
|
||||
|
||||
## Build the Firmware Package
|
||||
|
||||
make pkg
|
||||
|
||||
The resulting package will be a ``.tar.bz2`` file in ``dist``.
|
||||
|
||||
## Upload the Firmware Package to a Buildbotics CNC Controller
|
||||
If you have a Buildbotics CNC controller at ``bbctrl.local``, the default
|
||||
address, you can upgrade it with the new package like this:
|
||||
|
||||
make update HOST=bbctrl.local PASSWORD=<pass>
|
||||
|
||||
Where ``<pass>`` is the controller's admin password.
|
||||
|
||||
## Updating the Pwr Firmware
|
||||
|
||||
The Pwr firmware must be uploaded manually using an ISP programmer. With the
|
||||
programmer attached to the pwr chip ISP port on the Builbotics controller's
|
||||
main board run the following:
|
||||
|
||||
make -C src/pwr program
|
||||
|
||||
## Initializing the main AVR firmware
|
||||
|
||||
The main AVR must also be programmed manually the first time. Later it will be
|
||||
automatically programmed by the RPi as part of the firmware install. To perform
|
||||
the initial AVR programming connec the ISP programmer to the main AVR's ISP port
|
||||
on the Buildbotics controller's main board and run the following:
|
||||
|
||||
make -C src/avr init
|
||||
|
||||
This will set the fuses, install the bootloader and program the firmware.
|
||||
|
||||
## Installing the RaspberryPi base system
|
||||
|
||||
Download the latest Buildbotics CNC controller base image and decompress it:
|
||||
|
||||
wget \
|
||||
https://buildbotics.com/upload/2018-05-15-raspbian-stretch-bbctrl.img.xz
|
||||
xz -d 2018-05-15-raspbian-stretch-bbctrl.img.xz
|
||||
|
||||
Now copy the base system to an SD card. You need a card with at least 8GiB.
|
||||
After installing the RPi system all data on the SD card will be lost. So make
|
||||
sure you back up the SD card if there's anything important on it.
|
||||
|
||||
In the command below, make sure you have the correct device or you can
|
||||
**destroy your Linux system** by overwriting the disk. One way to do this is
|
||||
to run ``sudo tail -f /var/log/syslog`` before inserting the SD card. After
|
||||
inserting the card look for log messages containing ``/dev/sdx`` where ``x`` is
|
||||
a letter. This should be the device name of the SD card. Hit ``CTRL-C`` to
|
||||
stop following the system log.
|
||||
|
||||
sudo dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sde
|
||||
sudo sync
|
||||
|
||||
The first command takes awhile and does not produce any output until it's done.
|
||||
|
||||
Insert the SD card into your RPi and power it on. Plug in the network
|
||||
connection, wired or wireless.
|
||||
|
||||
## Logging into the Buildbotics Controller
|
||||
|
||||
You can ssh in to the Buildbotics Controller like so:
|
||||
|
||||
ssh bbmc@bbctrl.local
|
||||
|
||||
The default password is ``buildbotics``. It's best if you change this.
|
||||
45
docs/emu_chroot.md
Normal file
45
docs/emu_chroot.md
Normal file
@@ -0,0 +1,45 @@
|
||||
This document describes how to setup the Buildbotics firmware in a chroot
|
||||
environment for the purposes of demonstrating the user interface.
|
||||
|
||||
On a Debian system install:
|
||||
|
||||
ROOT=/opt/demo
|
||||
sudo apt-get install -y binutils debootstrap
|
||||
sudo mkdir $ROOT
|
||||
sudo debootstrap --arch amd64 stable $ROOT/ http://deb.debian.org/debian
|
||||
|
||||
Then chroot:
|
||||
|
||||
sudo mount --bind /dev $ROOT/dev/
|
||||
sudo mount --bind /sys $ROOT/sys/
|
||||
sudo mount --bind /proc $ROOT/proc/
|
||||
sudo mount --bind /dev/pts $ROOT/dev/pts
|
||||
sudo chroot $ROOT
|
||||
|
||||
Setup the demo system:
|
||||
|
||||
export LC_ALL=C
|
||||
apt-get update
|
||||
apt-get install -y wget git python3-tornado python3-sockjs-tornado \
|
||||
python3-setuptools python-six build-essential scons libv8-dev
|
||||
libpython3-dev
|
||||
|
||||
cd /opt
|
||||
BASE=https://buildbotics.com/bbctrl
|
||||
LATEST=$(wget $BASE/latest.txt -O- -q)
|
||||
wget $BASE/bbctrl-$LATEST.tar.bz2
|
||||
tar xf bbctrl-$LATEST.tar.bz2
|
||||
ln -sf bbctrl-$LATEST bbctrl
|
||||
|
||||
git clone --depth=1 https://github.com/CauldronDevelopmentLLC/cbang
|
||||
git clone --depth=1 https://github.com/CauldronDevelopmentLLC/camotics
|
||||
export CBANG_HOME=/opt/cbang
|
||||
scons -C cbang -j8 disable_local="re2 libevent"
|
||||
scons -C camotics -j8 gplan.so with_gui=False
|
||||
|
||||
cd bbctrl
|
||||
python3 setup.py install
|
||||
cp /opt/camotics/gplan.so /usr/local/lib/python*/dist-packages/bbctrl-$VERSION-py*.egg/camotics/gplan.so
|
||||
|
||||
mkdir -p /var/lib/bbctrl/upload
|
||||
useradd -u 1001 bbmc
|
||||
Reference in New Issue
Block a user