10. Streaming

10.1: RFID data Consumption

10.1.1: Component type STREAMING_RFID (HAL)

Introduction

This component type uses the Hardware Abstraction Layer (HAL) framework to get to the RFID data. The HAL abstracts from the underlying hardware and offers a standardized interface to the proprietary RFID systems. An instance of the HAL controls the access to a reader. Either one antenna can be connected to a reader or a multiplexer, where multiple antennas are connected. Notice that the HAL only supports one client at a time. For another client the HAL has to be restarted. The HAL offers an XML interface over TCP. The most important functionalities of the HAL:

  • Identify: Identifies the tags which are in the area of the antenna.
  • ContinuousIdentify: Continuously identifies the tags which are in the area of an antenna. Basically, this function initializes a thread which calls Identify. This is done as fast as possible. It takes approximately 500 milliseconds to query one antenna. After all antennas are queried the result is sent. If four antennas are connected then ContinuousIdentify delivers a result every 2 seconds.
  • MultiplexIdentify: This function is used, if a multiplexer is connected to a reader. The client can choose which antennas should be queried.
  • ContinuousMultiplexIdentify: This function is used, if a multiplexer is connected to a reader. Identifies continuously. The client can choose which antennas should be queried.
The component type STREAMING_RFID uses these four functionalities to get the RFID data. Moreover, it generates entry and exit events out of the raw RFID data.

Installation

The system has been tested with the following hardware:

  • Reader: FEIG ID ISC.MR100, serial
  • Multiplexer: FEIG ID ISC ANT MUX
  • 5 Antennas: FEIG ID ISC.ANT340/240
Installation of the HAL:
  • Binaries and source of the HAL are in the eclipse plugin ch.ethz.jopera.subsystems.rfid in the folder hal.
  • Unpack \HardwareAbstractionLayer\dll\HAL\Libs.zip to C:\Windows\system32\
  • Copy the data \HardwareAbstractionLayer\dll\win32com.dll into the folder of your JAVA-Environment (JRE).
  • Edit \HardwareAbstractionLayer\props\HardwareAbstractionLayerProperties.properties: Choose ReaderName = FeigMultiplex and ReaderType = feig.FeigMultiplexController
  • Edit \HardwareAbstractionLayer\props\FeigMultiplexProperties.properties Declare which antennas should be queried and the names of the antennas. Also declare which com port the reader is connected to.
  • Doubleclick on runHAL.bat starts the HAL.
More useful information to the installation and configuration of the HAL can be found under the topic AkimbaRfidStack in the Wiki ( http://www.twiki.vs.inf.ethz.ch ). Also useful is the simulator framework which simulates a reader. Moreover the HAL can be tested by running runHALClient.bat.

Input, output and system output parameters

Input parameters:

  • stackURL: [mandatory, default: no default, example: localhost ]
    • Description: The IP address of the host computer where the HAL runs.
  • stackPort: [mandatory, default: no default, example: 4000 ]
    • Description: The port on which the HAL runs. Is set in the File HardwareAbstractionLayerProperties.porperties.
  • readerId: [optional, default: no default, example: FeigMultiplex ]
    • Description: The id of the reader to query.
  • sourceIds: [optional, default: no default, example: channel1, channel3 ]
    • Description: Commma seperated list of the ids of the antennas which should be queried if a muliplexer is connected. If no antenna is entered, all antennas connected to the multiplexer will be queried.
  • identificationMode: [mandatory, default: no default, example: identify ]
    • Description: Indicates which function is called.
    • identify : Identify
    • continuousidentify : ContinuousIdentify
    • events : ContinuousIdentify with entry and exit event generation
  • tagOutputMode: [optional, default: list, example: list ]
    • Description: Indicates how the tags will be delivered.
    • list : Tags of one read will be delivered as a list. There is also an output if nothing was detected.
    • single : Tags of a read will be delivered one after the other.
Output parameters:
  • readerId: The id of the reader where the tag was detected.
  • sourceId: The id of the antenna where the tag was detected.
  • tag: Id of the observed tag. Is used as output if the tags are delivered one after the other.
  • tagList: Array of ids of oberved tags. Is used as output if the tags are delivered as a list.
  • eventType: Either ENTRYEVENT if an entry event is outputted or EXITEVENT if an exit event is outputted.
  • timestamp: The difference, measured in milliseconds, between the time the tag was detected and midnight, January 1, 1970 UTC.
Semantics of the system output parameters:
  • observations: A list of observations from one read
  • observation: Is of type rfidstack.hal.Observation of the HAL framework which contains all information of a read. Is always sent unless the IdentificationMode is events.
  • events: A list of ch.ethz.jopera.subsystems.rfid.hal.Event if identificationMode is events.
  • error: Error message if subsystem fails.

Important notices

  • The HAL has to be restarted if the connection was broken by the subsystem.

10.1.2: Component type STREAMING_RFID_EL (EL)

Introduction

This component type uses the Advanced AutoID Event Layer (Event Layer) framework. The Event Layer is responsible for getting the raw RFID data and filter events out of it. It can filter identify-, entry- and exit events. An identify notification is sent when a tag is present at an antenna. The Event Layer uses the HAL to get to the raw RFID data. The advantage of the Event Layer over the HAL is that raw RFID data can be consumed from multiple instances of the HAL. The Event Layer offers an Elvin interface which is used internally by the component type STREAMING_RFID_EL.

Installation

  • Install the HAL as described in the section before.
  • Install an Elvin Router:
    • Download from http://www.mantara.com
    • Set the scope in the configuration file elvind.conf. With this scope the component type can connect to the Elvin Router.
    • Start elvind in with the command line and choose the option -ldd.
  • Binaries and source of the Event Layer are in the eclipse plugin ch.ethz.jopera.subsystems.rfid in the folder el.
  • Configure EventLayerProperties.properties:
    • numberOfReaders: Number of readers the Event Layer connects to.
    • readerID_1: The first readerId.
    • elvinScope: The scope of the Elvin router. Alternatively elvinURL can be entered.
    • elvinURL: The url of the Elvin router. Alternatively elvinScope can be entered.
  • Configure FeigMultiplexProperties.properties:
    • readerType: The type of the reader.
    • stackURL: The url where the HAL runs.
    • stackPort: The port on which the HAL runs.
    • numberOfSources: Number of antennas which are connected to the multiplexer.
    • sourceID_1: The name of the first antenna.
  • Start the Event Layer by doubleclicking runEL.bat.

Semantics of the input, output and system output parameters

Semantics of the input parameters:

  • readerId: [mandatory, default: no default, example: FeigMultiplex ]
    • Description: The id of the reader to query.
  • sourceIds: [mandatory, default: no default, example: channel1, channel3 ]
    • Description: Commma seperated list of the ids of the antennas which are queried if a muliplexer is connected.
  • elvinScope: [mandatory, alternative: elvinURL, default: no default, example: EventLayer ]
    • Description: The scope under which the elvin server runs. Alternatively, the elvinURL can be set.
  • elvinURL: [mandatory, alternative: elvinScope, default: no default, example: elvin://localhost ]
    • Description: The URL where the elvin server runs. The syntax of the elvinURL starts with elvin:// followed by the hostname.
  • identificationMode: [mandatory, default: no default, example: continuousidentify ]
    • Description: Indicates which function is called.
    • continuousidentify : ContinuousIdentify
    • events : ContinuousIdentify with entry and exit event generation
Semantics of the output parameters:
  • readerId: The id of the reader where the tag was detected.
  • sourceId: The id of the antenna where the tag was detected.
  • eventType: Either Identify, Entry or Exit.
  • tag: Id of the observed tag.
  • timestamp: The difference, measured in milliseconds, between the time the tag was detected and midnight, January 1, 1970 UTC.
Semantics of the system output parameters:
  • error: Error message if subsystem fails.

10.2: Monitoring Parameter Values with TPTP

10.2.1: Introduction

To use this feature download and install the eclipse project TPTP 4.0.0. With this feature numeric parameters can be monitored in a coordinate system.

10.2.2: Usage

The usage is analog to the usage of the parameter viewer. To view a parameter in the JOpera Statistical Graph View choose Show value in Statistical Graph View from the context menu of the parameter which you want to monitor and click it again to stop monitoring the parameter. To see the graph the view JOpera Statistical Graph View (in folder JOpera ) and "Profiling Monitor" (in folder Profiling and Logging ) have to be opened. By clicking the Link with Viewer -button in the Profiling Monitor the graph will be shown. In the view Statistical Graph Summaries (in folder Profiling and Logging ) you can choose which graphs should be shown in the JOpera Statistical Graph View .

10.3: Feeds

10.3.1: Introduction

JOpera allows to consume and emit Feeds. Internally, project ROME ( https://rome.dev.java.net ) is used. ROME is a set of Atom/RSS Java utilities that make it easy to work in Java with most syndication formats. Supported formats are rss_0.9, rss_0.91U, rss_0.91N, rss_0.92, rss_0.93, rss_0.94, rss_1.0, rss_2.0 and atom_0.3.

10.3.2: Feeds Consumption

Introduction

A feed can be consumed by specifying the URL of the feed and the interval between two polls of the feed. The inputparameter outputinterval indicates in which interval each entry is delivered. The entries are delivered one after the other. One output parameter is entry which contains a com.sun.syndication.feed.synd.SyndEntry. SyndEntry contains all information of an entry. All information in the SyndEntry is also delivered separately. Note that there can be several contents or categories in an entry, but only one of each is delivered. But usually an entry only contains one of each.

Semantics of the input parameters

  • url: [mandatory, default: no default, example: http://rss.news.yahoo.com/rss/tech ]
    • Description: The URL of the feed.
  • pollinginterval: [mandatory, default: 3600000, example: 100000 ]
    • Description: The interval between two polls of the feed. In milliseconds. If the feed provides a TTL the feed is always polled with the TTL interval.
  • outputinterval: [optional, default: 1000, example: 1500 ]
    • Description: The interval between the output of two entries.

10.3.3: Feeds Emission

Introduction

Publish a feed with a feed type of your choice. Use the component type FEED_EMISSION_FEEDCREATION to create the feed and the component type FEED_EMISSON_ENTRYCREATION to create the feed entries. With the component type FEED_EMISSION_TERMINATION the feed will be removed. Make sure that the Jetty Webserver of JOpera is invoked at startup of Eclipse. The URL of the created feed consists of the ip, the port, the context ( feeds ) and parameter feedid. Example on localhost: http://localhost:9112/feeds?feedid=myfeed . If no feedid is given http://localhost:9112/feeds/ than a list with all available feeds is sent back. Here are some notes about the behaviour of the System:

  • Different processes can write into the same feed by choosing the same feedid in the EntryCreation task.
  • When a second feed is created with the same feedid as a first feed and the mustbecreated flag is set then the task fails..
  • Termination makes sure that feed with specified feedid is deleted.
  • HTML or XML will be escaped in RSS and Atom.
  • rss_0.9 is not recommended for usage because it doesn't have any content or description where a value could be inserted.
  • Note that rss_0.9, rss_0.91N and rss_0.91U can only publish 1 to 15 entries.
  • The URI of the entries are set automatically. The URIs are build by the entry title concatenated with a the entries counter. Pay attention that feed readers distinguish the entries differently. It's possible that they are distinguished by the URI and/or the title or by all fields.

Step by step guide on how to publish a field

  1. Create task FeedCreationTask with component type FEED_EMISSION_FEEDCREATION and set the parameter feedid.
  2. Create task EntryCreationTask with component type FEED_EMISSION_ENTRYCREATION and set feedid
  3. Create task ProducerTask which produces the parameter you want to publish.
  4. Connect the output of the ProducerTask with the input of the EntryCreationTask.
  5. The activator for the EntryCreationTask is Finished(FeedCreation) AND Outputting(ProducerTask) .
  6. If the feed should be removed when the ProducerTask is finished, create task TerminationTask with component type FEED_TERMINATION whith activator Finished(ProducerTask) and set feedid to the id of the feed which has to be terminated.

Component type FEED_EMISSION_FEEDCREATION

Explanation of the input parameters of the component type FEED_EMISSION_FEEDCREATION :

  • mustbecreated: [optional, default: 1 , example: 0 ]
    • Description: If equals 1 then feed must be created and not an existing feed with the same feedid used. If equals 0 then an existing feed with the same feedid can be used.
  • maxentries: [optional, default: 10 , example: 15 ]
    • Description: The maximum number of entries in the feed.
  • author: [optional, default: no default, example: lawyer@boyer.net (Lawyer Boyer) ]
    • Description: The author of the feed.
  • categoryname: [optional, default: no default, example: Grateful Dead ]
    • Description: The category the feed belongs to.
  • categorytaxonomyuri: [optional, default: no default, example: http://www.fool.com/cusips ]
    • Description: Identifies a categorization taxonomy. Is only set if categoryname is set.
  • copyright: [optional, default: no default, example: Copyright 2002, Spartanburg Herald-Journal ]
    • Description: Copyright notice for content in the feed.
  • description: [mandatory for RSS, optional for Atom, default for RSS: TID, default for Atom: no default, example: The latest news from GoUpstate.com ]
    • Description: The description of the feed.
  • encoding: [optional, default: no default, example: utf-8 ]
    • Description: Coding of the characters.
  • link: [mandatory for RSS, optional for Atom, default for RSS: http://www.wiki.jopera.org , default for Atom: no default, example: http://www.goupstate.com/ ]
    • Description: The link of the feed.
  • type: [optional, default: atom_0.3 , example: rss_2.0 ]
    • Description: Version of RSS or Atom (rss_0.9, rss_0.91U, rss_0.91N, rss_0.92, rss_0.93, rss_0.94, rss_1.0, rss_2.0 and atom_0.3).
  • imagedescription: [optional, default: no default, example: CNN.com delivers up-to-the-minute news ]
    • Description: Description of the image. Image will only be created if a feedimagelink, a feedimagetitle and a feedimageurl is given.
  • imagelink: [optional, default: no default, example: http://www.cnn.com/rssclick/SHOWBIZ/?section=cnn_showbiz ]
    • Description: Link associated with the image. Image will only be created if a feedimagelink, a feedimagetitle and a feedimageurl is given.
  • imagetitle: [optional, default: no default, example: CNN.com - Entertainment ]
    • Description: Title of the image. Image will only be created if a feedimagelink, a feedimagetitle and a feedimageurl is given.
  • imageurl: [optional, default: no default, example: http://i.cnn.net/cnn/.element/img/1.0/logo/cnn.logo.rss.gif ]
    • Description: URL of the image. Image will only be created if a feedimagelink, a feedimagetitle and a feedimageurl is given.
  • language: [optional, default: no default, example: en ]
  • feedid: [mandatory, default: no default, example: myfeedid ]
    • Description: Identifier for the feed. The URL of the feed has a parameter feedid with this value.
  • publisheddate: [optional, default: 1 , example: 0 ]
    • Description: If equals 1 then the time when the feed is created is set. If equals 0 then no time is set.
  • title: [optional, default for RSS: TID, default for Atom: no default, example: GoUpstate.com News Headlines ]
    • Description: The title of the feed.

Component type FEED_EMISSION_ENTRYCREATION

Explanation of the input parameters of the component type FEED_EMISSION_ENTRYCREATION:

  • feedid: [mandatory, default: no default, example: myfeed ]
    • Description: Identifier of the feed the entry has to be added.
  • author: [optional, default: no default, example: lawyer@boyer.net (Lawyer Boyer) ]
    • Description: The author of the entry.
  • categoryname: [optional, default: no default, example: Grateful Dead ]
    • Description: The category the entry belongs to.
  • categorytaxonomyuri: [optional, default: no default, example: http://www.fool.com/cusips ]
    • Description: Identifies a categorization taxonomy. Is only set if categoryname is set.
  • link: [optional, default for RSS: http://www.wiki.jopera.org , default for Atom: no default, example: http://www.feedsfarm.com/article/0f2c247eaf5f59b61dd33bb5ae03ea70131bcf60.html ]
    • Description: The URL of the entry.
  • title: [optional, default: TID, example: The Engine That Does More ]
    • Description: The title of the entry.
  • value: [mandatory, default: no default, example: Must be the output of a task ]
    • Description: Must be an output of a task.
  • publisheddate: [optional, default: 1 , example: 0 ]
    • Description: If equals 1 then the time when the entry is created is set. If equals 0 then no time is set.