AdvanNet can be configured to consult a database to see if a product has been paid or not and trigger an alarm. In this example, we useMySQL.
Any SQL database with an existing Java driver should work. Amongst the known working SQL engines are: PostgeSQL, MicrosoftSQL, HyperSQL, Oracle, etc.
Install MySQL.
Create a new Schema, for example, alarms.
Once the schema is created, there has to be one table named sale_info with at least two columns: EPC and paid (0: Not paid, 1: Paid)
It should have, at least, one entry, for example:
INSERT INTO `advannet`.`sale_info` (`epc`, `paid`) VALUES ('14270e4714270e4714270e47', 1);
Add the MySQL connector to the $ADVANNET/lib folder, download it from here.
Change to a Alarm mode configuration.
Go to the RF & Antenna Configuration tab.
Set Read mode to SQL_EAS_ALARM.
Java driver class:
MySQL: com.mysql.jdbc.Driver
MSSQL: net.sourceforge.jtds.jdbc.Driver
PostgreSQL: org.postgresql.Driver
Connection string:
MySQL: jdbc:mysql://<ip_or_hostname>/<Schema>
e.g. jdbc:mysql://localhost/alarms
MSSQL: jdbc:jtds:sqlserver://<ip_or_hostname>:1433/<Schema>
PostgreSQL: jdbc:postgresql://<ip_or_hostname>:5432/<Schema>
DB username: The username that was configured in the connection on the SQL database.
DB password: The password that was configured for the connection to the SQL database.
Alarm query: select paid from sale_info where (epc=${epc} and paid=0)
It depends on the columns created and the table name.
The ${epc} is the epc read by AdvanReader.
An EPC will trigger an alarm if the query produces records from the database,
However, if the Invert query result option is checked, the system will trigger the alarm only if no records are received
Apply the configuration by clicking the Apply Config button.
Go to the Events & Actions tab.
Configure an event for a Tag Alarm by clicking on the Update action button.
The alarm can be a buzzer action:
The alarm can be also a GPO action:
If using an AdvanSafe-300, from AdvanNet 2.10.31+ version, it is also possible to access AdvanView tab in order to configure the device:
The options available are:
Enhance logic with AdvanView: Enables / disables the use of the AdvanView for alarm detection.
AdvanView mode: Select the AdvanView mode. The more restrictive, the more false alarms will be prevented, but there might be some performance impact.
Restrictive: An alarm is considered only if the same object has both entered and exited the area. This mode is highly restrictive and generally not recommended due to reliability concerns.
Medium: An alarm is considered if there has been either an entry into the area or an exit from it. Only one of these is needed to activate the filter.
Less-restrictive: An alarm is considered only if there has been a recent movement into the area.
Time window: Time window between AdvanView events.
For AdvanNet to work with any SQL database, it needs a java library, please install the following upgrade package:
following the instructions on Install Update Package Procedure page
If your database of choice uses a driver not installed in the package above, please follow the instructions below to upload the desired library to the device:
To be able to upload a new library to a Keonn reader/system, SSH credentials are needed. For that, please follow this wiki section.
Once the SSH credentials are obtained:
Use an SFTP program like FileZilla, WinSCP or other and connect to the device.
Upload the desired library into the folder: /home/keonn/kernel/module/app.AdvanNet/lib
Reboot the device.
After the reboot, AdvanNet will have loaded the new library and will be ready to use it.