Simple HTTP Service
This is available on AdvanNet-2.5.6-32 or higher
Description
This service allows sending inventory or event data from the reader to an HTTP service either in XML or JSON format.
The options in this service are purposely constrained to offer a more streamlined experience. If the way this service sends the data doesn't work for you, use the regular HTTP Service
Options
Enabled: check this option to enable the service, otherwise it won't send anything.
Endpoint URL: put the full URL of your endpoint
Username: The username for your server. Only Basic Authentication is supported.
Password: The password for your server. Only Basic Authentication is supported.
HTTP Method: The HTTP method to send the data, PUT and POST are supported
Content-Type: both the format that will have the output data and the value of the Content-Type HTTP header.
Inventory Fields: Which data field of the inventory do you want sent? Uncheck all fields to disable the inventory data upload.
Events: From which events do you want to receive a message? All events have the same data structure.
Send options
The send options are:
Send one by one: options are
true: in case of TAG_READ, it sends each reads in a different request
false: in case of TAG_READ, may send several reads in the same request
Tag TTL: there is a timer (TTL) for every unique EPC to filter repetitions of the same EPCs. It works as follows:
The first time an EPC is read, i) the EPC is sent out and ii) a timer starts.
Any other read of the same EPC before the time reaches TTL time is discarded.
New reads after the TTL time will be sent out, and the cycle starts over. Note reads that happen before the timer reaches TTL are not enqueued, will never be sent out.
Testing
To test this service you can use a service of HTTP request inspection such as https://requestbin.com/ or your own HTTP server. In the Downloads section you can download a simple python script that serves as HTTP server that prints all data received.
Options overview
Examples
Event in JSON
{
"type": "TAG_ALARM",
"subtype": "EPC_EAS",
"devid": "AdvanReader-m4-160-feb0",
"devip": "192.168.0.71",
"devmac": "04:79:b7:d2:fe:b0",
"epc": "303612345678901234567890",
"sku": "68686869477449",
"serial": "78187493520",
"uri": "urn:epc:tag:sgtin-96:1.8686869.647744.78187493520",
"devstatus": "ALIVE",
"alarms": ["ADVANNET_ERROR=SIMPLE_HTTP_SERVICE. Server test. IO exception (Connect to 192.168.0.25:8888 [/192.168.0.25] failed: Connection refused (Connection refused)) URL: http 192.168.0.25 8888Please make sure the remote service[http,192.168.0.25,8888] is enabled. This alarm will be automatically disabled in 60 minutes"]
}
Event in XML
<event>
<type>TAG_ALARM</type>
<subtype>EPC_EAS</subtype>
<devid>AdvanReader-m4-160-feb0</devid>
<devip>192.168.0.71</devip>
<devmac>04:79:b7:d2:fe:b0</devmac>
<epc>303612345678901234567890</epc>
<sku>68686869477449</sku>
<serial>78187493520</serial>
<uri>urn:epc:tag:sgtin-96:1.8686869.647744.78187493520</uri>
<devstatus>ALIVE</devstatus>
<alarms>["ADVANNET_ERROR=SIMPLE_HTTP_SERVICE. Server test. IO exception (Connect to 192.168.0.25:8888 [/192.168.0.25] failed: Connection refused (Connection refused)) URL: http 192.168.0.25 8888Please make sure the remote service[http,192.168.0.25,8888] is enabled. This alarm will be automatically disabled in 60 minutes"]</alarms>
</event>
Inventory in JSON
{
"devmac": "04:79:b7:d2:fe:b0",
"devip": "192.168.0.71",
"devid": "AdvanReader-m4-160-feb0",
"reads": [{
"rssi": "-24",
"serial": "-1",
"epc": "0039ecbc029fdac12a060224",
"sku": "",
"uri": "",
"ts": "1657710238295",
"tid": "",
"antenna": "1"
}, {
"rssi": "-44",
"serial": "-1",
"epc": "bcd50ff6107a4ca82fca8cea",
"sku": "",
"uri": "",
"ts": "1657710238301",
"tid": "",
"antenna": "1"
}, {
"rssi": "-46",
"serial": "274451114581",
"epc": "303602c444076c7fe68faa55",
"sku": "08433937076015",
"uri": "urn:epc:tag:sgtin-96:1.8433937.007601.274451114581",
"ts": "1657710238313",
"tid": "",
"antenna": "1"
}, {
"rssi": "-40",
"serial": "-1",
"epc": "bcbc133605800d92a978b2d2",
"sku": "",
"uri": "",
"ts": "1657710238317",
"tid": "",
"antenna": "1"
}]
}
Inventory in XML
<inventory>
<devmac>04:79:b7:d2:fe:b0</devmac>
<devip>192.168.0.71</devip>
<devid>AdvanReader-m4-160-feb0</devid>
<items>
<item>
<rssi>-24</rssi>
<serial>-1</serial>
<epc>0039ecbc029fdac12a060224</epc>
<sku></sku>
<uri></uri>
<ts>1657710195859</ts>
<tid></tid>
<antenna>1</antenna>
</item>
<item>
<rssi>-43</rssi>
<serial>-1</serial>
<epc>bcd50ff6107a4ca82fca8cea</epc>
<sku></sku>
<uri></uri>
<ts>1657710195862</ts>
<tid></tid>
<antenna>1</antenna>
</item>
<item>
<rssi>-41</rssi>
<serial>-1</serial>
<epc>bcbc133605800d92a978b2d2</epc>
<sku></sku>
<uri></uri>
<ts>1657710195863</ts>
<tid></tid>
<antenna>1</antenna>
</item>
</items>
</inventory>
FAQ
Is this service resilient to internet outages?
Indeed, requests are cached if cannot be sent due to a timeout to the server. They are not cached if the server fails however. If you want requests to be resent after the server fails please add {"reQueueMismatchedRequests":true} to the Advanced JSON config field.
What is ts?
Unix Timestamp in milliseconds (milliseconds since January 1, 1970 00:00:00.000 UTC)
How can I...?
Use the regular HTTP Service.