Start script from external trigger?

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
richbandit
Posts: 1
Joined: Wed Sep 24, 2025 9:23 am

Start script from external trigger?

#1

Post by richbandit »

A script programming newbie here, so would gratefully accept any thoughts how this may be achieved before I delve any deeper into Python, etc.

Can a script be started by means of a trigger from an external hardware device (e.g. output from Arduino? Simpler method? By reading USB I presume - or any other method?), and then how to do it?

Excuse me if this has been answered before, I've seen a couple of similar posts on this forum but nothing fully conclusive - I could well have missed an obvious solution of course!

Many thanks!
User avatar
admin
Site Admin
Posts: 17474
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Start script from external trigger?

#2

Post by admin »

Hi,

there is no real way to start a script in an already running version of SharpCap based on some sort of external event. The thing to do would be to have the script already running in SharpCap and waiting for the event to happen before it springs into life to do whatever is required. There are options to run scripts at SharpCap startup (via the 'Startup Scripts' part of the settings, or the /runscript command line option).

One way to deal with the 'waiting for the event' part is to have the script running inside SharpCap just check for a file existing every few seconds and then act when the file appears. More sophisticated options that people have implemented include running a python remoting package called 'Pyro' inside SharpCap or even a web server running in the python scripting.

Hope that gives you some ideas,

Robin
Post Reply