Difference between revisions of "Gateway installation"

From OpenMotics
Jump to navigation Jump to search
(Created page with "= Installing using a OpenMotics writer SD card = The OpenMotics software will be installed on the eMMC on-board flash storage of the BeagleBone Black. The image is based on ...")
 
Line 16: Line 16:
 
* the boot delay is set to 0 seconds
 
* the boot delay is set to 0 seconds
 
* the watchdog timer is enabled in u-boot
 
* the watchdog timer is enabled in u-boot
 +
 +
= Building from scratch =
 +
 +
== Building the Angström image ==
 +
 +
For the diehards, you can compile the kernel, bootloader and Angström image from sources as described below. This is not required, you can more easily use the writer image described above.
 +
 +
Checkout the Angstrom setup scripts. Our image was built using commit 68f072cee57a008b15f6dfef87ad7b2a1ee7b02e:
 +
 +
<syntaxhighlight lang="bash">
 +
git clone https://github.com/Angstrom-distribution/setup-scripts.git
 +
cd setup-scripts
 +
git checkout 68f072cee57a008b15f6dfef87ad7b2a1ee7b02e .
 +
MACHINE=beagleboard ./oebb.sh config beaglebone
 +
MACHINE=beagleboard ./oebb.sh update beaglebone
 +
source ~/.oe/environment-angstromv2012.12
 +
</syntaxhighlight>
 +
 +
Build the kernel. You can find wdt.patch and omap-serial.c on the OpenMotics gateway repo.
 +
 +
<syntaxhighlight lang="bash">
 +
MACHINE=beaglebone bitbake virtual/kernel -c configure
 +
 +
cd build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git
 +
git apply --ignore-space-change --ignore-whitespace wdt.patch
 +
mv omap-serial.c drivers/tty/serial/omap-serial.c
 +
cd -
 +
 +
MACHINE=beaglebone bitbake virtual/kernel -c compile
 +
MACHINE=beaglebone bitbake virtual/kernel -c deploy
 +
</syntaxhighlight>
 +
 +
 +
Build u-boot. You can find the patch on the OpenMotics gateway repo.
 +
 +
<syntaxhighlight lang="bash">
 +
MACHINE=beaglebone bitbake u-boot-denx -c configure
 +
 +
cd build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-denx-2013.04-r0/git/
 +
git apply 0001-Make-sure-watchdog-is-reenabled-upon-Linux-boot.patch
 +
sed -i 's/#define CONFIG_BOOTDELAY.*1/#define CONFIG_BOOTDELAY                0/' include/configs/am335x_evm.h
 +
cd -
 +
 +
MACHINE=beaglebone bitbake u-boot-denx -c compile
 +
MACHINE=beaglebone bitbake u-boot-denx -c deploy
 +
</syntaxhighlight>
 +
 +
 +
Create the openmotics bitbake configuration and build it:
 +
 +
<syntaxhighlight lang="bash">
 +
cat << EOF > sources/meta-angstrom/recipes-images/angstrom/openmotics-image.bb
 +
#Image for OpenMotics
 +
 +
include systemd-image.bb
 +
 +
ROOTFSTYPE_beaglebone = "ext4"
 +
 +
IMAGE_INSTALL += " \
 +
    kernel-modules \
 +
    python-audio python-codecs python-compile \
 +
    python-compression python-core python-crypt python-ctypes \
 +
    python-datetime python-dbus python-dev python-distutils \
 +
    python-elementtree python-email python-fcntl python-html \
 +
    python-image python-io python-lang python-logging \
 +
    python-math python-mime python-misc python-multiprocessing \
 +
    python-netclient python-netserver python-numbers python-numpy \
 +
    python-numpy-dev python-pickle python-pkgutil python-pprint \
 +
    python-profile python-pycairo python-pyopenssl python-pyserial \
 +
    python-re python-readline python-resource python-setuptools \
 +
    python-shell python-simplejson python-stringold python-subprocess \
 +
    python-syslog python-terminal python-textutils python-threading \
 +
    python-tornado python-unixadmin python-xml python-xmlrpc python-zlib \
 +
    python-sqlite3 python-pygobject python-mmap \
 +
    eglibc-gconv eglibc-gconv-unicode eglibc-gconv-utf-16 \
 +
    i2c-tools procps iproute2 connman-tests systemd-analyze \
 +
    tar task-sdk-target vim ntp screen ntpdate ntpdate-systemd"
 +
 +
export IMAGE_BASENAME = "OpenMotics"
 +
 +
EOF
 +
 +
MACHINE=beaglebone bitbake openmotics-image
 +
</syntaxhighlight>
 +
 +
