RaspberryPi

Cool thing you have done but I dont think that this is a "challenge" per se

Taggings:

Secure private network

To secure the private home network, especially create a guest network and a private one, I used raspberry pi. The private network must be protected better, because of devices like computer, NAS, ect… . The raspberry is equipped with an additional lan port (usb to lan) and an additional w-lan card for a better signal. The first lan port is connected with the router of the ISP and the second one with the local private network. After that the routing is made (IP Tables) so that the internet is forwarded to the private network. Then the firewall (ufw - uncomplicated firewall) is configured, per default all connections are denied and the needed ports have to be opened after that. For example 80 and 443 for http and https. After that a proxy is installed, in this case pihole for blocking adds and additional IPS (intrusion prevention system) Fail2Ban is installed and configured, to secure the „Firewall“ even more.

Libnfc and Libfreefare

Libnfc (http://nfc-tools.org) is an open source library for Linux.
Unlike most NFC drivers this is a completely free MFC library and tool collection.

at first check if your reader hardware is compatible:
http://nfc-tools.org/index.php?title=Devices_compatibility_matrix
This is not a complete list. If your reader is not listed but the NFC-controller PN53x, you have a god chance that it will work.

If you want to read/write Mifare (Classic and Desfire) Tags, install the Libfreefare API first. It adds some mifare specific functions, so you can handle MIFARE Tags much easier.

Libfreefare

prerequisites
sudo apt-get install autoconf
sudo apt-get install libtool
sudo apt-get install libssl-dev

get sources and extract
wget https://libfreefare.googlecode.com/files/libfreefare-0.4.0.tar.bz2
tar -xvjf libfreefare-0.4.0.tar.bz2

install
cd libfreefare-0.4.0
autoreconf -vis
./configure --prefix=/usr
make
sudo make install

Libnfc
get sources and extract
wget http://dl.bintray.com/nfc-tools/sources/libnfc-1.7.1.tar.bz2
tar xfvj libnfc-1.7.1.tar.bz2

create configuration directory
mkdir /etc/nfc/
mkdir /etc/nfc/devices.d

create config file e.g. /etc/nfc/devices.d/nfc_arygon.conf.
connstring
name = "NFC Arygon"
connstring = arygon:/dev/ttyUSB0
allow_intrusive_scan = true
allow_autoscan = true

connstring is the most important option. If you have a different NFC-Controller or it is not connected by USB, you have to change this string.
for more configuration Options : http://nfc-tools.org/index.php?title=Libnfc:configuration
btw. the brand "Arygon" is now "Identive"

install libnfc
cd libnfc-1.7.1/
./configure --with-drivers=arygon --sysconfdir=/etc --prefix=/usr
sudo make clean
sudo make install all

(--with-drivers adept, if you have a different NFC Controller. eg. pn532_uart if you have a serial connected reader.)

Test the installation with the included examples.
cd examples
./nfc-list

This lists all the connected and recognized NFC-Readers. Try a restart if it does not work. Check the connstring and --with-drivers parameters.

Start
./nfc-poll
and hold a tag over the reader (<4cm) to read a tag.

Type ls to show all examples. Read the example sources to use the API for your own projects.

Connect NFC-Reader to RaspberryPi

NFC - Near Field Communication - is a short range (<10cm) contactless communication protocol. Many Smartphone have an NFC-Chip and several tags (stickers, cards, kesy rings, ...) are available. How can I use an NFC reader (e.g. http://www.identivenfc.com/en/nfc-readers/nfc-oem-reader-usb.htm) on a raspberryPi? To read tags or exchange data with smartphones.
Subscribe to RaspberryPi