PortInUseException workaround followup question
in
Core Library Questions
•
5 months ago
Hi everyone!
I've been using Processing for a couple of months now, but there is one issue that I just can't seem to fix with searching in the forums.
In the program I'm writing I open a RFID reader (from Parallax) on port COM3 in setup. Usually it works but sometimes it just isn't available (PortInUseException) even though Windows has listed it in Devices and Printers, and it's port name is still COM3.
I found a workaround ( https://forum.processing.org/topic/recover-from-portinuseexception) but I'm not sure how to implement it. How, exactly, do you implement the method "Timeout" that is suggested in that workaround? And can you make setup() wait for this method to do its job before wrapping up and going to draw()? There is a Serial port listener in draw() that will probably throw an exception if Timeout is still trying to set up the communication.
I really need the Serial port to open, the intent of the program is to run at startup and work for an entire day in a public exhibit. Shutting down the pc and restarting it isn't a feasable option for me.
And, just out of curiosity, what program might be using the COM-port? Processing is the only program running on my pc. Is Windows doing something to it?
I've been using Processing for a couple of months now, but there is one issue that I just can't seem to fix with searching in the forums.
In the program I'm writing I open a RFID reader (from Parallax) on port COM3 in setup. Usually it works but sometimes it just isn't available (PortInUseException) even though Windows has listed it in Devices and Printers, and it's port name is still COM3.
I found a workaround ( https://forum.processing.org/topic/recover-from-portinuseexception) but I'm not sure how to implement it. How, exactly, do you implement the method "Timeout" that is suggested in that workaround? And can you make setup() wait for this method to do its job before wrapping up and going to draw()? There is a Serial port listener in draw() that will probably throw an exception if Timeout is still trying to set up the communication.
I really need the Serial port to open, the intent of the program is to run at startup and work for an entire day in a public exhibit. Shutting down the pc and restarting it isn't a feasable option for me.
And, just out of curiosity, what program might be using the COM-port? Processing is the only program running on my pc. Is Windows doing something to it?
1