RFID access controller Z-5R WEB Json (ironlogic.ru) - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10) +--- Thread: RFID access controller Z-5R WEB Json (ironlogic.ru) (/showthread.php?tid=2712) |
RFID access controller Z-5R WEB Json (ironlogic.ru) - merel - 07.07.2020 Good day, I'm trying to integrate "Z-5R WEB" using JSON communication but I'm having trouble. The LUA script must support multiple connection and must be a server, "Z-5R WEB" will open connection to the LM periodically sends the following: Code: POST / HTTP / 1.1 The server on LogicMachine must respond this: Code: HTTP/1.0 200 OK I don't know how to send an answer. My test script: Code: data=[[HTTP/1.0 200 OK Please Help, Borek RE: RFID access controller Z-5R WEB Json (ironlogic.ru) - admin - 07.07.2020 You don't need a script to create a web server, you can use LM web server's .lp scripts for this task. 1. Disable password access to User directory in User access settings. 2. Upload the example as rfid.lp using FTP apps login into user directory. You can check if the file can be accessed by opening http://LM_IP/user/rfid.lp, you should see a blank page but not a 404 error. 3. In your RFID reader set HTTP notification port to 80 and path to /user/rfid.lp This example is only a starting point, you need to modify it to check the requested function type and provide a correct response depending on the request. If request is a valid JSON it will be visible in Logs tab in LM. Code: <? Apps documentation: https://forum.logicmachine.net/showthread.php?tid=85 RE: RFID access controller Z-5R WEB Json (ironlogic.ru) - merel - 23.07.2020 (07.07.2020, 07:13)admin Wrote: You don't need a script to create a web server, you can use LM web server's .lp scripts for this task. Thank you very much, it was very helpful. The solution using the application is much easier. |