Dangerous Things
Custom gadgetry for the discerning hacker

The Store is now open! Check out the gadgetry »
Like what you're reading?
Share It.

Open source OpenBeacon 2.4GHz active RFID platform for real time tracking

A while back I heard of this open source 2.4GHz active RFID platform called OpenBeacon. At the time I thought it was simply an open source active RFID system, which really only appealed to me because the end products might be cheap enough for broke hobbyists to play with. When time finally permitted me to read up about it, I realized that this was really something special.

What is OpenBeacon?
So far, my first and only complaint about the OpenBeacon project is that the hardware may just be TOO flexible, making comprehending the project and deciphering the user created wiki based documentation somewhat of a mess for newbs like me. After reading through various sites and pages, from OpenBeacon.org to BitManufaktur to https://shop.openpcd.org/ (where you can buy hardware), I found the best description of the OpenBeacon device and the OpenBeacon System came from wading through the wiki site;

OpenBeacon device

An OpenBeacon is a a tiny device (45x45mm) that includes a 2.4MHz transceiver, a small microcontroller and a battery.

The beacon can be re-programmed in various ways. The most simplistic OpenBeacon Firmware implements a traditional beacon functionality, e.g. regularly sending a unique identity which is picked up in the vicinity of the beacon.

OpenBeacon System

We refer to an OpenBeacon System as one specific set of hardware and software involving OpenBeacons that implement one specific function/application.

Since OpenBeacon is very flexible and reprogrammable, almost any OpenBeacon System will look different from the other.

However, many systems will fall into the following categories:

  • 1. Master/Slave Systems
    • 1.1 Classic RFID
    • 1.2 Location Tracking
  • 2. Peer-to-Peer/Mesh Systems

In short what that means is; the hardware is simply an RF communications platform upon which you can build whatever kind of RF application you want, be it a classic active RFID application, an RF mesh network application, or even a remote sensor network application. This is done by writing different firmware code for the OpenBeacon base stations and OpenBeacon “tags” and reprogramming them to do something different. So far I’ve found firmware for various OpenBeacon based projects on several different sites that house different versions of firmwares. Probably the most important one is the OpenBeacon sourceforge site.

Location Tracking
The most intriguing OpenBeacon based project I’ve seen so far is the CCC Sputnik project.

“The Sputnik project is a system for real time in-building location tracking using the OpenBeacon Tag. It was first implemented at the 23rd Chaos Communication Congress in December 2006.

The OpenBeacon Tag was used in combination with 25 base stations to facilitate in-building location tracking. The tags periodically transmit frames at different power levels. If the packet is received by one or more base stations, we can deduct some idea about its locality.

The base stations don’t exploit timing differences or triangulation but rather only use signal strength for positioning.

The output of the base stations is fed into the Chaos Positioning System (CPS), which provides some more high-level and abstract way of maintaining and distributing positioning information.”

So basically this system doesn’t use Time Difference of Arrival (TDOA) or Angle of Arrival (AOA), it simply uses signal strength (RSSI) to make a fairly accurate educated guess as to location of the tag. The odd thing is how this RSSI value is actually generated and derived, as I’ll explain later. The Chaos Positioning System (mentioned on the wiki quote above) takes data feeds from multiple base stations and performs this magic. I highly recommend checking out these videos (and these) of the CPS data being rendered using various visualization methods, it’s very cool. Unfortunately, the Chaos Positioning System is not, as far as I can tell, open source. I cannot find any downloads or code for it anywhere.

Seeing for myself
I was able to get my hands on an OpenBeacon USB stick base station and two v0.1 Sputnik “name badge” style “tags” to see for myself how well this system could work for my own applications.

The first thing I did was to connect the USB stick to my XP box and install it using the OpenBeacon virtual com port driver.

I then inserted a battery into one of the Sputnik “tags” and started up Hyperterminal to watch the data stream in.

The first thing I wanted to know was “what was the schema for the data streaming in from the USB stick? What did the different comma delimited segments mean?” To find out, I had to dive into the firmware repository and search through the different versions to find code that output data in the same format I was seeing in Hyperterminal. There are several different versions of firmware the USB stick base station can run, but it turns out my USB stick came preloaded with “sniffer” firmware. After looking through the proto.c file, I found this section of code that gave me a good idea of what the data I was looking at actually meant:

