QRCODE reading and event triggering #222
-
I have an AXIS P1468-LE Bullet Camera with a barcode and QRcode reading license. I have also set up a rule to detect barcodes. This is working as it should to hit a custom HTTP endpoint. The issue I am having is I can not send the barcode or QR code data to the endpoint. I attempted to send the barcode or qrcode just like the dynamic overlay with the #D but it does not work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Ty, I do not think it is possible to send the event data in the POST actions, I am not 100% sure so it would be great if someone from Axis could confirm or correct @shadysp. There are a few ways I can think of to get the data you want: Use the RTSP event streamAll event info is streamable over RTSP, e.g. from the bar-code reader you will get:
Where in particular you are interested in the data field:
The problem with this is that you need to have network access to the camera. Use MQTTYou can push the events using the MQTT client in the camera. This is an example of the QR event being published to a MQTT broker:
Create a custom ACAP for event pushIt would be easy to create a stand-alone ACAP that subscribes to the events and pushed them to an HTTP/HTTPS server. We have templates for event consumer ACAPs and precompiled libraries for cURL and OpenSSL, you can find more info at https://fixedit.ai. In your situation this might be the best option. The downside is that you need to install two different ACAPs but on the other hand you will get exactly the kind of integration you want to have. We can assist you or provide the implementation for you. I'll send you an email with more info if you want to go forward with this. For reference, the code to subscribe to the QR code event would be like this: AXEventKeyValueSet *key_value_set = ax_event_key_value_set_new();
if (!ax_event_key_value_set_add_key_values(
key_value_set, NULL,
"topic0", "tnsaxis", "CameraApplicationPlatform", AX_VALUE_TYPE_STRING,
"topic1", "tnsaxis", "BarcodeReader", AX_VALUE_TYPE_STRING,
"topic2", "tnsaxis", "BarcodeFound", AX_VALUE_TYPE_STRING,
"data", NULL, NULL, AX_VALUE_TYPE_STRING,
error)) {
....
}
...
if (!ax_event_key_value_set_get_string(key_value_set, "data",
NULL /* namespace */, &qr_code, &error)) {
...
}
fapp_logger_log(LOG_INFO, "Event received: qr_code=%s", qr_code);
g_free(qr_code); |
Beta Was this translation helpful? Give feedback.
Hi Ty,
I do not think it is possible to send the event data in the POST actions, I am not 100% sure so it would be great if someone from Axis could confirm or correct @shadysp. There are a few ways I can think of to get the data you want:
Use the RTSP event stream
All event info is streamable over RTSP, e.g. from the bar-code reader you will get: