lemmingDev / ESP32-BLE-Gamepad

Bluetooth LE Gamepad library for the ESP32
Other
1.05k stars 173 forks source link

issues with the name reporting #217

Open benbeezy opened 5 months ago

benbeezy commented 5 months ago

when doing something like BleGamepad bleGamepad("aaa", "aaa", 100); or even trying to use the default I see Unknown gamepad on this hardware test site https://hardwaretester.com/gamepad and in unity I get the name showing up as "'ࠁ ܀ש̔ (HID)" but every time I connect to the device it shows up as something completely different but always some random junk data. I am using a doit esp32 devkit 1 board. Everything is working fine in windows and showing the right name, but in other applications it shows the random name.

Here is a screen shot in unity of what the device shows up as. image

benbeezy commented 5 months ago

I downgraded to 0.4.4 and the name reports much more normal. It seems to be a string that looks like D820B5A6 but at least now it is more consistent but I can't seem to change that name and no longer have access to things like setFirmwareRevision or setSerialNumber

LeeNX commented 5 months ago

Did you delete/forget your BLE device from the host between changes? BLE attribs and bit are often cached and changes and can cause funny things to happened.

setFirmwareRevision and friends was only added in 0.5.2 - https://github.com/lemmingDev/ESP32-BLE-Gamepad/releases/tag/v0.5.2, anything below that would not have them features.

benbeezy commented 5 months ago

I have deleted and re-added the device each time. looks like I was wrong about 0.4.4 working as intended, I had just also rebooted unity at the same time and after a unity reboot it seems okay until I re-pair while unity is still up. All other devices seem fine with a mid run connection but for some reason not my esp32

Looks like if I reboot unity after the pairing then it shows up more normal but for whatever reason it's coming up as an ASRock A02019100900 and on another machine it's coming up as a Texas instruments device of some kind. I think this might be a larger issue on the unity side of things and less of an issue with this library.

lemmingDev commented 5 months ago

Perhaps if you customise the VID and PID, it will realise its a different board

See the CharacteristicsConfiguration example on how to do this

LeeNX commented 2 months ago

I would use a tools like nRF Toolbox for Bluetooth LE

Which would let you interrogate BLE characteristic & attributes, with very little OS interface. Hope that helps.