RFID, Raspberry Pi & LBS

The experimentation with Raspberry Pi goes on. RFID is the next stage in effective Indoor Location Based Services and to understand this the following is a small project that brings RFID to the Raspberry Pi.

A brief history of the Raspberry Pi

The first batch of 10,000 Raspberry Pi’s went on sale in February 29th, 2012. And towards the end of 2011, the SD card image for it had already been downloaded more than 50,000 times. Eden Upton designed them for education – specifically python, hence the “Pi” part of the name.

But the tiny board has caught the eye of already experienced programmers and electronic hackers. This has caused a return to a DIY culture with the Raspberry Pi at the forefront of hackers, makers and the curious to understand what is happening “under the hood”.

Location Based Services and RFID

One of the key developments in LBS technology in 2014, is the standards based RF Pattern Matching, based on RFID. This network-based positioning method is based on radio link measurements collected from the network and/or the device. In short, it uses the device’s own radio signals to identify its location, eliminating any dependency on satellites or other network hardware, which is traditional in LBS..

This technology works extremely well in dense urban and indoor environments, and is being used in both mission-critical public safety applications as well as commercial deployments in the US.

In the Internet of Things, truly smart objects essentially are embedded with both an RFID tag and a sensor to measure data. This is easily illustrated using the Raspberry Pi.

The project

For a detailed explanation, check http://skpang.co.uk/blog/archives/946

This project uses the SL030 RFID module with the Raspberry Pi. This will allow the Pi to read the 13.56MHz Mifare RFID cards. The SL030 modules uses the I2C interface at 3.3v.

Software Setup

Install the i2c driver.

Install the Quick2Wire Python library.

Change to the directory where the Quick2wireWire is installed. In our case (your setup might be different):

cd git/quick2wire-python-api/

Download the example python script (thanks to @whaleygeek whaleygeek.co.uk) by:

wget http://www.skpang.co.uk/dl/rfid.py

Change the file permission to allow execute:

chmod +x rfid.py

Start the Python script:

sudo ./rfid.py

Swipe a RFID card or tag onto the reader and the information on the card should be displayed

Hacking Location Based Services & IoT with the Raspberry Pi

Introduction

There are very exciting topics that influenced me over the past few years namely Location Based Services (LBS), The Internet of Things (IoT) and the humble Raspberry Pi.  But first a brief background – I am not a technical person by discipline as my background is in sales in marketing related to the Conference and Events Industry, which I have been involved in for the past 7 years.

Location is personal passion for me to the extent that I chose this as the title for my MA thesis. The following is my personal journey in linking, apparently disconnected technologies that surround this subject.

When I studied this I did not have any idea in regards the technical aspect surrounding LBS but I did identify key people in this arena and interviewed them to find out what their thoughts were for the future of this technology. But I wanted to understand Location on a more primitive level, in which I could create a project that would allow me to experience this.

My problem was a lack of technical knowledge.

Defining Location Based Services

There are various definitions of Location based services and they all agree on the following:

  • LBS it is a software application;

  • for a IP enabled mobile device;

  • which requires knowledge of where the mobile is located;

  • they can be query based services;

  • providing the end-user with useful information an example of which is “Where is the nearest ATM?”;

  • or they can be ‘push-based’ by delivering coupons or other marketing information to customers who are in a specific geographic location.

Location Based Services is not new technology. It is based on military technology entitled Geographic Information Systems which has been around for 14 years or so.  With the advent of the mobile phone and especially the smartphone, Location Based Services has steadily gained acceptance and a foothold in the market place.

Originally the spread of the use of LBS had been mainly via users ‘checking in’ into location based service applications, not unlike checking in via airport booking. This was a time where LBS was in the very early adopter phase; for example, Foursquare and Gowalla, both check in services, were were launched around that time.

The combination of clever Smart devices and social apps, such as Facebook have introduced applications which revolve around Location.

Juniper Research has forecast the mobile location-based services market to exceed $12 billion in 2014, driven by increased app store usage, smartphone adoption and new hybrid positioning technologies.

Enter Internet of Things (IoT)

I started to attend ‘the’ IoT Meetup in London which introduced me to projects that were created by both experts and novices alike. These meetings seeded the possibility of understanding location on a more hands on approach.

According to Gartner there will be nearly 26 billion devices on the Internet of Things by 2020.

According to ABI Research more than 30 billion devices will be wirelessly connected to the Internet of Things (Internet of Everything) by 2020

Two very separate figures but still, this a lot of interconnected devices. The best definition that encapsulate IoT is the following;

Companies and organizations explain the Internet of Things in various ways, but the Internet of Things, or IoT, is most commonly described as an ecosystem of technologies monitoring the status of physical objects, capturing meaningful data, and communicating that information through IP networks to software applications.

The recurring themes in all definitions of the Internet of Things include smart objects, machine to machine communication, RF technologies, and a central hub of information.

How are these two disciplines related?

So what is the common factor for these two apparent unrelated technologies?

Radio Frequency Identification – RFID

 So,

The Internet of Things requires a few necessary components to enable communication between devices and objects. Truly smart objects essentially are embedded with both an RFID tag and a sensor to measure data.

And,

One of the key developments in LBS technology in 2014, is the standards based RF Pattern Matching, based on RFID. This network-based positioning method is based on radio link measurements collected from the network and/or the device. In short, it uses the device’s own radio signals to identify its location, eliminating any dependency on satellites or other network hardware, which is traditional in LBS..

This technology works extremely well in dense urban and indoor environments, and is being used in both mission-critical public safety applications as well as commercial deployments in the US.

So effectively Location is that much closer than before..

The final piece in the puzzle.

That is where the Raspberry Pi comes in..

Raspberry Pi is a $25 credit-card-sized microcomputer, which was originally created to encourage kids to learn how to program in the United Kingdom. However it has tapped into a huge pool of interest among hackers who wanted to use the low-cost hardware to connect devices together in interesting ways..

 I have used this little device to gain an awareness and understanding of how Location fits in all of this with out learning indepth code.

 The Project (outline)

 The aim of the project was to identify Access Points in any given geographic location in which the Raspberry Pi is taken.

 Essential hardware;

 The programs used are:

If a Raspberry Pi is not accessible then this can be duplicated on a laptop.  This can be achieved because the operating system for the Raspberry Pi, entitled Raspbian, and the one for the laptop, entitled Linux Mint, share the same foundation – Debian.

Outline of process

Connect the GPS and Wifi modules to the Raspberry Pi.

Run a session on Kismet which is a Wifi-Spectrum and Traffic Analyzer that relies on the Wifi adapters ability to enter in “monitor mode” – essentially this is gathering on the surrounding AP in any geographic location.

The GPS gadget is essentially gathering co-ordinates of the location of the device. This has been configured to work with Kismet.

The data gathered by Kismet is logged. This data is massaged into shape by running it through a “python Script”, ready to be shown in a Google Earth or Google Map session not unlike the map below.

Map showing AP's
Map showing AP’s

In conclusion, this is an exciting development and can be adapted by implementing RFID and the relevant programs which are available within Debian.  All this with an essential understanding of Linux with a certain depth of knowledge of CLI and a bit of imagination.

To follow – setting up the Raspberry Pi for LBS