Impinj Speedway Connect on-reader software Data Integration

When you configure and run Impinj Speedway Connect on-reader software, as described in Support Article: Speedway Connect System Configuration, data is output as tags are read by the reader or gateway. Here we describe the data format to enable you to develop your application to consume the data stream.  Because of the portable nature of the data format, your code can be rewritten in virtually every modern programming language and development tool.

Impinj Speedway Connect outputs RAIN RFID data in two different formats, JSON or Key-Value Pair.  As of Impinj Speedway Connect release 2.4.0, all three different operating modes are supported, namely, Inventory, Location, and Direction

Depending on the output format and the operating mode, the data created by Impinj Speedway Connect will vary.  To illustrate this, sample data was captured reading 3 tags with EPC's 999908290000000000000004, 999908290000000000000003, and 999908290000000000000001 by running an Impinj xArray RAID RFID gateway in each of the 3 operating modes.

In Location mode, confidenceData provides a list of key/values. Only the values for key=130 and key= 136 are used by applications.  These applications calculate the location of a tag when read by multiple Impinj xArrays.

These data formats are common among all types of Impinj Speedway Connect output channels, namely, HTTP Post, TCP/IP socket, Serial, keyboard emulation, and USB Flash Drive. 

Operating Mode Output Data Format:
JSON
Output Data Format:
Key-Value Pairs
Inventory (All Models)

{"antennaPort":7,
"epc":"999908290000000000000004",
"tid":"E28011002000564500000002",
"firstSeenTimestamp":
"2018-06-14T00:15:54.36879Z",
"peakRssi":-51,"isHeartBeat":false}

{"antennaPort":23,
"epc":"999908290000000000000003",
"tid":"E28011002000564500000001",
"firstSeenTimestamp":
"2018-06-14T00:15:54.373293Z",
"peakRssi":-50,"isHeartBeat":false}

{"antennaPort":25,
"epc":"999908290000000000000001",
"tid":"E28011002000564500000000",
"firstSeenTimestamp":
"2018-06-14T00:15:54.410799Z",
"peakRssi":-62,"isHeartBeat":false}

Format:

<AntennaPort>,<EPC>,<TID>,<FirstSeenTImestamp>,
<PeakRSSI>

Example:

44,999908290000000000000003,
E28011002000564500000002,
2018-06-14T00:19:31.289654Z,-5

34,999908290000000000000001,
E28011002000564500000001,
2018-06-14T00:19:31.523961Z,-58

19,999908290000000000000004,
E28011002000564500000000,
2018-06-14T00:19:31.845250Z,-52

Location (xArray)

{"epc":"999908290000000000000004",
"lastSeenTime":
"2018-0614T00:54:18.305623Z",
"type":"update",
"xCm":23,"yCm":189,"confidenceWeight":
9842,"confidenceData":[130,2519697,131,2519697,132,12,
133,19,134,42565,135,6,136,6]}

{"epc":"999908290000000000000001",
"lastSeenTime":
"2018-06-14T00:54:23.269842Z",
"type":"update",
"xCm":-7,"yCm":187,"confidenceWeight":
4247,"confidenceData":[130,1087483,131,1087483,132,12,
133,17,134,76099,135,13,136,13]}

{"epc":"999908290000000000000003",
"lastSeenTime":
"2018-06-14T00:54:23.272192Z",
"type":"update",
"xCm":22,"yCm":226,"confidenceWeight":
19769,"confidenceData":[130,5061030,131,5061030,132,12,
133,17,134,74480,135,13,136,13]}

999908290000000000000004,
2018-06-14T00:52:41.483983Z,
update,24,201,23249,130,
5951772,131,5951772,132,12,133,
20,134,53800,135,13,136,13

999908290000000000000001,
2018-06-14T00:52:46.485955Z,
update,-4,185,4535,130,1161084,
131,1161084,132,12,133,17,134,
60387,135,13,136,13

999908290000000000000003,
2018-0614T00:52:46.516607Z,
update,25,233,21337,130,5462377,
131,5462377,132,12,133,17,134,
31382,135,13,136,13

Direction

(xArray) -

the 3 tags transitioned
between sectors 4 and 8

{"epc":"999908290000000000000004",
"type":"exit",
"tagPopulationStatus":"ok",
"firstSeenTime":
"2018-06-14T21:44:44.541582Z","lastSeenTime":
"2018-06-14T21:44:50.162242Z","firstSeenSector":4,
"lastSeenSector":8}

{"epc":"999908290000000000000003",
"type":"exit",
"tagPopulationStatus":"ok",
"firstSeenTime":
"2018-06-14T21:44:44.866000Z","lastSeenTime":
"2018-06-14T21:44:50.276220Z","firstSeenSector":4,
"lastSeenSector":8}

{"epc":"999908290000000000000001",
"type":"exit",
"tagPopulationStatus":"ok",
"firstSeenTime":
"2018-06-14T21:45:07.15372Z","lastSeenTime":
"2018-06-14T21:45:11.558981Z","firstSeenSector":8,
"lastSeenSector":4}

999908290000000000000003,
2018-06-14T21:53:03.545328Z,
2018-06-14T21:53:06.860999Z,
exit,4,8,ok

999908290000000000000004,
2018-06-14T21:53:03.97411Z,
2018-06-14T21:53:07.471791Z,
exit,4,8,ok

999908290000000000000001,
2018-06-14T21:53:31.725254Z,
2018-0614T21:53:36.758286Z,
exit,8,4,ok

When sending data over HTTP, additional data is provided for the HTTP server to identify which reader or gateway is communicating with it.

JSON Key-Value Pairs
{ "reader_name": "xarray-xx-xx-xx",
"mac_address":"XX:XX:XX:XX:XX:XX",
"tag_reads":[ <data stream
described above> ]} 
The POST variables sent by Speedway Connect:
  • reader_name : The name assigned to the reader in Speedway Connect
  • mac_address : The MAC address of the reader
  • line_ending : Line ending character specified in Speedway Connect
  • field_delim : Field delimiter character specified in Speedway Connect
  • field_names : A list of field names, separated by the specified delimiter
  • field_values : <data stream described above>

 

Testing the Output

Once Impinj Speedway Connect is configured and before developing your application, you will want to see the data as it is generated.  Here are a few options to try when testing Impinj Speedway Connect and developing software to consume data.

 

1) TCP/Socket Output

The simplest method is to open a TCP/IP connection to the reader using an SSH program such as PuTTY. 

Step 1) Make sure that in the Speedway Connect configuration page, under "Output: Connection" has the following setup. For how to access the Speedway Connect configuration page, see Support Article: Speedway Connect System Configuration.  Also select the data output format: JSON or Key-Value Pairs.

tcp.png

"Output: Connection" in the Speedway Connect configuration page

 output.png

 "Output: Data" in the Speedway Connect configuration page

Step 2) Start Impinj Speedway Connect and make sure that the "Status" string at the top is green after the "Apply" string is clicked.

titleBar.png

Top bar -  Speedway Connect configuration page

Step 3) Connect to Impinj Speedway RAIN RFID readers or gateways using an SSH client program.  Here we use PuTTY: 

mceclip0.png

Step 4) Press the "Open" button to start the SSH session and now you should see the live data stream assuming that there are tags in the antenna's field of view.

cmd.png

 

2) HTTP Post in JSON Output Data Format

To examine the HTTP Post output sent from Impinj Speedway Connect, please try the following:

Step 1) In the Impinj Speedway Connect configuration page, under "Output : Connection",  turn on the HTTP Post checkbox, and under "Output : Data", select the JSON output format. 

post.png

"Output : Connection" in the configuration page

 json.png

 "Output: Data" in the configuration page

Step 2) Use the following Python program to display the HTTP post data

You can view HTTP post traffic from Impinj Speedway Connect with a short python script.

        1) Install Python 2.7 or greater

        2) Install Flask by typing command:    pip install Flask

        3) Save this file shown below as PostServer.py

from flask import Flask, request
app = Flask(__name__)

@app.route('/connect', methods = ['POST', 'GET'])
def message():
if request.method == 'POST':
app.logger.info('Request received.')
app.logger.info('Url: %s', request.url)
app.logger.info('Data: %s', request.data)
app.logger.info('Is JSON: %s', request.is_json)
else:
app.logger.info('GET request received.')
return 'OK\n'

if __name__ == '__main__':
app.run(host='0.0.0.0', port='5000', debug=1)

         PostServer.py

        4) run command:  python  PostServer.py   to see the HTTP post output.

Best Practices

  • Make sure that the port (default 5000) accepts inbound traffic so adjusting the firewall on your computer may be necessary.
  • The HTTP post interval (default 300 seconds) can be lowered to say 10 seconds so you will not have to wait very long for the data to appear.
  •  

postcmd.png

 

3) Parsing Key Value Pair HTTP Post Data

This  server-side php script parses the POST data and insert it into a relational database. 

To output Key-Value Pairs data, remember to set the output format correctly in "Output : Data" in the Speedway Connect configuration page.

dataout.png

"Output : Data: in the Speedway Connect configuration page

 

Developing an Application

The most popular method today is to develop an application that receives HTTP posts in JSON format.  This method is supported by all major programming languages and a wide variety of programming tools are available. Since HTTP post is a standard approach to sending data over the internet, Impinj Speedway Connect can post data up to a cloud application without the concern of being blocked by a firewall.

Was this article helpful?
3 out of 5 found this helpful

Comments

0 comments

Article is closed for comments.