DumpStringToUSB (“RX: “);
DumpUIntToUSB (swaplong (g_Beacon.pkt.oid));
DumpStringToUSB (“,”);
DumpUIntToUSB (swaplong (g_Beacon.pkt.seq));
DumpStringToUSB (“,”);
DumpUIntToUSB (g_Beacon.pkt.strength);
DumpStringToUSB (“,”);
DumpUIntToUSB (g_Beacon.pkt.flags);
DumpStringToUSB (“\n\r”);

So basically the first data segment is the tag ID, the next is a sequence counter number, the next is signal strength, and the last data segment is “flags” data. Now that I had the data schema, I was curious to find out what the “flags” data meant exactly. I could only assume it might have something to do with the six through-hole contacts at the bottom edge of the Sputnik tag. Luckily the FAQ page seemed to shine a light on that question for me:

1 VPP/RA3 (Square pin)
2 VDD
3 GND
4 ICSPDAT/RA0
5 ICSPCLK/RA1 (also connected to touch sensor)
6 PGM (seems to be unconnected)

To find out for sure, once again I dove into firmware files, only this time it was the firmware library for the Sputnik tag rather than the USB base station. I was able to find out that contact 5 was linked to CPU pin 1 and would indeed alter the flags data being transmitted, sending a 2 rather than a 0. I put it to the test by using a small length of wire to ground contact 5 to GND and sure enough, I received a 2 in the flags data segment.

This was great! I now had an active RFID tag that could not only transmit its ID but also a bit of conditional feedback as well! After getting a look at the next gen Sputnik v0.2 tag, it looks like these feedback features have been further integrated into the tag itself through the use of a board mounted push button.

Deriving RSSI, OpenBeacon style
Because the Sputnik location system is limited to calculating location based on signal strength alone, the tag’s Sputnik firmware steps the tag’s transmission signal strength from full strength to basically zero. This is evidenced by the Hyperterminal screenshot which shows a 25% RSSI step drop that cycles every 5th transmission. This RSSI stepping helps the Sputnik location system come to a more accurate conclusion as to the tag’s location.

The odd thing is how that RSSI value is derived and why its stepped like that. A typical active RFID system uses tags that transmit at a constant signal strength (full power), while the receiver makes the determination as to how “strong” the incoming signal is by cross checking incoming signal strength against an expected full strength signal value. This is usually reported as a integer value between 0 and 255. The hurdle for the OpenBeacon hardware project must have been to find a cheap, low power transceiver that was able to report signal strength that also fit well with the rest of the hardware and the stated goals of the project. To solve this issue, they did something ingenious… the tag itself varies its own transmit power and sends the output power level as part of the data stream.

So, in effect the Sputnik system will give you a 4 step RSSI resolution: 255, 170, 85, and 0. If you receive a serialized data packet with a “strength” data segment value of 0, then the tag is very close to the base station because it was able to pick up the tag’s data transmission even though the tag was transmitting at it’s lowest output power level. So here are the respective distances as they correspond to strength values:

  • 0 = Very Close
  • 85 = Close
  • 170 = Near
  • 255 = Far

Obviously if you don’t receive any data packets at all then the tag is out of range.

The important thing to note here is that this approach keeps hardware costs down and still gives you enough resolution to effectively do the job for most applications. The only difference between creating an RFID locating/tracking system using the OpenBeacon system and a “standard” system is that you’ll probably need to strategically place a lot more OpenBeacon base stations in the monitored area to get an accurate location estimation than you would if you deployed a much more expensive “standard” active RFID system that had higher 255 step RSSI resolution.

However, the value of having an open hardware platform at an extremely low cost may still put you ahead economically even if you did have to buy more base stations. The OpenBeacon system also has a couple other things going for it over standard active RFID systems; Sputnik tags have a much faster ping rate than other RFID systems, which only transmit once every second to 10 seconds (depending on the tag’s factory set configuration). This faster transmission rate allows for a location to be calculated much closer to “real time”, which makes displaying and interacting with tracking data much more fluid. Because the hardware is open, you are able to change this ping rate at will (which directly affects battery life) based on your application requirements. OpenBeacon tags are also designed to be caseless (bare board), enabling quick access to the board and battery… both of which are good things for the curious types and those who value their personal privacy alike.

Other firmware versions
Along with the sniffer firmware, there are other firmware versions available in the repository. One firmware version that interested me was called “estimator”. The difference between the sniffer firmware and the estimator firmware is that the former just sniffs incoming beacon traffic and outputs it row by row when a signal of any strength is detected. The estimator firmware counts the incoming packets and estimates the order of distance to the receiver. It then outputs all nearby received tag ids in one row. This is useful when you have several moving tags in action around a static base station, or several static tags and one moving base station.

Hello World
Even though I was free to change the firmware in both my tags and USB base station, I decided the first thing to do was to write a basic “hello world” type application that could process the data stream coming in from the USB base station (node) and display all active tags, their “maximum” signal strength (0 being “max”, 255 being “min”) and their average signal strengths. That average is calculated by averaging the maximum signal strength received over the last 10 data frames. That application is simply named “Sputnik“.

Overall, I’m very impressed with the OpenBeacon RF platform due to it’s balance of economy, function, and flexibility. While putting this basic application together, thoughts of some real-world applications began to form and swirl in my head. I can’t wait to get started.

Tags: , , , ,

26 Responses to “Open source OpenBeacon 2.4GHz active RFID platform for real time tracking”

  1. Amal says:

    Some interesting conversation going on about OpenBeacon here: http://www.rfidtoys.net/forum/forum_posts.asp?TID=595&PN=1&TPN=1

  2. znelson says:

    This is a great blog – thanks for posting your experience with the system. You provided more information than the OpenBeacon wiki!

  3. CJ says:

    Hey amal, im doing this for my honours project and your code and guidence has been invaluable. Thanks man.

  4. Amal says:

    No problem duder! Glad to help 🙂

  5. Cj says:

    Hey Amal
    This might be a really old post that im digging up but i was looking around for it as a reference for the above mentioned honours project. I hand it in in 2 days. Ive managed to build a really effective working prototype for tracking laptops in a library. Its great to see you’re still working with all sorts of wireless tech, ill keep reading the blog.
    Again, thanks for the help.

  6. Amal says:

    Cool, thanks for the update 🙂 If your project goes online, post a link!

  7. Cj says:

    Ive been reading quite a bit of your site and its pretty dam brilliant. You got yourself a proper reader 😛 Website goes up by tomorow afternoon with sourcecode and all. Ill post a link sometime in the future.

  8. Amal says:

    Heh thanks! Looking forward to checking out your site 🙂

  9. JackR says:

    Hi,
    Cj: what is your progress status? Would love to see what you did. Will you have your website up soon?

    Also, I am very much interested to talk to you. Please contact me at jracine@me.com

    Thanks 🙂

  10. Charlie Harris says:

    Anyone used this RFID for model railroad use for tracking rolling stock.

    What is the price of the USB stick and where do you get them

  11. Amal says:

    I don’t think it would work for model railroad because this is an active system, which has a very long operational range compared to passive. You’ll probably want a passive setup. Check http://rfidtoys.net/forum and search for “model” and “train” or “railroad”… I think there are some posts there about it.

  12. Sem says:

    Amal, I was wondering where can I get the openbeacon readers and tags? Is there any branch in Malaysia?

  13. Kshitij says:

    I need some help in designing the Active RFID reader (2.4GHz) for my project.If anyone has some information related to designing of Active RFID reader please share the schematic or any other related stuff.
    Thank you..

  14. Amal says:

    If you haven’t already, you might consider posting your request to the RFID Toys forum at http://rfidtoys.net/forum

  15. Mnis says:

    Hi Amal,

    Thanks for the post. I tried contacting Openbeacon for hardware purchase details but have never received a response. I need to setup a simple RTLS application. Any suggestions how I can get relevant hardware in not so large quantities since I need to build a demo app first…?

    Your assistance is highly appreciated.

  16. Amal says:

    Sorry for the late reply… the blog’s email alerts have been busted for a few months now. Depending on your needs and resources/expertise available, you could build your own for fairly cheap. The most basic idea would be to use a cheap microprocessor and an RF transmitter to transmit a unique ID or serial number, and a few receivers that are able to report RSSI values along with the data. I think Atmel even has a microprocessor + RF transceiver all in a single IC you could use.

    But, if you are looking for a commercial solution, and you have a nice hefty budget, you could look into Wavetrend and other active RFID solutions like it. You would still have to write your own software to process RSSI values coming in from receivers so you could do the location calculation.

  17. JS says:

    I tried to order things from Openbeacon as well and the email in their
    webshop didnt work. I contacted them directly by the emails they have
    in their impressum: http://www.openbeacon.org/Bitmanufaktur:About

    Worked for me!

  18. Fred says:

    Hi.

    I got the product also just like you, but having trouble in reading the data from the reader.

    How did you do it? And if you don’t mind can i have the source code for your hello world program? =)

    Thanks for such great reviews!

  19. Amal says:

    Hi Fred,

    Glad you like the post 🙂 The source for my Hello World project is linked in the post, but here it is again for easy access; sputnik

  20. Fred says:

    Did you wrote the hello world in C/C#?

    I’ve been thinking if it is possible to track the signal using JAVA instead… i don’t even know if JAVA even support signal reading..

    And one more thing, is it possible to estimate the location using a single USB reader? I’ve been thinking that if it is possible to get the signal strength and signal source direction, then it might be possible to create an estimator. But from what i read in your post, you can only check the signal strength only from the USB reader.

    The firmware i got (openbeacon sniffer and estimator) hardly tells me anything about figuring out the signal direction. I mean, if say i put one USB reader in the middle of the room, then if i put the tag at north or south of the room, the reader will pinpoint the signal source from the tag as from north and south.

    If only i could figure that out, i might be able to create an estimator. But truly, i don’t know if that is possible with the tags and a single USB based reader.

    I hope you can shed light on me about this. =(

  21. Amal says:

    the signal is reported by the receiver, which outputs the data to the host (your computer) over serial RS232, so as long as you can communicate with COM ports in java, you’re fine.

    you can’t get location or direction with a single reader. that would require a special antenna array and signal processing based on what’s known as AoA (angle of arrival). but, you might be able to get a crude direction if you used multiple highly directional antennas and switched between them after each packet was transmitted from the tag. whichever antenna reports the highest signal (within a margin of error) means the tag is likely in that approximate direction.

  22. Fred says:

    Thanks for your reply.

    Too bad for me, i bought only 1 reader, due to budget constraints… well i guess i just need to make an estimator with just 1 reader based on the signal strength then =(

  23. Fred says:

    Hi again

    I checked the OpenBeacon Sniffer firmware, in proto.c, but i couldn’t find any of the line below

    DumpStringToUSB (“RX: “);
    DumpUIntToUSB (swaplong (g_Beacon.pkt.oid));
    DumpStringToUSB (“,”);
    DumpUIntToUSB (swaplong (g_Beacon.pkt.seq));
    DumpStringToUSB (“,”);
    DumpUIntToUSB (g_Beacon.pkt.strength);
    DumpStringToUSB (“,”);
    DumpUIntToUSB (g_Beacon.pkt.flags);
    DumpStringToUSB (“\n\r”);

    Instead i found these lines replacing the above in proto.c

    hex_dump ((u_int8_t *) & g_Beacon, 0, sizeof (g_Beacon));
    else
    debug_printf (“RX: CRC error or wrong encryption key\n”);

    I’m not sure what these actually meant.. and seems like it affected the displays shown in the hyperterminal too.

    Kinda stuck with this right now.. not sure how am i going to get the data segment from the RFID reader with the sniffer firmware.

  24. Amal says:

    Hmm, I wrote this post in 2008 and I fear the open source firmware has mutated significantly since then. I don’t believe there was any encryption code in the source file I reviewed back in 2008.

  25. Shahab says:

    Hi Amal,

    Is there anyway to connect the base station to Arduino board? I know arduino board accept UART serial port but does OpenBeacon station has serial out put other than the USB?

  26. Amal says:

    I suppose you could find the data line on the PCB that goes into the USB chip and splice into it, then you should be able to get TTL data from the PCB and dump that into the Arduino.

Leave a Reply

Get Adobe Flash player