Here’s the way I debug plugins:
- Copy the Python code (usually in a
__init__.py) to a new file in~/.pioreactor/plugins/. Example:nano .pioreactor/plugins/spec.py - So long as the python has
clickcode at the bottom, something like:
you can run it manually with@click.command(name="spectrometer_reading") def click_spectrometer_reading() -> None: ...pio run spectrometer_reading. Python code in the~/.pioreactor/pluginsfolder will overwrite any other installed plugins, so you don’t need to worry about existing plugins installed via the UI interferring. - I like to put lots of
printorself.logger.debugstatements my code during debugging so I can see outputs while running. - When you’re happy, you should remove the plugin (or keep it to continue using it) with
rm ~/.pioreactor/plugins/spec.py.