Giter Site home page Giter Site logo

golemu's Introduction

golemu

Build Status Coverage Status Go Report Card GoDoc

A simple LLRP-based RFID reader emulator with go-llrp. This emulator was developed as part of my Master's thesis.

Try the demo with docker-compose.

golemu emulates LLRP (Low Level Reader Protocol) communications for RFID inventories via EPC Gen 2 Class 1 UHF standard and ISO/IEC 18000-6 Type C.

Please refer to the original LLRP standard or the ISO/IEC equivalent as well as our demo paper:

Mizutani, I., & Mitsugi, J. (2016). A Multicode and Portable RFID Tag Events Emulator for RFID Information System. Proceedings of the 6th International Conference on the Internet of Things  - IoT’16, 187–188. https://doi.org/10.1145/2991561.2998470

Installation

Install dep in your system first.

$ go get github.com/iomz/golemu
$ cd $GOPATH/src/github.com/iomz/golemu
$ dep ensure && go install .

Synopsis

golemu has 3 commands (client, server, and simulator) to operate in different modes. See the help output for each command.

LLRP client mode(golemu client)

The client mode establishes an LLRP connection with an LLRP server (interrogator). Retry connecting to the server until it becomes online and keep receiving the events until the server closes the connection.

This command is test-only; which means it only displays the number of events (TAG REPORT DATA parameter) in each received RO ACCESS REPORT message.

LLRP server mode(golemu server)

The server mode first loads tags from a file (tags.gob by default) to produce a "virtual inventory of tags." The gob encoded file speeds up the loading process of tags since it is critical for the emulation of hundreds to thousands of tags.

Follow the steps below to generate a gob file; however, this is at the moment very ugly and as golemu and go-llrp only takes PC bits and EPC data parameter to represent a tag. I may come up with another way or format to load up tags to golemu in the future.

  1. Create a CSV file (e.g., tags.csv)

Each line should contain HEX-encoded PC Bits and Binary string of EPC data.

eg.) 3000,001100000111001000100111011000100111111100101110101001001000000000000000000000000001110001101010

  • PC bits: 3000 (indicates a general SGTIN-96 tag)
  • EPC Data: 001100000111001000100111011000100111111100101110101001001000000000000000000000000001110001101010 (307227627f2ea48000001c6a in HEX)
  1. Install gobtags command

% go get github.com/iomz/gosstrak/cmd/gobtags

  1. Encode the CSV file to gob file

% gobtags tags.csv -o tags.gob

The resulting gob file of the above example (just 1 SGTIN-96 tag) should look like as follows:

% hexdump tags.gob
0000000 0a ff 81 06 01 02 ff 84 00 00 00 0a ff 85 06 01
0000010 02 ff 88 00 00 00 2e ff 82 00 2a 03 04 00 02 0a
0000020 ff 85 06 01 02 ff 88 00 00 00 1a ff 86 00 16 05
0000030 06 00 fe 30 00 0f 0a 00 0c 30 72 27 62 7f 2e a4
0000040 80 00 00 1c 6a
0000045

(TODO: API documentation for add/delete tags from the virtual tag population)

Interrogation simulator mode(golemu simulator):

The simulator mode also operates as an LLRP server (RFID interrogator) – the only difference is that it iterates through generated gob files in a directory. This mode is intended to simulate a batch of event cycles designed to evaluate specific situations.

One gob file for one event cycle. golemu iterates the file by the file names in ascending order. Suppose there are 3 files (00.gob, 01.gob, and 02.gob for example) in /path/to/sim,

% golemu simulator -i 2000 /path/to/sim

repeats generating 3 event cycles with an interval of 2000 ms.

MTU for LLRP

The PDU option (-m or --pdu) specifies the maximum allowed PDU and is by default the same as TCP's default MTU (=1500 bytes). golemu adjusts the size of a single RO ACCESS REPORT by limiting the number of TAG REPORT DATA not to exceed the PDU size.

Note that LLRP sometimes doesn't specify the maximum number of parameters in a single message; theoretically, an LLRP packet can grow to the maximum segment size of TCP packets, but this severely affects the overall performance depending on the traffic or the network configurations.

License

See the LICENSE file.

Author

Iori Mizutani (iomz)

golemu's People

Contributors

iomz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

golemu's Issues

D3.js Clustered Force Layout

Show tags, click to edit the info, maybe some button to automatically create a new tag and add it to the cloud.

Safe stop, safe close

When either the client or the reader shuts down, the connection need to be terminated gracefully (properly).

README

More descriptive information needed. With travis-ci.

gologir.go:202: undefined: http.StatusAlreadyReported

Hi, thank you very much for your work.

I am trying to install the emulator in Ubuntu. I have successfully installed Go, but when I try to execute:

$ go install

I get:

# _/home/luis/go/gologir
./gologir.go:202: undefined: http.StatusAlreadyReported

Do you know what could be wrong? Thank you very much.

Properly schedule tag report timing

Do not overuse gorountine, use context to cancel reporting tags when trds are updated.
Reorganize the order of trds initialization, keepalive counter and receiving channel from web UI.

What is tags.csv suppose to look like?

I'm not sure what the content of the tags.csv is suppose to look like. I tried different thing but always end up with some of parsing error. Do you have an example?

Dynamic tag selections

Update which tags to be included in ROAR for the current interval. Preferably in the future by web interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.