Skip to content

Replace Server-to-Client WebSocket Connection #85

@Conr86

Description

@Conr86

Is your feature request related to a problem? Please describe.
The SIGHTS server currently consists of a far from ideal manager script, main.py which runs two parallel processes (the sensor stream and the control receiver) with very little intercommunication. It's a hacky solution that I wouldn't mind replacing.

We are also quite dependent of Apache as a web server, which isn't inherently a problem, but I'd like to reevaluate it's necessity (along with all other external packages), in an effort to minimize SIGHTS' footprint and complexity.

Describe the solution you'd like
Replace the web server with a Flask-based (or similar) Python web app. A WebSocket connection can still be used for Client to Server communication (e.g. controls) but sensor data, logs, etc. will be done through the new web app server.

Why?

  • Modular updating of sensor data, no longer dependent on the WebSocket
  • No more serialization of sensor data as JSON! This means images and videos can now potentially be sent as sensor data.
  • Much easier to serve different pages, etc. at different URLs thanks to Flask's powerful routing options.
    • Potentially integrated reverse proxy, meaning we might be able to replace Apache entirely and stay within the Python ecosystem.
  • Only one Python process will be run, and communication between the sensor stream and control receiver will be possible.
  • Should make Replace Motion with an integrated camera streaming solution #84 much easier to implement.

Additional context
Additionally, there are plans to make a 'watch' page for SIGHTS. The changes detailed above will, I believe, make this a much easier to implement.

I've marked this as a question, as it is just a proposal for now. Keen to discuss how to best approach this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions