Jump to content
C4 Forums | Control4

Running a Lua script upon reboot


eggzlot

Recommended Posts

Is there a way to run a Lua script for a drive upon reboot automatically?  My 2n Helios doorstation needs a Lua script ran to talk to C4.  So anytime I reboot my c4 (manually or I lose power) I need to remember to launch Composer HE and execute the script.  Is there a way to do this automatically?

If not, maybe I should just have C4 send me a text every time it boot ups and the subject line would be a reminder to do the Lua script in HE?

Link to comment
Share on other sites


59 minutes ago, Dunamivora said:

Build it into the driver? Or request the dev to add it?

Is it a script specific to your system?

no - it is for the 2n Helios VideoKit.  I believe its a C4 driver and its a known bug that you need to run the Lua upon reboot.

  1. Log into the project with Composer Pro.
  2. Click on the 2N doorstation driver, then click on Lua.
  3. Paste the line below in the Lua Command window then click Execute.
    helios_ip_eventlogstart()
  4. Contact/relay programming should begin working almost immediately.

Refer to KB 2315 for full instructions to set up a 2N doorstation to work in a Control4 system

Link to comment
Share on other sites

Oh, now that is stupid.

If it's a known requirement it should have been put directly into the driver. Driver's have events where they can run scripts during different parts of the project load/boot up process.

There is no way that I know of to run a lua script automatically on a driver without it being called by the driver's own lua code for those specific events.

Since there is a KB on the issue, you may be stuck with an email or text reminder unless you change to a better supported door station.

Link to comment
Share on other sites

1 minute ago, Dunamivora said:

Oh, now that is stupid.

If it's a known requirement it should have been put directly into the driver. Driver's have events where they can run scripts during different parts of the project load/boot up process.

There is no way that I know of to run a lua script automatically on a driver without it being called by the driver's own lua code for those specific events.

Since there is a KB on the issue, you may be stuck with an email or text reminder unless you change to a better supported door station.

ok thanks.  Maybe I'll ask my dealer to nudge tech support or something to write that line into the code as you mention.  For now I'll just send myself a text reminder

Link to comment
Share on other sites

4 hours ago, eggzlot said:

Is there a way to run a Lua script for a drive upon reboot automatically?  My 2n Helios doorstation needs a Lua script ran to talk to C4.  So anytime I reboot my c4 (manually or I lose power) I need to remember to launch Composer HE and execute the script.  Is there a way to do this automatically?

If not, maybe I should just have C4 send me a text every time it boot ups and the subject line would be a reminder to do the Lua script in HE?

Completely not supported and I will probably get roasted for this, why not ssh into the controller and add a script to the controller to do exactly that? 

Link to comment
Share on other sites

3 hours ago, ILoveControl said:

Completely not supported and I will probably get roasted for this, why not ssh into the controller and add a script to the controller to do exactly that? 

The Lua script needs to be run *within the driver*, not as a command-line on the controller, so this wouldn't do it.

The proper way is to get the driver fixed.

RyanE

Link to comment
Share on other sites

20 minutes ago, RyanE said:

The Lua script needs to be run *within the driver*, not as a command-line on the controller, so this wouldn't do it.

The proper way is to get the driver fixed.

RyanE

I believe it’s a c4 driver?  Have dealer ask support?  I mean the KB article points it out so if c4 is the author I guess they are aware?

Link to comment
Share on other sites

On 8/23/2019 at 10:20 AM, eggzlot said:

ok thanks.  Maybe I'll ask my dealer to nudge tech support or something to write that line into the code as you mention.  For now I'll just send myself a text reminder

Isn’t 2N the company that makes the official C4 doorstation? 😂

Link to comment
Share on other sites

54 minutes ago, ILoveC4 said:

For some reason that makes this even more ridiculous to me.

I agree especially if not needed for the ds2. I’d have to assume the firmware is 80% the same and the big differences may just be the UI rebranded for C4.  That is why I thought I’d ask 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.