You can find the kernel, u-boot and image in build/tmp-angstrom_v2012_12-eglibc/deploy/images/beaglebone/
 +
 +
 +
== Install the OpenMotics software ==
 +
 +
Clone the OpenMotics Gateway repo, and run the install scripts:
 +
 +
<syntaxhighlight lang="bash">
 +
./installBase.sh
 +
./installGateway.sh
 +
</syntaxhighlight>

Revision as of 19:12, 19 May 2014

Installing using a OpenMotics writer SD card

The OpenMotics software will be installed on the eMMC on-board flash storage of the BeagleBone Black.

The image is based on Angström Linux 2012.12 and contains extra packages:

  • supervisord
  • openvpn
  • ntpdate

The linux kernel is patched with 2 patches:

  • one patch that implements the RS485 driver in omap-serial
  • one patch that enables the watchdog timer on startup.

Small patches have been applied to the u-boot bootloader:

  • boot is set to the eMMC on-board flash storage
  • the boot delay is set to 0 seconds
  • the watchdog timer is enabled in u-boot

Building from scratch

Building the Angström image

For the diehards, you can compile the kernel, bootloader and Angström image from sources as described below. This is not required, you can more easily use the writer image described above.

Checkout the Angstrom setup scripts. Our image was built using commit 68f072cee57a008b15f6dfef87ad7b2a1ee7b02e:

git clone https://github.com/Angstrom-distribution/setup-scripts.git
cd setup-scripts
git checkout 68f072cee57a008b15f6dfef87ad7b2a1ee7b02e .
MACHINE=beagleboard ./oebb.sh config beaglebone
MACHINE=beagleboard ./oebb.sh update beaglebone
source ~/.oe/environment-angstromv2012.12

Build the kernel. You can find wdt.patch and omap-serial.c on the OpenMotics gateway repo.

MACHINE=beaglebone bitbake virtual/kernel -c configure

cd build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/linux-mainline-3.8.13-r23a/git
git apply --ignore-space-change --ignore-whitespace wdt.patch
mv omap-serial.c drivers/tty/serial/omap-serial.c
cd -

MACHINE=beaglebone bitbake virtual/kernel -c compile
MACHINE=beaglebone bitbake virtual/kernel -c deploy


Build u-boot. You can find the patch on the OpenMotics gateway repo.

MACHINE=beaglebone bitbake u-boot-denx -c configure

cd build/tmp-angstrom_v2012_12-eglibc/work/beaglebone-angstrom-linux-gnueabi/u-boot-denx-2013.04-r0/git/
git apply 0001-Make-sure-watchdog-is-reenabled-upon-Linux-boot.patch
sed -i 's/#define CONFIG_BOOTDELAY.*1/#define CONFIG_BOOTDELAY                0/' include/configs/am335x_evm.h
cd -

MACHINE=beaglebone bitbake u-boot-denx -c compile
MACHINE=beaglebone bitbake u-boot-denx -c deploy


Create the openmotics bitbake configuration and build it:

cat << EOF > sources/meta-angstrom/recipes-images/angstrom/openmotics-image.bb
#Image for OpenMotics

include systemd-image.bb

ROOTFSTYPE_beaglebone = "ext4"

IMAGE_INSTALL += " \
    kernel-modules \
    python-audio python-codecs python-compile \
    python-compression python-core python-crypt python-ctypes \
    python-datetime python-dbus python-dev python-distutils \
    python-elementtree python-email python-fcntl python-html \
    python-image python-io python-lang python-logging \
    python-math python-mime python-misc python-multiprocessing \
    python-netclient python-netserver python-numbers python-numpy \
    python-numpy-dev python-pickle python-pkgutil python-pprint \
    python-profile python-pycairo python-pyopenssl python-pyserial \
    python-re python-readline python-resource python-setuptools \
    python-shell python-simplejson python-stringold python-subprocess \
    python-syslog python-terminal python-textutils python-threading \
    python-tornado python-unixadmin python-xml python-xmlrpc python-zlib \
    python-sqlite3 python-pygobject python-mmap \
    eglibc-gconv eglibc-gconv-unicode eglibc-gconv-utf-16 \
    i2c-tools procps iproute2 connman-tests systemd-analyze \
    tar task-sdk-target vim ntp screen ntpdate ntpdate-systemd"

export IMAGE_BASENAME = "OpenMotics"

EOF

MACHINE=beaglebone bitbake openmotics-image

You can find the kernel, u-boot and image in build/tmp-angstrom_v2012_12-eglibc/deploy/images/beaglebone/


Install the OpenMotics software

Clone the OpenMotics Gateway repo, and run the install scripts:

./installBase.sh
./installGateway.sh