Northwind Using Emulator

From RifidiWiki

Jump to: navigation, search

This is Step 2 in the Northwind Application Tutorial
Previous Step: Step 1: Create the Application
Next Step: Step 3: Esper: Track Packages

What You Will Learn

  • Using Rifidi Emulator to speed up RFID development.
  • Controlling the edge server from the command line.

Running Rifidi Emulator

Rifidi Emulator is a developer tool that emulates the interfaces of many popular RFID readers. It can be used to speed up development of RFID applications, since you can write applications that talk to RFID readers without the need for access for a physical reader. To get Rifidi Emulator up and running follow the steps in the Emulator User's Guide.

For the purposes of this tutorial, create two Alien ALR readers. The first reader will represent the Dock Door. Assign it IP address 127.0.0.1:20000 The second reader will represent the weigh station. Asssing it 127.0.0.1:20001. Create a few tags (does not matter which kind). Drag and drop the tags onto the antenna. Start the readers.

Instead of creating the readers yourself, you can load the configuration from File:Northwind-emulator.rfts.zip. Simply unizp it and choose File->Open IDE Configuration and choose the rtfs file.

Tutorial-Emulator.png

Connecting to Emulator from the Edge Server

There are two ways (currently) to create a connection to a reader using the edge server. One is to use Workbench.

However, when developing applications on the edge server, it is often quicker to use the Edge Server Console.

Once the edge server is up and going, type the following commands into the console:

  1. readertypes - This lists the kind of reader adapters available. You should see one called Alien
  2. createreader Alien - This makes a new instance of a reader configuration with the default properties (including the IP & port, which by default is 127.0.0.1:20000 for the Alien). This will connect to the Dock Door, for the purposes of this demo. You should see output indicating the sensor was created along with it's ID (probably Alien_1).
  3. readers - This lists the created readers. You should see your reader listed here.
  4. createsession Alien_1 - This creates a session that you will use to connect to Dock Door Reader.
  5. commandtypes - This lists the available kind of commands you can execute.
  6. createcommand Alien-Poll - Like createreader this creates a new configuration with default properties, except this time its a command configuration.
  7. executecommand Alien_1 1 Alien_Poll_1 1000 - This tells the edge server to schedule a Alien_Poll command on session 1 of Alien_1 once every second.
  8. startsession Alien_1 1 - This tells the session to make the TCP/IP connection to the Dock Door Reader. At this point you should see activity on the console of the emulator.
  9. createreader Alien Port 20001 - This makes a new instance of a reader configuration that connects to 127.0.0.1:20001 (which is the weigh station, for the purposes of this demo).
  10. createsession Alien_2 - This creates a session that you will use to connect to Weigh Station Reader.
  11. executecommand Alien_2 1 Alien_Poll_1 1000 - You can execute the command that you've previously created on the second session.
  12. startsession Alien_2 1 - This tells the session to make the TCP/IP connection to the Weigh Station Reader.
  13. save - This saves the configurations so that you don't have to type all these commands again.

Once you make sure this configuration is working, you can stop the sessions for now. Just type

  1. stopsession Alien_1 1 - Stop the Dock Door Reader
  2. stopsession Alien_2 1 - Stop the Weigh Station Reader
Personal tools