Sunday, May 2, 2021

Windows 10, bleno and WinUSB

I am using bleno to simulate a Bluetooth device for a mobile app I am working on. The problem is that for bleno to work on Windows one must install the WinUSB driver and if the WinUSB is installed rather the the default driver then it's hard, on a Dell latitude, to power on Bluetooth because the control button will not appear in the Action Center menu as shown in the following image.



Because the button was missing, I didn't have any information about whether the device was on or off. I only knew that Bluetooth must be off because a "poweredOff" event was being triggered during the start up of my application. Attempts to power on the Bluetooth with Power Shell also failed. 

The steps I am about to describe below should help one be able to work with bleno on Windows without too many hassles.

First make sure the default Bluetooth driver is installed and that the Bluetooth button appears in the Action Center menu as shown above and that Bluetooth is on.  In the Device Manager, it should look as follows:



Next install WinUSB; 
preferably using Zadig.


After installation, the Device Manager should appear as follows and it should be possible to open the Bluetooth device using bleno.



When one is done working with bleno, then roll back the WinUSB driver. This way the Bluetooth on/off button will be visible should the Bluetooth device turn itself off once the laptop is closed or shutdown. Following these above steps allowed me to work with bleno without too many hassles and without annoying computer restarts.