I'm getting started...

Questions about Rifidi Workbench

Moderators: Matt, kyle

Chris
Posts: 7
Joined: Tue Nov 24, 2009 8:24 am
Location: UK

I'm getting started...

Post by Chris » Tue Nov 24, 2009 9:00 am

Hi there,

A brief background to my question:-
My manager has purchased a reader (Symbol XR480) and a couple of antenna, with a view to writing some software that will do some clever stuff - all out of my capabilities... anyway, I need to do some testing to see how passive tags get picked up/best configurations etc in the real world. I have just downloaded Rifidi as I want to be able to see what tags are being detected. I've managed to get a session started on Workbench and have an LLRP poll running and it's displaying a number of tags ever few seconds.

What I really want is to be able to output (to a database ideally, but csv etc would be workable) all the tag activity so that I can monitor how it's performing and which tags it is/isnt seeing etc. Does anyone have any idea if this is possible with Workbench, or am I barking up the wrong tree?!

Any clues/pointers in the right direction would be greatfully received! :)

Chris.

kyle
Posts: 220
Joined: Tue Apr 22, 2008 10:12 pm
Name: Kyle
Organization: Pramari
Location: Hartford, CT
Contact:

Re: I'm getting started...

Post by kyle » Tue Nov 24, 2009 9:27 am

Chris,
This is possible, but its a "small matter of programming" at this point. It shouldn't be hard to do, we just don't have that feature in there right now. There are two ways to go about this. One way that you could do it is by writing a simple java program that listens to the JMS Topic that tags are being written to. Whenever there is a new tag, it could do a JDBC call and write it to the database. So basically what you would do is start up edge server, start up workbench, and have the LLRP reader start reading tags. Then you would start up your little java program which just listens to that JMS queue and whenever it sees a tag it writes it to a DB. This would be sort of a hack that just would solve your problem, but would not be too extensible.

The other way of doing this would be to develop an edge server application. The edge server is intended to be an application platform so that you can write plugins for it to handle tag data. Doing this would give you alot more power since you would be able to filter tags on the server before putting them in the DB (eliminating dups for example) using our event processing engine called esper. Unfortunately we only have one example on how to make an edge server application at this point (see the edge server tutorial link on our wiki), but we are making more.

Actually, now that I think about it, your requirements would be great for a new example on our wiki since they are simple and involve a database (we don't have an example yet of using a DB with an edge server application). If you have a little bit of time, maybe I could work with you on developing a tutorial around this example.
-Kyle

Chris
Posts: 7
Joined: Tue Nov 24, 2009 8:24 am
Location: UK

Re: I'm getting started...

Post by Chris » Tue Nov 24, 2009 10:11 am

Hi Kyle, thanks for your quick response :)

Unfortunately the "small matter of programming" puts this way out of my capability

In terms of timescales, I really need something set up quite quickly for my initial testing, aparently we have some 'biztalk' app that I can use on the server (goodness only knows how :? )... but for slightly longer term, to have rifidi and MySQL set up on my laptop would be really handy, so yep - if you would be able to, I'd be able to help a bit with the tutorial in whatever way I can.

Regards,
Chris.

kyle
Posts: 220
Joined: Tue Apr 22, 2008 10:12 pm
Name: Kyle
Organization: Pramari
Location: Hartford, CT
Contact:

Re: I'm getting started...

Post by kyle » Tue Nov 24, 2009 7:28 pm

