Heerkog / MicroPythonBLEHID

Human Interface Device (HID) over Bluetooth Low Energy (BLE) GATT library for MicroPython.
GNU General Public License v3.0
238 stars 32 forks source link

OSX/Debian: Device updates aren't processed by central #9

Open ilyamordasov opened 2 years ago

ilyamordasov commented 2 years ago

I attached the buttons, executed async mouse example, connected to Mouse device (it is exactly detected as mouse device), so I can see

Notify with report:  (0, 0, 127, 0)
Notify with report:  (0, 0, 0, 0)
Notify with report:  (0, 0, 127, 0)
Notify with report:  (0, 0, 0, 0)
Notify with report:  (0, 0, 127, 0)

when buttons are not pressed and some opposite values when I press any button. But mouse doesn't move, doesn't call menu/submenu, nothing. Could you explain what will happen, and about what this example?

Heerkog commented 2 years ago

Are you able to test with something other than OSX?

I'm asking because there seem to be issues with Apple which are probably related to 'faking' the device information (manufacturer, version, etc).

ilyamordasov commented 2 years ago

Yes, with android works like a charm

UPD: Just tried with ubuntu 20.04, it's not working too, seems the issue is not only in OSX

Heerkog commented 2 years ago

You could try finding the (i) device information, (ii) revision information, and (iii) php information used by an Apple approved device and using the provided functions to set these values after line 37 of the async example and see if it then works.

If that doesn't work, you might need to also find (iv) the HID input report of that same device and use that. Note that changing a HID input report requires changing the code in several places, some of which is not easy to understand.

ilyamordasov commented 2 years ago

A few years ago I was implementing usb hid device with stm32, will look at its descriptor, but do not remember did it work with OSX or not, but exactly worked with one of them ubuntu or osx.

Heerkog commented 2 years ago

Please check this thread for Ubuntu. I feel the OSX and Ubuntu issues are very related and probably lead back to issues with the pnp and device information not leading the OS to the correct/any drivers.

In case you find working device and pnp information, please do let me know so I can update the examples!

ilyamordasov commented 2 years ago

Ok

Heerkog commented 3 months ago

I have just pushed a major new version of this library. If anyone could test whether this issue has been resolved, that would be great.

In case it is not resolved, a wireshark pcap trace of the faulty behavior would go a long way to me being able to fix it.

randomtestfive commented 1 month ago

I'm running Linux Mint 22, with a TinyS3 on Micropython 1.23. Running the simple keyboard example, there's no events in Wireshark after the connection. I'm also running into #2 at the same time.

Heerkog commented 1 month ago

That is a shame. I was hoping the issue would've been solved.