Tuesday, March 01, 2016

Fixing Prolific PL2303 code 31 error

The code 31 error seems to happen when a PL2303 device tries to create a COM port which already exists. For example, it happens if you already have COM8 and you plug in a PL2303 device which tries to also configure itself to COM8.

COM port numbers are usually defined based on the USB port, so the simplest solution is to plug the device into a different port, and hope it will get a different COM port number.

The other solution is to reassign the port number. You can do this via Device Manager. Go into the Ports (COM & LPT) section, right click on the port you want to change, select Properties, go into the Port Settings tab, and click on the Advanced button. In the bottom of the Advanced Settings dialog you can change the COM port number. The list helpfully shows what numbers have been assigned to other devices, including devices which are not currently plugged in. If this cannot be done due to the code 31 error, either change the conflicting device's port, or unplug the conflicting device, plug in the new device and then change the new device's port.

I don't trust Windows with rare operations like this, because they probably haven't been tested enough. A port may fail to work or you might get a bluescreen. So, I recommend rebooting. Everything should be fine afterwards.

No comments: