Hardware Test Harness

Required Hardware List

  • Test PC: Intel ATOM Bay Trail:
  • SWD Probe: Magia Negra (one unit)
  • Serial port adapter: Magia Negra (same unit as for SWD)
  • USB Hub: Delock 87445 on Amazon.de
    • NOTE IMPORTANT: This particular hub can power-cycle peripherals.
    • Power supply: FIXME 5V, center positive, 2.1mm
  • Camera: Logitech HD Webcam C270 (3MP)

Optional Hardware

  • USB Keyboard (Digitec.ch)
  • USB Lamp (Amazon.de
  • Switch: D-Link DES 1005D (to isolate network with router, for internet access only (100 MBit)
  • Router: Linksys E1200 N300 (to isolate network with 2nd router)
  • Network cables

Software Prerequisites

Operating System

This test setup is fully operational and tested with these OS:

  • Ubuntu 14.04+
  • Mac OS 10.9+

Debian Installation

Download the particular Debian Jessie image (or a newer Jessie image):

This is IMPORTANT as other Debian (or Ubuntu) versions do not support the 32bit UEFI mode Intel Atom Bay Trail processors employ. Install the OS (without desktop) and then add / install these packets on the command line:

apt-get install git ruby ruby-dev ruby-rmagick ntp

Time Sync

Check that the time sync is effective by running ntpq -p:

$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+eudyptula.init7 162.23.41.10     2 u    3   64    1   11.479  -68.041  62.712
+b.ntp.madduck.n 192.33.96.102    2 u    2   64    1    7.355  -67.915  63.388
 bind.ch         194.45.93.212    3 u   45   64    0    0.000    0.000   0.000
*de-ntp01.swiss- 212.82.32.15     2 u   33   64    1   16.579  -16.339  10.185

Add Wireless

FIXME not operational yet - Original instructions: Edit /etc/apt/sources.list and add non-free to the package list:

deb http://ftp.ch.debian.org/debian/ jessie main non-free

Install package:

apt-get install firmware-linux-nonfree firmware-brcm80211

Webcam Capture

To get the led state and entertain developers a bit, we capture the test setup with a webcam:

apt-get install libopencv-core-dev libopencv-dev libopencv-highgui-dev
apt-get install libmagickwand-dev libmagickcore-dev graphicsmagick-libmagick-dev-compat

Timestamping and Labeling Images

USB Hub Power Control

Although part of the USB spec, power control is not implemented by all hubs in hardware. In fact, due to cost reasons, only few hubs do. One current USB 2.0 hub which is supported is the Delock 87445

Dependencies Installation

Install libusb:

Mac OS:

brew install libusb
brew install libusb-compat

Linux:

apt-get install libusb-dev

Clone and build

git clone https://github.com/codazoda/hub-ctrl.c
cd hub-ctrl.c
gcc -o hub-ctrl hub-ctrl.c -lusb

Test: List all hubs. The easiest approach is to disconnect the hub to switch, run the command, then connect it and compare which device showed up as new.

./hub-ctrl -v

Switching individual ports: Important: Due to the implementation of argument parsing, there needs to be a space between the flags and arguments to them. For Linux, put the user into the appropriate group for USB IO (e.g. plugdev).

Switch off first port of first hub (hubs are 0-indexed, ports are 1-indexed)

./hub-ctrl -h 0 -P 1 -p 0

Switch on first port of first hub (hubs are 0-indexed, ports are 1-indexed)

./hub-ctrl -h 0 -P 1 -p 1

References: README page.

Outgoing Email

Postfix Configuration Debian / Ubuntu

Ubuntu: Install postfix first:

apt-get install postfix

This is the complete config file. Ensure to change the SMTP host data as needed. Change these three items:

  • host: Change to the SMTP server (e.g. smtp.hostingcompany.com)
  • user: SMTP user (typically a mailbox login user)
  • pass: SMTP password (typically a mailbox login password)
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = zurich01.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
# myorigin = /etc/mailname
# mydestination = zurich01.local, localhost.local, localhost
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:<user>:<pass>
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
smtp_use_tls = yes
header_size_limit = 4096000
relayhost = <host>:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only

Postfix Configuration Mac Os

Instructions based on: http://www.checkmarkmedia.com/node/10

Set up config file /etc/postfix/main.cf and extend at the end:

# email domain, use then <existing user / alias>@px4.io as from address
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:<SMTP_LOGIN_NAME>:<SMTP_LOGIN_PASSWORD>
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
smtp_use_tls = yes
header_size_limit = 4096000
relayhost = <SMTP_HOST_NAME>:587

Start the service (this will need a restart after a system reboot)

sudo postfix reload
# if not running, use <sudo postfix start>

or on Linux:

Start the service (this will need a restart after a system reboot)

service postfix restart

And test (emails with invalid from addresses might be rejected)

echo "testing the message body" | mail -s "test the subject" to_address@example.com -f from_address@example.com

Check the log:

cat /var/log/mail.log

Test System Installation

Test harness Ruby core:

Please refer to the README file of the test harness for installation and operation instructions.

NOTES: FIXME

Translations of this page:


Quick Links

QR Code: URL of current page