I have a program that controls GPIO pins from a web page. The web page will also open a data file and update the status of the GPIO pins In order for this status to be up to date, the webpage automatically reloads every 3 seconds.
The problem I am having is due to the GPIO control using @app.route("/<devicename>/<action>"). Because of this, when the page is reloaded after a GPIO is turned on, it will reload and turn it on again.
Is there a better way to control GPIO pins from a web page? and if not how do I solve this problem?