Generic User Guide

From RifidiWiki

Revision as of 03:02, 10 January 2017 by Bppause (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

The Generic Reader Adapter is provided for any device where you are looking for a simple way to connect and pass data (such as tag data) to the Rifidi Edge Server. Ways in which we have used the Generic adapter is with handheld and smartphone applications. This reader will open up a ServerSocket at the port specified, and it will receive data in according to a certain format that is outlined below. It has no properties except for the port, and it has no commands. You can either send the data directly, if the reader supports pushing and the data can be formatted as you choose, or you can write a small module that will receive data from the reader and send it to the Generic reader from there. If you need to get a handheld reader to work with Rifidi Edge, use this as a base. The general outline to create a Generic Reader Session can be found in the ‘Rifidi Getting Started Guide’. The only differences are the properties set which are outlined below. Properties

TCP/IP Inteferace

For TCP/IP, there is only one property for the Generic reader: the port. When you start the reader, it will create and start a TCP ServerSocket at this port.

  • Port: The port that the ServerSocket will listen to.
  • setproperties Generic_1 Port 2121

Commands There are no commands for the Generic reader. Instead, it will listen for data coming in to the specified ServerSocket in this format:

  • ID:(tag ID)|Antenna:(antenna)|Timestamp:(millis since epoch) Note: Ensure to include newline break at the end such as “\n”

It is assumed the tags being read in are Gen2 tags. All data will be formed into a TagReadEvent and put into Esper. If you like, you can specify other information which can be added into the TagReadEvent. Simply add more key:value pairs, separated by pipes. For instance, if you wanted to give the Speed and RSSI values as well as the regular values, you could format the incoming messages like this:

  • ID:(tag ID)|Antenna:(antenna)|Timestamp:(millis since epoch)|Speed:(speed value)|RSSI:(rssi value)

So an incoming tag might look like this:

  • ID:350009080001|Antenna:1|Timestamp:123456789|Speed:.03|RSSI:885.7

Any values besides the ID, Antenna, and Timestamp will go in the ExtraInformation, which is a String:String hashmap. The value will be inserted as a value for the corresponding key (so, “Speed” would be inserted with the key “Speed” and the value “0.3”.

Rest Interface

Same as the generic's (TCP/IP payload). Valid URLs for the generic rest interface will be:

  • /ping
  • /generic/tags (for POST)
  • /generic/tags/{tag json} (for GET)


Note: Example below set REST port to 1111
Example Post operation: http://localhost:1111/generic/tags

Payload

[{"id":"123456781234567812345678","antenna":1,"timestamp":1483735761055,"reader":"Alien_1","rssi":"123","extrainformation":"Direction:1|Speed:50"},

{"id":"123456781234567800000000","antenna":1,"timestamp":1483735761055,"reader":"Alien_1","rssi":"123","extrainformation":"Direction:1|Speed:50"}]

You enable the generic rest by setting either the rest port or the ssl rest port to something other than -1 and creating a session. SSL should work but settings for rest and SSL arguments (keystorepath, minthreads, etc) piggyback off of the properties that already exist for our regular rest server rather than creating discrete ones for generic itself. Edge_Management#Configuration_.28HTTP_over_SSL.29_-_Available_as_of_version_3.1.1

MQTT Interface

Planned for future release (async operations)

Personal tools