Chris,
Over the next few days, I am going to try to write a demo application that involves logging tags to a database. We have had several requests for this kind of functionality. If I could get you this by some time early next week, would you be able to test it out and see if it does what you need it to do? In the mean time, could you please explain your requirements a bit? What information needs to go into the database? Do you need to do any filtering? For example, with rifidi, it is fairly easy to filter out duplicate tag reads, or only log tags that follow a certain pattern for example. I am planning for now just to use a derby db since that will be the simplest for me to set up (I don't have alot of DB experience), but I think that if JDBC works like I think it should, then it should be relatively easy to use different databases.
-Kyle

Chris
Posts: 7
Joined: Tue Nov 24, 2009 8:24 am
Location: UK

Re: I'm getting started...

Post by Chris » Wed Nov 25, 2009 8:48 am

Hi Kyle,

Not a problem - I will see what I can do.

In terms of requirements for what goes into the database, I'd be looking at storing Tag ID, the read timestamp, which reader/Antenna it was picked up on. Initially I'll be looking at minimal filtering as I want to try and understand the reading properties/capability of the equipment that I have... beyond that, I don't really know what other data it would be possible to pick up!

Eventually though, I guess that I'll be looking at filtering out repeat reads where the tag is stationary in the read zone etc, and also the option of ignoring tags that only show on one antenna, thus logging where a tag has gone from Antenna 1 to Antenna 2 (or vice versa) so it's possible to tell which way it went through a doorway, the idea being having an antenna on either side (inside/outside) of the doorway, if that makes sense.

Chris

P.S. Just a quick question - I've done a quick google; when you say the Derby DB - is that Apache Derby? I'd not come across it before, but it seems likely that it is.

kyle
Posts: 220
Joined: Tue Apr 22, 2008 10:12 pm
Name: Kyle
Organization: Pramari
Location: Hartford, CT
Contact:

Re: I'm getting started...

Post by kyle » Wed Nov 25, 2009 9:34 am

Chris,
Ok, I'll just attempt to stuff whatever tags I see into a DB. Those other filtering rules that you mentioned shouldn't be hard to do with our system. I'll work today on this and let you know how far I get. Yes -- Apache Derby is a lightweight RDBMS written all in java. As I said, I don't have too much experience with databases so this will just let me get one up and going quickly (I won't have to figure out how to install MySQL). However, I'm pretty sure that if I understand everything right, the program will be able to talk to a different DB just by changing a few parameters.
-Kyle

kyle
Posts: 220
Joined: Tue Apr 22, 2008 10:12 pm
Name: Kyle
Organization: Pramari
Location: Hartford, CT
Contact:

Re: I'm getting started...

Post by kyle » Wed Nov 25, 2009 7:32 pm

Chris,
So I've whipped together a quick application that just inserts data into a database. It works with both Derby and MySQL. Here are the instructions for using with MySQL:

First set up a MySQL instance and create a database called rifididb. Unfortunately, I cannot provide instructions here on how to install MySQL on your system. There are plenty of tutorials out there on that.
Next download the application(http://dl.dropbox.com/u/1513839/pramari/dbapp.zip). Unzip it, and move the dbapp folder into the applications folder in your edge server installation.
Now open up 'edge server.ini' in the edge server file and add this:

Code: Select all

-Dorg.rifidi.jdbc.driver=com.mysql.jdbc.Driver
-Dorg.rifidi.jdbc.url=jdbc:mysql://127.0.0.1/rifididb
-Dorg.rifidi.jdbc.user=root
-Dorg.rifidi.jdbc.pass=root
Note that you need to set the url, user, and pass to the values according to your database.

Now start up the edge server, workbench, and start reading tags just like you are used to doing.
Now type this into the edge server console (at the osgi prompt)

Code: Select all

loadApp dbapp
That is what loads the application. Wait for it to tell you the bundles are loaded properly. Then type this:

Code: Select all

dbstart
That command starts writing the tags to the database.

In the future I will make this into a full tutorial available on our wiki. Unfortunately I won't have time to do this next week as it looks like. Good luck and let me know if you get it working.

Chris
Posts: 7
Joined: Tue Nov 24, 2009 8:24 am
Location: UK

Re: I'm getting started...

Post by Chris » Thu Nov 26, 2009 10:39 am

Hey Kyle,

That was great - it worked first time - I had no problems with it at all :D

I had a guess about the 'dbstop' command - is there such a thing, as it could be useful, as it seems that it continues to populate the DB even when the session is stopped.

Also, is it possible to stop the INFO/DEBUG messages that get displayed in the Edge command window (perhaps to a logfile rather than to screen?) - it's just a little tricky typing in commands whilst messages go flying past!

Thanks again :)
Chris.

kyle
Posts: 220
Joined: Tue Apr 22, 2008 10:12 pm
Name: Kyle
Organization: Pramari
Location: Hartford, CT
Contact:

Re: I'm getting started...

Post by kyle » Sat Nov 28, 2009 12:01 pm

Great! glad to hear that it worked.

I implemented a dbstop command, but I'm not sure if it actually works. I didn't look too hard into closing the JDBC session.

As for the log messages: there is a way to control it, although not a great way for now. See the bottom of this page: http://wiki.rifidi.org/index.php/Edge_Server_Console. I want to write up a better HOWTO soon that explains it a bit better. You won't be able to direct messages to a log file using this, only control what output is logged.

Right now the logging configuration is set using a properties file that is supplied by a jar file. This is fine when you are developing the edge server, because you can control the file in your IDE, but when running the edge server in production mode, we need to have the logging controlled by a properties file that is read in from the file system, so that you can edit it. I will open up a trac issue for this so that this will be fixed in the next release.

Breez
Posts: 22
Joined: Thu Oct 29, 2009 9:18 am

Re: I'm getting started...

Post by Breez » Sun Nov 29, 2009 9:32 am

Hi this thing looks interesting i have tryed it works grate i got one quetion. Is it possible (easily) to combine Rifidi Emulator, Edge Server, Workbench, rifididb and llrp-commander that everything would work :?:

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests