Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Questions about developing the edge server core as well as applications

Moderators: Matt, kyle

Post Reply
RS123
Posts: 9
Joined: Wed Nov 29, 2017 4:17 pm

Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by RS123 » Tue Apr 03, 2018 9:59 am

I have a Rifidi app that subscribes to only the RSSIMonitoringService. I cannot get any tagArrived or
tagDeparted events triggered in my testing; testing is done in Eclipse.

The Rifidi setup is version 3.7.0, using Eclipse Juno 64-bit and Esper 5.3.0.
I am running the app in Eclipse on a Windows 10 Pro 64-bit machine.

This app used 2 read zones and one LLRP reader with 3 antennas.

The read zone "Front_Door" uses antenna 1
The read zone "Back_Door" uses antennas 2 and 3


Here are the app properties used by the RSSI Monitoring Service below.
I have tried many variations of these properties with no success.

# windowTime: The timeout that will be used to determine if a tag has gone
# to a new zone. Times less than 5s are not recommended.
# It's used for RSSIMonitoring Service
windowTime =10.0

# countThreshold: The threshold for number of times a tag must be read before
# the readzone it has shown up at will be switched.
# Do not set this to greater than the windowTime divided by the frequency in
# seconds that tag reports will show up as configured by your reader.
# It's used for RSSIMonitoring Service
countThreshold =1

# minAvgRSSIThreshold: The lowest average RSSI that will have to be seen
# before the readzone is switched.
# It's used for RSSIMonitoring Service
minAvgRSSIThreshold =1.0



Here is the _start method in the app:

@Override
public void _start() {

super._start();

//Get all the read zones
HashMap<String, ReadZone> allReadZones = super.getReadZones();

// RSSi
rssiReadZoneSubscriberList = new LinkedList<MyRSSIReadZoneSubscriber>();

//Subscribe allReadZones to rssiMonitoringService
subscribeToRSSIMonitoringService(allReadZones);

}



Here is the code that subscribes to the RSSI Monitoring Service:

public void subscribeToRSSIMonitoringService(HashMap<String, ReadZone> allReadZones){

//Create an instance of the rssi read zone subscriber
MyRSSIReadZoneSubscriber myRSSIReadZoneSubscriber = new MyRSSIReadZoneSubscriber(this);

rssiReadZoneSubscriberList.add(myRSSIReadZoneSubscriber);

getRssiMonitoringService().subscribe(
myRSSIReadZoneSubscriber,
allReadZones,
getWindowTime(),
TimeUnit.SECONDS,
getCountThreshold(),
getMinAvgRSSIThreshold(),
0.0d, true);

logger.info("subscribed all readzones to RSSI Monitor"
+ " and getWindowTime: " + getWindowTime() + ", countThreshold: "
+ getCountThreshold() + ", minAvgRSSIThreshold: " + getMinAvgRSSIThreshold());

}

nurban
Posts: 78
Joined: Mon Apr 21, 2014 10:33 am
Organization: PMRS, Inc.
Contact:

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by nurban » Thu Apr 05, 2018 12:20 pm

I haven't taken a look at 3.7.0 yet (I'm still running 3.3.0 in production), so I'll probably come back to this thread after I give it a try. Also, the app I'm running has become really complex over time, so I'll try to tease out the relevant info. That said, I've been using RSSI filtering for a number of years now, so hopefully I can help point you in the right direction.

For starters, have you tried running your app without readzones? I would make sure your test reader is initializing and capturing tags correctly before going any further, particularly when splitting a single reader into multiple readzones. I'm going to assume you already tested the reader from the command line before developing your app. Also, is your log capturing the creation of readzones using the values you're expecting? It may be a simple mistake in one of the properties files that's causing the problem, either for the app, or for the readzones. It's easy to overlook a lot of these items when testing from Eclipse, so I would also suggest you try running your app from a local install of Rifidi and see if you notice anything there.

I can't comment much on your code at the moment, but if you're willing to upload a zip of your app's directory under the server (jar, properies, and readzones), I'd be happy to give it a quick try with the test reader I keep at my desk.

RS123
Posts: 9
Joined: Wed Nov 29, 2017 4:17 pm

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by RS123 » Thu Apr 05, 2018 1:41 pm

I have tried the reader using no Rifidi apps and I get current tags showing. Then I used the HelloWorld app and I see Arrivals and Departures of the tags used. So all seems to work but only the RSSI Monitoring Service is doing nothing. I am wondering if you were to move up to Ver. 3.7.0 if yours will still work. My team could not get the RSSI Monitoring Service to work in Ver. 3.6.0 either, always using Esper 5.3.0.

nurban
Posts: 78
Joined: Mon Apr 21, 2014 10:33 am
Organization: PMRS, Inc.
Contact:

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by nurban » Thu Apr 05, 2018 3:57 pm

I just gave it a try now, and readzones work the same for me in 3.7 as they did in 3.3.

I avoided making any changes to the sever beyond the minimum required for the app to run (Copied my app to the applications directory, changed default.ini to launch the app, copied test reader XML to config directory, and pointed rifidiserver.ini at the test XML). Otherwise, it was a vanilla install using the installer direct from SourceForge. I used a single reader, an Alien 9650, with two antennas split between two readzones. Here is part of my log (don't mind my test readzone names):

Code: Select all

15:45:55,522  INFO org.rifidi.edge.sensors.sessions.AbstractServerSocketSensorSession:142 - Accepted client at /192.168.100.51
15:46:03,193  INFO org.rifidi.app.pharma.PharmaApp:158 - defaultRegEx: ^((?!DiabolikEmission|DiabolikEmission).)*$
15:46:03,195  INFO org.rifidi.app.pharma.PharmaApp:159 - The following 3 readzones have been created: [DIABOLIK-ZONE, DIVINE-ZONE, DefaultZone]
15:46:24,442  INFO org.rifidi.app.pharma.PharmaSubscriber:338 - Web services disabled, changing readzone for Tag: 10011111111111111111111111111111, ReadZone: DIABOLIK-ZONE, Antenna: 0, AvgRSSI 109.0, TagCount: 5.0
15:46:59,441  INFO org.rifidi.app.pharma.PharmaSubscriber:338 - Web services disabled, changing readzone for Tag: 10011111111111111111111111111111, ReadZone: DIVINE-ZONE, Antenna: 1, AvgRSSI 111.8, TagCount: 5.0
This is another really easy item, but have you confirmed your reader is sending the RSSI to the server? I have all Alien readers, and my taglists look like this:

Code: Select all

TagListFormat = Custom
TagListCustomFormat = Tag:%i, Disc:%d %T, Last:%d %T, Count:%r, Ant:%a, Proto:%p, Rssi:%m
At the very least, I can offer that the RSSI Monitoring Service itself probably isn't your problem.

RS123
Posts: 9
Joined: Wed Nov 29, 2017 4:17 pm

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by RS123 » Fri Apr 06, 2018 9:29 am

Thanks for the information. What is your dev setup? Windows or Ubuntu? 64-bit? Java version? I see Rssi values when I look at the current tags output in the Dashboard, so I assume Rssi is being sent by the LLRP reader.

RS123
Posts: 9
Joined: Wed Nov 29, 2017 4:17 pm

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by RS123 » Fri Apr 06, 2018 3:30 pm

It is now working, we used an Alien reader. I don't explicitly create readzones but for the subscribe method I just pass an empty HashMap instance which means it subscribes to all and any readzones. We noticed that the rssi is always positive for the Alien reader. For LLRP we see about the same magnitude of rssi but negative values, so we are wondering if perhaps Rifidi expects the absolute value of the rssi. We still cannot get the RSSI Monitoring Service working with an LLRP reader, only with Alien.

Matt
Posts: 360
Joined: Fri May 02, 2008 11:56 am
Organization: Pramari

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by Matt » Fri Apr 06, 2018 6:34 pm

Hi Guys,

Thanks for letting us know about this. I'll try to look into this issue this weekend and see if I can figure out what is going on.

Thanks!
-Matt

RS123
Posts: 9
Joined: Wed Nov 29, 2017 4:17 pm

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by RS123 » Thu May 31, 2018 9:53 am

Hi Matt, were you able to look into the RSSI Monitoring Service concerning the issues I ran into back in early April?

Matt
Posts: 360
Joined: Fri May 02, 2008 11:56 am
Organization: Pramari

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by Matt » Tue Jun 05, 2018 1:08 am

RS123 wrote:
Thu May 31, 2018 9:53 am
Hi Matt, were you able to look into the RSSI Monitoring Service concerning the issues I ran into back in early April?
Hi RS123,

Sorry about not getting back to you sooner -- setting up an environment to test the RSSI service is time consuming, and I ended up pulled in to some other things before I could finish. I do think I solved the issue, though.

One problem was that the LLRP values were getting converted to a string before they were added to the extrainformation hashmap. While this was fine if you just wanted to read the value at the other end, it turns out that esper will not do any math on any values fed into it in that way.

The other issue was the fact that the RSSI service does not work with negative numbers, as speculated in this thread. I don't know why they don't work -- eyeballing the esper I don't see why the operations used wouldn't work just as well on negative values as positive ones, but the easy fix was to simply add an offset to every RSSI value.

LLRP RSSI values can be -128 to 127, so I simply added 128 to the RSSI to make every possible value positive. If you want the "true" RSSI value on the subscriber end, you can simply subtract the value (stored in

Code: Select all

LLRPConstants.RSSI_OFFSET
).

Test jar is attached -- just drop it in and overwrite your current jar.
Attachments
org.rifidi.edge.adapter.llrp_2.4.5.jar.7z
Trial fix for LLRP RSSI
(70.8 KiB) Downloaded 5 times

RS123
Posts: 9
Joined: Wed Nov 29, 2017 4:17 pm

Re: Not able to get the RSSI Monitoring Service to work in Rifidi Version 3.7.0

Post by RS123 » Wed Jun 20, 2018 9:44 am

Our team tried out the new jar file, but the events for RSSI did not fire.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests