Logic Machine Forum
SPZ number/LM - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: SPZ number/LM (/showthread.php?tid=4483)

Pages: 1 2


SPZ number/LM - 2MAX - 09.01.2023

Hi,

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.


RE: SPZ number/LM - admin - 09.01.2023

Do you have any documentation for it?


RE: SPZ number/LM - 2MAX - 09.01.2023

(09.01.2023, 12:57)admin Wrote: Do you have any documentation for it?

https://sites.google.com/ff-group.org/hanwha 

this send manufacturer to me


RE: SPZ number/LM - admin - 09.01.2023

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.


RE: SPZ number/LM - 2MAX - 09.01.2023

(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

http"//192.168.1.11:10017/home/setup/opensdk/html/NumberOkEdgeHanwha/

user admin a password admin

Im working with LM just few months and I read manual but I don´t know how work wiht this scripting yet, can ou help me?


RE: SPZ number/LM - admin - 09.01.2023

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.


RE: SPZ number/LM - 2MAX - 09.01.2023

(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.


RE: SPZ number/LM - admin - 10.01.2023

.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:
<?
require('apps')
body = ngx.req.get_body_data()
log(body)



RE: SPZ number/LM - 2MAX - 11.01.2023

(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:
<?
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 '<'


RE: SPZ number/LM - admin - 11.01.2023

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.


RE: SPZ number/LM - 2MAX - 11.01.2023

(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.

In which folder .lp to copy?


RE: SPZ number/LM - admin - 11.01.2023

user directory


RE: SPZ number/LM - 2MAX - 11.01.2023

(11.01.2023, 12:49)admin Wrote: user directory

ok, its done


RE: SPZ number/LM - 2MAX - 13.01.2023

Hi, what is the next step pls?


RE: SPZ number/LM - Daniel - 13.01.2023

Read this again
https://forum.logicmachine.net/showthread.php?tid=4483&pid=28956#pid28956


RE: SPZ number/LM - admin - 13.01.2023

Set correct URL in your camera so it executes the .lp script. Then post what you get in LM Logs tab.


RE: SPZ number/LM - 2MAX - 16.01.2023

(13.01.2023, 09:26)admin Wrote: Set correct URL in your camera so it executes the .lp script. Then post what you get in LM Logs tab.

I send you screen of log when is the registration number on camera detect.


RE: SPZ number/LM - admin - 16.01.2023

Nothing is logged for some reason. Modify the .lp script like this and post what you get in Logs tab:
Code:
<?

require('apps')
body = ngx.req.get_body_data()
log(ngx.var.request_method)
log(ngx.var.content_length)
log(body)



RE: SPZ number/LM - 2MAX - 16.01.2023

(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:
<?

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:
<?

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


RE: SPZ number/LM - admin - 17.01.2023

Try this and post what you get in Logs:
Code:
<?

require('apps')
vars = getvars()
log(vars)