is somebody who can help me with SPZ reading from Hanwha camera with OKnumber plugin to LogicMachine?
OKnumber plugin have JSON option to set, but i don´t know how to make it working.
This can be done via .lp server-side scripting as described in docs here: https://forum.logicmachine.net/showthread.php?tid=85
By default all .lp script in user/ directory are password-protected. You can try using http://user:password@ip/user/... URL format in your camera. If this does not work then disable "Enable password for User directory" in "User access settings" and use plain http://ip/user/... URL.
(09.01.2023, 13:06)admin Wrote: This can be done via .lp server-side scripting as described in docs here: https://forum.logicmachine.net/showthread.php?tid=85
By default all .lp script in user/ directory are password-protected. You can try using http://user:password@ip/user/... URL format in your camera. If this does not work then disable "Enable password for User directory" in "User access settings" and use plain http://ip/user/... URL.
this is actual IP and login to the plugin OKnumber
You need to use "JSON over HTTP(s)" mode so the camera sends event to LM with HTTP requests. Then a server-side .lp script on LM handles the event data.
(09.01.2023, 13:32)admin Wrote: You need to use "JSON over HTTP(s)" mode so the camera sends event to LM with HTTP requests. Then a server-side .lp script on LM handles the event data.
Thank for Your answer. I set JSON on camera to LM IP adress, but I dont know where must be .lp script located and how the script have to look like.
Sorry Im beginner with LM, but I like many functions and options that LM have.
.lp scripts are uploaded using FTP. Use apps username, enable FTP and set password in System config > Services > FTP server.
Try this test script. It will show request body contents in LM Logs tab for each request that is sent to LM.
Code:
1234
<?
require('apps')
body = ngx.req.get_body_data()
log(body)
(10.01.2023, 10:34)admin Wrote: .lp scripts are uploaded using FTP. Use apps username, enable FTP and set password in System config > Services > FTP server.
Try this test script. It will show request body contents in LM Logs tab for each request that is sent to LM.
Code:
1234
<?
require('apps')
body = ngx.req.get_body_data()
log(body)
I turn ON FTP, but is an Error in script :
Chyba syntaxe Lua na řádce 2: unexpected symbol near '<'
(11.01.2023, 12:15)admin Wrote: You need to create .lp file using a text editor on your computer and upload it via FTP. You cannot create .lp scripts from LM scripting tab.
16.01.2023, 15:24 (This post was last modified: 16.01.2023, 15:30 by 2MAX.)
(16.01.2023, 12:00)admin Wrote: Nothing is logged for some reason. Modify the .lp script like this and post what you get in Logs tab:
Code:
1234567
<?
require('apps')
body = ngx.req.get_body_data()
log(ngx.var.request_method)
log(ngx.var.content_length)
log(body)
(16.01.2023, 12:00)admin Wrote: Nothing is logged for some reason. Modify the .lp script like this and post what you get in Logs tab:
Code:
1234567
<?
require('apps')
body = ngx.req.get_body_data()
log(ngx.var.request_method)
log(ngx.var.content_length)
log(body)
This is repor from camera
2023-01-16 16:00:02 (GMT 1),2BZ8720,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:29:49 (GMT 1),RAP7,CYP,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:29:03 (GMT 1),8C49828,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:28:45 (GMT 1),8C49828,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:28:39 (GMT 1),8C49828,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:28:36 (GMT 1),8C49828,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:28:26 (GMT 1),8C49828,CZE,Not in list,Sent to NVR Save to SD,Down
2023-01-16 14:19:43 (GMT 1),1BP1912,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:07:36 (GMT 1),P0LICIE,POL,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 14:02:52 (GMT 1),A30SIZ,AUT,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:38:48 (GMT 1),P0LICIE,POL,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:31:17 (GMT 1),58O0100999,No Country,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:27:53 (GMT 1),0nVO,No Country,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:25:15 (GMT 1),P0LICIE,POL,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:14:17 (GMT 1),77770666,ISR,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:14:12 (GMT 1),77770666,ISR,Not in list,Sent to NVR Save to SD,Down
2023-01-16 13:14:07 (GMT 1),77770666,ISR,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 13:14:05 (GMT 1),3AL6689,CZE,Not in list,Sent to NVR Save to SD,Unknown
2023-01-16 12:53:21 (GMT 1),3AL6689,CZE,Not in list,Sent to NVR Save to SD,Unknown