temper-python icon indicating copy to clipboard operation
temper-python copied to clipboard

Add an HTTP server that outputs the same as the CLI interface

Open daviessm opened this issue 4 years ago • 5 comments

This pull request contains an HTTP server called httpserver.py which acts exactly like cli.py but will serve HTTP requests on a specified port and respond with the current data. It holds a connection to any USB devices rather than re-opening them each time.

daviessm avatar May 02 '20 14:05 daviessm

@daviessm Just curious, would using the http server block cli access, is this a one or the other choice? Thanks

rdica avatar May 04 '20 13:05 rdica

@rdica It's one or the other. The HTTP server will take a connection to the device(s) and hold on to them.

The reason for this is that in my setup the devices regularly fall off the bus if more than one application tries to access them at once: I can now push them all through the single HTTP server.

daviessm avatar May 04 '20 13:05 daviessm

If you don't want exclusive use, then invoke the cli command from within a python program with a http server of some flavour.

I've been doing exactly that for the last 5 years using a flask microservice for temper USBs all around the place.

StatusCode404 avatar Aug 22 '21 21:08 StatusCode404

My feeling on this is that webserver functionality should be separate.

Since this is package is available on pypi, it can be imported and used however someone wants, potentially as a new project temper-python-webserver.

I think there are many people who will use this and don't want a webserver. Why give all those people the overhead/security risks?

davet2001 avatar Dec 16 '21 12:12 davet2001

I agree with @davet2001 .

padelt avatar Dec 16 '21 17:12 padelt