Logic Machine Forum
LM App for Home Kit - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: LM App for Home Kit (/showthread.php?tid=1751)



LM App for Home Kit - Bitver - 27.11.2018

Hello,
I've successfully compiled HAPĀ for LM and want to distribute it with configurator and daemon like Alexa app.
Configurator would be written in lua, but HAP is binary file with server inside. How can I run binary file as LM App daemon?


RE: LM App for Home Kit - admin - 27.11.2018

You can add os.execute(...) to daemon.lua which will execute your binary.


RE: LM App for Home Kit - Bitver - 22.12.2018

(27.11.2018, 12:38)admin Wrote: You can add os.execute(...) to daemon.lua which will execute your binary.

I think it tries to launch app every moment in a loop.
Load averages: 2.20 0.92 0.36


RE: LM App for Home Kit - admin - 22.12.2018

This can happen if your app is either executed in background (via & at the end of the command) or daemonizes itself. Can you run your app in foreground? This way os.execute will wait until app finishes execution and only then it will be started again. This is useful if you experience crashes for some reason.


RE: LM App for Home Kit - Bitver - 30.01.2019

(27.11.2018, 12:38)admin Wrote: You can add os.execute(...) to daemon.lua which will execute your binary.

It didn't work until I gave 0777 file permission using os.execute('chmod...').
It's very difficult to debug app on LM without ssh access.