Start and stop plugin from the API

Hi !

I want to control the Theta V streaming from a python script.
So far here is what I can do :

  • show which plugin is “active” (camera._lisPlugins)
  • activate RTMP plugin (camera._setPlugin)
  • start the active plugin (camera._pluginControl, option=boot)
  • stop the active plugin (camera._pluginControl, option=finish)
    So far, so good !

Then I restart the active plugin (camera._pluginControl, option=boot) and start to actually stream (with the web page of the plugin). After a moment, I stop the streaming.
After that point, I have a 404 error whenever I try to execute a command (commands/execute)

The only solution is to stop the plugin by pressing the MODE button.

Any idea ?

My code is here : https://gitlab.com/denisbg/theta-v/blob/master/theta_plugin.py

Thnaks in advance for your help !

Just to confirm, when you use the API to stop the plug-in, you can no longer access the web API?

However, when you stop the plug-in from the “mode” button, you can access the web API?

If so, can you start and stop other plug-ins with the API?

Here is the workflow :

  • API (POST osc/commands/execute…) : start plugin OK (led turns white)
  • API : stop plugin OK (led turns blue)

But :

  • API : start plugin OK (led turn white)
  • WEB or Shutter button : start streaming (led blinking red)
  • WEB or shutter button : stop streaming (led stops blinking red)
  • API : stop plugin Not OK, error 404

At this point, I can get information (GET osc/info) or state (POST osc/state).
But I can’t execute any command (POST osc/commands/execute). I always have a 404 error.
So I can’t start/stop other plugins.

If I stop the plugin with the MODE button, I can access POST osc/commands/execute

As a test, can you try and stop a simpler plug-in with the API? For example, Time Shift Shooting?

I have not tried the API yet.

I was just thinking that while the plug-in is running, I don’t think you can access the webAPI from an external computer, like a laptop running the Python script.