Skip to content

machinekit android demo notes

Michael Haberler edited this page Jun 2, 2014 · 49 revisions

Beaglebone Image preparation

started from setup_sdcard.sh as described here: http://blog.machinekit.io/p/machinekit_16.html

apt-get update
apt-get upgrade
# make free space - wipe docs toolchain
apt-get remove --purge asciidoc source-highlight dblatex  xsltproc groff
apt-get autoremove

looking better now:

rootfs          3.5G  2.5G  863M  75% /
dpkg -i *.deb

speed looks good now:

linuxcnc@arm:~$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 990.68
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc08
CPU revision    : 2
Hardware        : Generic AM33XX (Flattened Device Tree)
Revision        : 0000
Serial          : 0000000000000000

Install prerequisites

Platforms: Ubuntu 10.04 is hopeless - do not waste time with it.

These instructions are targeted for Debian wheezy, the recommended build platform.

First, install prerequisite packages:

sudo apt-get update
sudo apt-get install automake1.11 libtool liburiparser-dev cmake libssl-dev  openssl subversion python-setuptools  libusb-1.0-0-dev libudev-dev  uuid-dev libavahi-client-dev libavahi-compat-libdnssd-dev  avahi-daemon libprotobuf-dev protobuf-compiler python-protobuf libprotoc-dev uuid-runtime python-avahi python-netifaces

Several packages are not available in sufficiently current form in the wheezy package stream, and must be compiled from source until we have those in the deb.machinekit.net debian repo. Once these become available, the below steps should not be needed anymore, the above package list just becomes a bit longer.

Building packages from source - everything built gets installed into /usr/local/ (so they are easy to remove once the debian packages become available):

mkdir src
cd src

get libsodium - authentication & encryption prerequisite for zeromq:

git clone https://github.com/jedisct1/libsodium.git
cd libsodium
git checkout -b 0.5.0 0.5.0  # master can be flaky
sh autogen.sh
./configure --prefix=/usr/local
make
make check  # optional - takes 10+ minutes
sudo make install
sudo ldconfig
cd ..

get libzmq 4.0.4 stable - you can do this only after installing libsodium:

git clone https://github.com/zeromq/zeromq4-x.git
cd zeromq4-x/
git checkout -b v4.0.4 v4.0.4
sh autogen.sh
./configure --prefix=/usr/local --with-pgm --with-libsodium
make
make check # ca 40sec
sudo make install
sudo ldconfig
cd ..

get pyzmq Python zeromq bindings (do this AFTER installing libzmq!); while at it, get some other needed support packages:

sudo easy_install pyzmq websocket-client

get czmq v2.2.0 - czmq has libzmq as a dependency, and hence implicitly libsodium too

git clone git://github.com/zeromq/czmq.git
cd czmq
git checkout -b v2.2.0 v2.2.0
./autogen.sh
./configure --prefix=/usr/local && make check
sudo make install
sudo ldconfig
cd ..

get libwebsockets:

git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets/
mkdir build
cd build/
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local
make
sudo make install
cd ../..

Jansson JSON C Library, minimum version 2.4:

git clone https://github.com/akheron/jansson.git
cd jansson/
git checkout -b 2.5 origin/2.5
autoreconf -i
./configure --prefix=/usr/local
make
make check
sudo make install

cython: Only needed if you want to work on the src/hal/cython/machinekit bindings.

If so, the version in wheezy is too old (0.15.1). Installing cython from testing/jessie works fine.

Clone this wiki locally