Pathpilot Reset Functionality

More
03 Nov 2025 21:31 #337786 by kwanlokto
Replied by kwanlokto on topic Pathpilot Reset Functionality
Pathpilot is v2.10.1

I would use Tormach's internal debugging system which would write to the status logs
self.error_handler.write("My message", ALARM_LEVEL_DEBUG). I wrapped the endpoint in a try catch block so that's why I'm also very puzzled. I do however run my flask application in development like this, so I'm not sure if I'm running into a locking issue:

class FlaskAppWrapper:
def __init__(self):
....
def run(self):
try:
threading.Thread(target=self.run_app_at_port, args=(mill_port,)).start()
except Exception as e:
print "error in threading: \n" + str(e) + "\n"

def run_app_at_port(self, port):
try:
self.app.run(host="0.0.0.0", port=port, threaded=True)
except Exception as e:
print "error has occurred when running flask: \n" + str(e) + "\n"

Please Log in or Create an account to join the conversation.

More
03 Nov 2025 21:36 #337787 by kwanlokto
Replied by kwanlokto on topic Pathpilot Reset Functionality
Good idea! I'll add a locking mechanism to the route and see if that helps. I do already have try-except wrapping the entire endpoint.

Since I'm modifying Tormach's code directly, I'm trying to keep changes minimal to avoid breaking PathPilot's core functionality.

Please Log in or Create an account to join the conversation.

More
03 Nov 2025 22:35 #337789 by langdons
Replied by langdons on topic Pathpilot Reset Functionality
Don't change the functionality, just streamline it.

You should probably change the ip from 0.0.0.0 to 127.0.0.1 or something.

Also, a nice http error message is arguably better than a console print.

Your Exceptions might be getting lost along the way somehow.

You should probably put another try/except in the ss_reset_route method just in case.

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum