EanderAlx.org

Linux, Virtualization and whatever I find interesting ...

User Tools


Site Tools


linux:play_with_alix2d13

Play with Alix2D13 (Archlinux)

I bought an Alix board from PCEngines to experiment a little with it. Here are a few tips, no ready-made solutions for router or something like that only independent problem solver to run the Alix with Archlinux.

Shopping List

  • 1x ALIX.2D13 Bundle
  • 1x TP-Link TL-WN861N WLAN Mini PCI
  • 2x BIGtec WLAN Adaptercable SMA
  • 2x TP-Link TL-ANT2405CL WLAN antenna

Installation

This Alix had no VGA connector and no normal BIOS it's sort of the essential version. No Boot from!
There are a few documentations how to boot from stick or something link that with an help System on an a CF Card but I think the simplest way is to install the system on a CF using an other i686 PC or an virtual machine.

After you boot the CF inside your Alix you have to boot the fallback kernel because the autodetect hook is build for the machine on which you installed the system. The command mkinicpio -p linux fix this when running your system on the alix.

changes for serial console

After installation we have to mad some adjustments to see something on the serial console.
We have to set the serial option for syslinux and as kernel parameter.

/boot/syslinux/syslinux.cfg
...
DEFAULT arch
PROMPT 0
SERIAL 0 38400
TIMEOUT 50
...
LABEL arch
    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND root=/dev/disk/by-label/root rw console=ttyS0,38400n8
    INITRD ../initramfs-linux.img
 
LABEL archfallback
    MENU LABEL Arch Linux Fallback
    LINUX ../vmlinuz-linux
    APPEND root=/dev/sda3 rw console=ttyS0,38400n8
    INITRD ../initramfs-linux-fallback.img
...

adjust pacman

Pacman is not able to detect the architecture of the AMD Genode processor, so we have to set it static. Find Architecture = auto and change it.

/etc/pacman.conf
...
Architecture = i686
...

use as WLAN AP

There is an very nice software which is well documented in the Arch Wiki, its called hostapd.
Create an Bridge Interface on the first eth Port

/etc/netctl/enp0s9-bridge
Description="Bridge for WLAN"
Interface=br0
Connection=bridge
BindsToInterfaces=(enp0s9)
IP=dhcp

and configure hostapt for me it worked on the first try.

LEDs

On the Alix 2D13 are three LEDs. Where you power on the Alix first all three and where the system boots the first LED is on. To control it from the running system we need an kernel modul which is not included in the Arch Kernel, the name is leds-alix.
In the Ubuntu or Debian Repos there is the source Code and the module could be compiled after an small adjustment to the code. Thanks to the arch forum i found out that I have to a the include

#include "linux/module.h"

afterwards the module could be compiled and installed. It work perfectly.
Here some german Debian doku how to work with the control files.
I write an simple cron to set the first led to load blinking after boot 1).

# m h  dom mon dow   command
@reboot echo heartbeat > /sys/class/leds/alix\:1/trigger

And when network is activ a activated the second led

...
ExecUpPost='echo 1 > /sys/class/leds/alix:2/brightness'
...

Hardware switch

Like the LEDs the hardware switch could be controlled via gpio. It's pin 24 2)

  • activate pin 24
    cd /sys/class/gpio
    echo 24 > export
  • see /sys/class/gpio/GPIO24/value while press the switch

Here a very simple Script to read the hardware switch

switch.sh
#!/bin/bash
LED_FILE="/sys/class/leds/alix:1/brightness"
TASTER_FILE="/sys/class/gpio/GPIO24/value"
if [ -e $LED_FILE ];then
	if [ ! -e $TASTER_FILE ];then
		echo 24 > /sys/class/gpio/export
	fi
	while [ -e $TASTER_FILE ]; do
		if [ $(cat $TASTER_FILE) == "0" ];then
			echo 0 > $LED_FILE
		else
			echo 1 > $LED_FILE
		fi
		sleep 2
	done
	if [ -e $TASTER_FILE ];then
		echo 24 > /sys/class/gpio/unexport
	fi
fi

That's all for now, perhaps more later!

1)
which is here when cronie starts
2)
google knows ;)
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
linux/play_with_alix2d13.txt · Last modified: 28.08.2014 09:18 by eanderalx