pybricks / support

Pybricks support and general discussion
MIT License
109 stars 6 forks source link

[Bug] Popup stating "GATT Error Unknown." during download #1468

Open laurensvalk opened 7 months ago

laurensvalk commented 7 months ago

(...) with the beta firmware and in the middle of running the program, before it finished downloading to the hub, I got an unexpected error message popup stating "GATT Error Unknown."

Originally posted by @ninoguba in https://github.com/pybricks/support/issues/1467#issuecomment-1958659447

laurensvalk commented 7 months ago

This was also reported by:

Originally posted by @Tcm0 in https://github.com/pybricks/support/issues/1462#issuecomment-1954820503

laurensvalk commented 7 months ago

I have also seen this while working on @martynboogaarts 's laptop.

Once it did occur, it was deterministic after that. We kept getting that error when we clicked Download again.

Restarting the hub worked around it.

Tcm0 commented 7 months ago

So far I only got the issue once and it didn't happen when I tested my code for the app controlled transformation vehicle (I did at least 10 program uploads for sure). It only happened with that Technic Hub Disconnection test code

laurensvalk commented 7 months ago

Thanks for the additional details. Indeed, it seems to occur only occasionally.

It only happened with that Technic Hub Disconnection test code

I think this is probably a coincidence. It doesn't start running any of the Xbox controller code until after the program starts. Or, depending on what you tried, even after initializing the steering motor.

PeterAmiga commented 6 months ago

I am trying to install firmware on boost hub, and I get above error or attached error 'something went wrong'. I have tried ten times. I tried to install official firmware twice, and that worked fine. I follow the instructions, setting no specific hub name. Instructions say Select Lego Bootloader and click Connect. But I can see Lego Bootloader - Paired, and then I can press Pair.

For me this does not seem logic, since it is already paired.

The process starts but I get attached error after around 10-12 seconds and the flashing on the hub stops.

Is there any way for me to see additional logging about what could go wrong?

Additional comment: I was able to install firmware on a city hub without problems.

pybricks_bootloader pybricks_something_went_wrong

dlech commented 6 months ago

Is there any way for me to see additional logging about what could go wrong?

See https://github.com/orgs/pybricks/discussions/270

PeterAmiga commented 6 months ago

I just fetched bluetooth logging from browser. Will try other debugging tomorrow. pybricks_bluetooth_debug

dlech commented 6 months ago

For this particular error ("The hub said something went wrong"), I think we will need Bluetooth packet logs.

The console log in the browser may give a slightly better hint as to the cause though (narrows it down to 1 of 5 possibilities).

BertLindeman commented 6 months ago

Comment of a simple Pybricks user :

  1. The "pair" in pybricks in fact means to connect to.
  2. I had this type of error sometimes when there were too many devices near the pc and the hub. As example when my phone is between the pc and the hub.

But bluetooth logging might show what is the real problem.

Bert

PeterAmiga commented 6 months ago

Impressively quick replies :-)

I realised I could run pybricks from my android phone. I also used my android phone to install the original firmware again. I succeded installing pybricks firmware using my phone.

And afterwards I can run a program on the hub from my Windows pc.

Thanks for the suggestions on how to solve the pc problem. For now I will experiment with the code on my hub and not dig further into this problem.

If you would like to have the Bluetooth packet logs, let me know. I will try to provide them.

dlech commented 6 months ago

If you would like to have the Bluetooth packet logs, let me know. I will try to provide them.

Yes, that wold be helpful to be able to see if this is a bug we can fix or if it is just a bad Bluetooth driver on Windows.