This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

SPZ number/LM
#1
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.
Reply
#2
Do you have any documentation for it?
Reply
#3
(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
Reply
#4
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.
Reply
#5
(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?
Reply
#6
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.
Reply
#7
(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.
Reply
#8
.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)
Reply
#9
(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 '<'
Reply
#10
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.
Reply
#11
(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?
Reply
#12
user directory
Reply
#13
(11.01.2023, 12:49)admin Wrote: user directory

ok, its done
Reply
#14
Hi, what is the next step pls?
Reply
#15
Read this again
https://forum.logicmachine.net/showthrea...6#pid28956
------------------------------
Ctrl+F5
Reply
#16
Set correct URL in your camera so it executes the .lp script. Then post what you get in LM Logs tab.
Reply
#17
(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.

Attached Files Thumbnail(s)
   
Reply
#18
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)
Reply
#19
(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

Attached Files Thumbnail(s)
   
Reply
#20
Try this and post what you get in Logs:
Code:
<?

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


Forum Jump: