firefly.server.spawnFireflyServer(port=5500, method='flask', directory=None, frames_per_second=30, decimation_factor=1, max_time=10, multiple_rooms=False)[source]
Starts a Firefly server as a background process. Close the server by calling


  • port (int, optional) – port number to serve the .html files on, defaults to 5500

  • method (str, optional) – what sort of Firefly server to open, a Flask (“flask”) server or an HTTP (“http”), defaults to “flask”

  • directory (str, optional) – the directory of the Firefly source files to be served, if None, uses os.dirname(__file__) i.e. the directory of the firefly python distribution, defaults to None

  • frames_per_second (int, optional) – enforced FPS for stream quality, used only if localhost:<port>/stream is accessed, defaults to 30

  • decimation_factor (int, optional) – factor to decimate data that is being passed through localhost:<port>/data_input, defaults to 1

  • max_time – maximum amount of time to wait for a Firefly server to be available.



Return type

subprocess handler


RuntimeError – if max_time elapses without a successful Firefly server being initialized.