New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't work on micropython v1.20.0 #16
Comments
I have the same problem |
Hi, Thank you for the report. Sadly, I'm currently not able to test with v1.20.0 Micropython. If you find the issue, I would really appreciate it if you could make a pull request. Thanks. |
Hi, Here is an extract of the error message:
|
Thank you so much for investigating! |
I have tried to add a elif clause for IRQ_GATTS_READ_REQUEST event, and make it "gatts-write" zero back to the client to accept the read, but I dont know which "value handle" I should write to ?
|
I'm unsure, but I would try |
I give it a try, but I get the following error:
|
I have changed to: |
I'm pretty sure that the value handle is the As for the error, it should probably be |
@pidou46 does it work now? |
As for connection it works.
|
During the period of connection, I'm unsure it really works because I can't really see mouse any movement despite reports are send. |
The binding code currently included is very experimental. Could you first try without allowing binding? |
I have set bounding to False in hid_services.py
But the result pretty much the same:
The windows bluetooth app still report "coupling" for a few seconds then "driver error" |
Nota: I get the battery 0% notification before error status |
Do you remove the device from windows before powercycling and attempting a test? |
Yes I do. Something seems to going wrong during "Connection update" that lead to "Central disconnected: 0" Do you have some trick to debug ble/hid/usb stack ? I have checked with windows "event observer" (I'm note sure is the name in English because i'm Fench) : I see an event from BTHUSB : La carte distante (54:43:b2:a9:0d:a6) s'est connectée correctement à la carte locale. translation: the distant device connected correctly to the local card. But no error event later on. |
Let's find out what was updated in the connection update:
I do not, sorry. |
If the updates are to It might be that earlier MicroPython releases kept the connection alive and this version doesn't anymore. This is speculation of course. |
Any updates on this @pidou46 ? :) |
No sorry, I haven't found a way to debug and understand form where the trouble come from. |
The micropython1.2.1 version still cannot be used, and the driver still reports an error. windows log: Driver name: hidbthle.inf |
@Heerkog I made the changes to the _IRQ_CONNECTION_UPDATE event you mentioned above, this is the response I see on my setup once the secrets are shared. It doesn't seem to matter if I'm sending mouse updates (mouse pointer never moves) it times out after a few seconds with "driver error" on the windows side. Connection update: 12 0 960 0 Let me know if there's anything else I can do to help. |
@0ut4t1m3 We might have found the issue. The supervision timeout seems to be counting down. Can you try calling |
Let's also try and catch IRQ event 4.
I'm denying the read here. If that doesn't work try Thanks for helping. It's appreciated! Please DO let me know if this works or not! |
Hi @Heerkog, I made the two changes as suggested, unfortunately it is still disconnecting. Windows is now reporting a battery level of 1% before the connection drops where before it said 100% and the logs do look slightly different. This is how I handled elif event == _IRQ_CONNECTION_UPDATE: # Connection parameters were updated
#self.conn_handle, _, _, _, _ = data # The new parameters
#print("Connection update")
self.conn_handle, conn_interval, conn_latency, supervision_timeout, status = data # The new parameters
print("Connection update: ", conn_interval, conn_latency, supervision_timeout, status)
if supervision_timeout < 500:
self.notify_hid_report() This is the full output, first with
And with
|
The fact that the battery now is set to 1% indicates to me that the
Similarly, I think we should try responding to connection updates with
In case this doesn't work, we should create a loop that continuously notifies |
Still no luck I'm afraid. Adding I added a print to
Sorry I can't be more help than just running code. I'm a bit lost with BLE but this is an excellent library and I'm more than happy to help you get it working with 1.20+. |
Oops. It should be:
Things might behave a bit weird after this, but that's fixable. |
No still crashing:
I found this issue micropython/micropython#12832 looks like something did change last year with the change to IDFv5. I tried 1.30-preview in case the fix in that merge helped but I got the exact same error. Note that if I comment out |
Can you try gatts_indicate instead of notify? |
Hey @Heerkog, no change I'm afraid, |
I created a discussion on the micropython repository. No reactions yet. Any activity from others there would be helpful. |
Hi
I have some problem if use your example for keyboard on v1.20.0 micropython
but i downgread micropython to 1.19.1 version and solved problem with driver on my PC
The text was updated successfully, but these errors were encountered: