Monthly Archives: August 2015

A PN532 module and a raspberry pi B+

Get an operating system (Arch) running

  1. Prepare an SD-Card by following the instructions on archlinuxarm.org
  2. Enable SPI by putting device_tree_param=spi=on in /boot/config.txt

Install prerequisites

  1. Install git: pacman -S git
  2. Install development tools (for AUR): pacman -S --needed base-devel
  3. Install sudo and add the standard user (alarm) to the group sudo

    pacman -S sudo
    groupadd sudo
    usermod -a -G sudo alarm

Get NFC related software

The required library libnfc is in the AUR, it needs some prerequisites:

pacman -S cmake libusb-compat pcsclite

Get the build files (as normal user)

mkdir build-repos
cd build-repos
git clone https://aur.archlinux.org/libnfc.git
cd libnfc

Add the architecture to the PKGBUILD by adding armv6h to the arch variable.

arch=('i686' 'x86_64' 'armv6h')

Build and install the package

makepkg -sri

Configure libnfc

As root, create the folder /etc/nfc and put the following in libnfc.conf (source)

allow_autoscan = true
allow_intrusive_scan = false
log_level = 1
device.name = "Itead_PN532_SPI"
device.connstring = "pn532_spi:/dev/spidev0.0:500000"

Test

Connect the reader (with the Raspberry Pi powered off).

As root, check whether the reader is found

nfc-list

Test the reader

nfc-poll

IPv6 hop limit: Mikrotik router config to work around Ubuntu bug

My ubuntu machine lost IPv6 connectivity beyond the link-local network. It turned out to be the same problem someone described at askubuntu. According to a message in the ubuntu-bugs mailing list this should be resolved by an update soon.

Until then, announcing a specific hop-limit will work around the problem

/ipv6 nd
set [ find default=yes ] advertise-dns=yes hop-limit=64 \
ra-interval=20s-1m ra-lifetime=3m