Author Topic: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.  (Read 6876 times)

0 Members and 1 Guest are viewing this topic.

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« on: August 15, 2018, 01:27:23 pm »
Hi,

After years of wanting to add bluetooth connectivity to some projects I finally got around to buying a bluetooth dongle (one of those CSR 4.0 ones) and a HC-05 bluetooth module.  The dongle works just fine - works with my DIY bluetooth speaker - that shows a pop-up in windows from the CSR harmony software.  Audio streaming seems to work flawlessly.

However, whilst I can pair the HC-05 module with my PC, I cannot open either of the ports it creates in device manager, nor can I connect to it in any way.  I set the HC-05 in command mode and changed its name, password and baud (to 115200), so the module is definitely working, it responds to AT commands, and the host PC can see it for pairing - a windows 10 thing?

Has anyone successfully opened the com ports/communicated with a HC-05 on windows 10?  Since I'm using a CSR-based host adapter (which only works with CSR harmony software from 2012) I'm guessing it is either that or a windows 10 problem.
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 4780
  • Country: pm
  • It's important to try new things..
 

Online Messtechniker

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: de
  • Old analog audio hand - No voodoo.
Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter
 

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« Reply #3 on: August 15, 2018, 05:12:42 pm »
https://forum.arduino.cc/index.php?topic=412958.0

Unfortunately I don't have a broadcom chipset, and the only drivers for the CSR chipset are installed.

http://www.collideabq.com/2016/04/28/bluetooth-serial-connection-with-windows-10/

I think I came across that blog post whilst googling - I don't have the same options as he did (I think he has an older version of win10) and I can add as many com ports as I like to the bluetooth connection - none of them are accessible by any terminal program.  I even wrote a test app in visual studio (C#) and just got the same error.  I also tried toe bluetooth serial app - no com ports were available despite adding two (as well as the two it already assigned) to the device.

I think the HC-05 and 06 actually connect to host once a host app opens its virtual comp port - as I cannot do that, it remains "unconnected" in the bluetooth options.  It works well with my android phone - so it must be a windows problem  :-//
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 4780
  • Country: pm
  • It's important to try new things..
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« Reply #4 on: August 15, 2018, 06:09:02 pm »
https://forum.arduino.cc/index.php?topic=412958.0
Unfortunately I don't have a broadcom chipset, and the only drivers for the CSR chipset are installed.
Frankly I doubt Win10 could have problems with CSR chipset. Uninstall the driver (remove the files if possible) and reboot, insert the BT dongle into the usb socket and watch what happens..
 

Offline wasyoungonce

  • Frequent Contributor
  • **
  • Posts: 492
  • Country: au
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« Reply #5 on: August 16, 2018, 06:44:32 am »
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.
I'd forget my Head if it wasn't screwed on!
 
The following users thanked this post: Buriedcode

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. -> Workaround
« Reply #6 on: August 16, 2018, 04:22:37 pm »
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-0c8b1712adf8

Opening 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:

Code: [Select]
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  :-+
« Last Edit: August 16, 2018, 05:01:33 pm by Buriedcode »
 

Offline wasyoungonce

  • Frequent Contributor
  • **
  • Posts: 492
  • Country: au
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« Reply #7 on: August 17, 2018, 02:14:03 am »
well done iindeed I have seen scripts tofix the issue...but if you do another post it up......this issue has been hapening since XP........'Struth"!

Sorry for typos I hate OSKBs!
I'd forget my Head if it wasn't screwed on!
 

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« Reply #8 on: January 31, 2019, 12:34:34 pm »
I know its an old topic, but I forgot to add my script to the thread as a final solution/workaround:

Code: [Select]
@ECHO OFF
REG DELETE "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM" /v "\Device\CsrBtSerial0" /f
REG ADD "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM" /v \Device\CsrBtSerial0 /t REG_SZ /d COM7 /f

All this does is rewrite COM7 to the appropriate entry.  Its a BAT file that has to be run at startup, so you have to be admin to get windows to run it.  It's a fudge, but is the only way I could get it working on my build of windows 10.
 

Offline wasyoungonce

  • Frequent Contributor
  • **
  • Posts: 492
  • Country: au
Re: Bluetooth HC-05. CSR 4.0 + Windows 10. No dice.
« Reply #9 on: January 31, 2019, 09:29:57 pm »
Hi Buriedcode. Yeah just saw your post what a bummer by virtual com ports again.  Jeez by win10 you would think things would be better MS has known since early XP. 

Well done  I think I have some scripts for XP but like your BAT has to be run every time.
I'd forget my Head if it wasn't screwed on!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf