@jonty The reason why you have to kill the process is because you are not exiting gracefully. You should capture SIGINT and close the port, or there is a KeyboardInterrupt exception you could capture and close the port. Since this is not a python forum and your underlying issue is not specific to Omega or OpenWRT I'll leave you to look into this further.