From 8168ec997b16c97014341205aade64b63b0c484b Mon Sep 17 00:00:00 2001 From: FluffyCube9343 Date: Sun, 13 Nov 2022 21:06:10 -0500 Subject: [PATCH] if(pi_notfound){don't lag;} --- app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.py b/app.py index e8e3467..633516c 100644 --- a/app.py +++ b/app.py @@ -27,6 +27,7 @@ def sendData(): s=socket.socket() host="raspberrypi" #This is your Server IP! port=2345 + s.settimeout(5) s.connect((host,port)) s.send(str(rot).encode()) rece=s.recv(1024) @@ -36,6 +37,9 @@ def sendData(): return render_template("index.html", conf=rece) except ValueError: return render_template("index.html", conf='Invalid Input "'+rot+'"') + except: + return render_template("index.html", conf='Timeout: Unable to reach Pi') + if __name__ == "__main__": app.run(debug=True)