Author Topic: Is it possible to call another program from an AM plugin?  (Read 320 times)

MV19

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Is it possible to call another program from an AM plugin?
« on: December 17, 2020, 01:23:52 AM »
Hi. I'm using LEDSpicer to light up my LEDs but I can't for the life of me figure out how to tell it to restart the set of animations I've given it. The author seems to have gone cold on the the net atm, so I'm stumped. I thought I could create an animation set that would last for 2 minutes and then get an AM plugin to restart the profile that LEDSpicer uses to play those animations. I know how to wait a certain amount of time in the plugin and I know how to get it to randomly decide if it should restart the profile. My problem is how to actually call the program from in the plugin.

The command line to restart the profile is

Code: [Select]
LoadProfile ProfileName
This is the code I have so far, it runs every 20 minutes. Is it even possible to do with with a plugin in AM? I'm on a RASPBERRY PI 4 BTW with Raspbian.

Code: [Select]
restartPlugin = randInt(10);

if (restartPlugin < 2)
{
 // Use LoadProfile command line command to restart the profile
}

Cheers.
« Last Edit: December 17, 2020, 01:28:15 AM by MV19 »

alucard

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Is it possible to call another program from an AM plugin?
« Reply #1 on: March 02, 2021, 03:04:04 AM »
Hi,

have you tried fe.plugin_command function?

Code: [Select]
fe.plugin_command( executable, arg_string )
fe.plugin_command( executable, arg_string, environment, callback_function )
fe.plugin_command( executable, arg_string, callback_function )

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 245
    • View Profile
    • Github Repositories
Re: Is it possible to call another program from an AM plugin?
« Reply #2 on: March 02, 2021, 06:18:11 AM »
https://github.com/mahuti/Emitter-Plugin

Take a look at that plug-in. You can find similar examples of what you  want to do in it.

Also, I think Patricio is visiting his family in Argentina right now. Might be more active when he returns.