seen this befote....bt stack creates virtual ports and inwriting them windows dosnt write port values correctly sometimes givinga non null charater on the port number like com 05c. You can enter registery and edit the port value manually but each restart you will have the same issue . This has been happening since win xp and the way windows handles other mfgrs stack software.
Sorry atm i cannot post links i'm on a hospital OSKB system .....do a serch for bt stack com port values in windows....somethin like that.
Now this is interesting. The only oddity I found was a couple of terminal programs (I tried about 5) listed the two new com ports created for the bluetooth adapter simply as "COM" with no number.
In device manager and most of the terminal programs it lists the com ports correctly as COM4 and COM5. This implies there is something dodgy about the ports labels, perhaps different terminal programs access the com port list from different parts of the registry.
That's when I found this, based on
wasyoungonce suggestion:
https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/bluetooth-stack-inserts-invalid-com-port-names/ff68fac4-62b0-4b3a-b83a-0c8b1712adf8Opening up the registry entries to edit - namely the COM port names - and closing them, I was able to open all the com ports, but only successfully send and receive data on the last one (that I added after pairing). The others I could open, but that didn't cause the bluetooth device to connect, which should happen. Before, I clicked on the devices icon in bluetooth "devices" and added another serial port, I assume one can add as many as you wish, and this seems to work, despite originally displaying the same behavior as the other ports (unable to connect). I'm going to restart to see if its magically "fixed" or if fiddling around in the registry actually did it.
Edit, 5 minutes after post, after restart: Well I think I have a workaround. After a restart, all three (the original two created after pairing device and the extra one I added) are not accessible. In two of my terminal programs they are listed simply as COM without a number - hinting that there is some dodgy character/termination character in the registry, which prevents the ports from being used. I can make the third com port usable (and make it appear as COM7) just by opening up this reg key and clicking OK:
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM\Device\CsrBtSerialx
where x is a zero-based index, eg: 0,1,2 etc.. In my case it was CsrBtSerial2 - the com port I added, so it will be the last one in the list.
As in the link above, it appears to look fine - they are listed as COM4, COM5 and COM7, but when read they don't return the numbers because the strings aren't terminated. Simply double clicking these entries to edit then closing (by clicking OK) correctly terminates the string.
This doesn't work for the original two ports created, only subsequent ports added in bluetooth devices - I do not know why.
So.. the workaround is: Add a third com port, make note of its number, and note that the two com ports added during pairing are essentially useless. Every time after a boot, go to above reg entry, open it and close it. You can now use that extra port you added for bluetooth communication. Requires this to be done after every boot. I might write a small script to automate this, so it just requires double clicking that every time I wish to use this HC-05. As the com port is fixed (once created it doesn't change number or disappear) I'll have to reserve COM7 for this purpose.
So, not a fix really, but a workaround, and its all thanks to
wasyoungonce. Cheers