Yes, you can use this to open a named socket which an other application can connect to and send commands that your Lua script will act upon. I’ll use the event_loop.lua script as example here.
On linux you can send things to it by using netcat for example.
nc -U /tmp/com.qoitech.otiicli
Then you can write commands, for example ‘on’ and ‘start’. Please note that you need to terminate the command with an EOF signal and not a newline. On linux you can produce a EOF by pressing CTRL+D.
In python you use the socket module.
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
This will send ‘start’ to the Lua script.
I know this is possible to do on Windows as well. On a recent windows 10 you should have AF_UNIX support according to this article by Microsoft.
Before that it might be named pipes that are used. You can read more about that here. I’ll try to get a confirmation from someone in the team that knows windows better than me on Monday.
Hope this helps, and don’t hesitate to ask additional questions.