Repository navigation
Description
Hi,
Pybricks has been working great for me - until today :(.
I've mostly been using pycharm and pybricksdev for development but today I wanted to try something quickly so I opened code.pybricks.com. It told me there was a new version, so I reloaded to update. When I connected to my Technic hub it told me it couldn't get device information and suggested checking that the firmware was up to date. So I reloaded the firmware. No error messages, but at the end the red/green/blue lights were still flashing, and I don't remember it ending like that before.
Anyway, I can connect to the hub but the repl and run buttons remain disabled. However, if I then press the hub button I see this in code.pybricks.com:
Running program from flash memory...
('technichub', '3.0.0b3', '6c3daec on 2021-04-02')
Hello, World!
...done.
and the repl and run buttons then become enabled.
If I try using pybricksdev I get this:
C:\pybricks\pybricksdev>poetry run pybricksdev run ble "Pybricks Hub" "print('hi there')"
Searching for Pybricks Hub
Connecting to 90:84:2B:5E:BE:7B: Pybricks Hub
Connected successfully!
2021-04-03 08:58:39,381: INFO: Program size: 45 bytes
2021-04-03 08:58:39,489: INFO: Sending: 100%
Running downloaded program...
hi there
...done.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\pybricks\pybricksdev\pybricksdev\cli\__init__.py", line 326, in main
loop.run_until_complete(subparsers.choices[args.tool].tool.run(args))
File "C:\Users\John Daniels\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\pybricks\pybricksdev\pybricksdev\cli\__init__.py", line 154, in run
await hub.disconnect()
File "C:\pybricks\pybricksdev\pybricksdev\ble.py", line 149, in disconnect
await self.client.disconnect()
File "C:\pybricks\pybricksdev\.venv\lib\site-packages\bleak\backends\dotnet\client.py", line 281, in disconnect
await asyncio.wait_for(event.wait(), timeout=10)
File "C:\Users\John Daniels\AppData\Local\Programs\Python\Python38\lib\asyncio\tasks.py", line 501, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
C:\pybricks\pybricksdev>
Any suggestions?
Activity
thesynman commentedon Apr 3, 2021
In case it helps diagnose this problem, I've discovered that the behaviour using pybricksdev isn't consistent. Sometimes it more-or-less works:
Sometimes I get this:
laurensvalk commentedon Apr 3, 2021
Pybricksdev has been updated also, to match the changes in the firmware. Are you already using the latest version?
laurensvalk commentedon Apr 3, 2021
Regarding the run and repl buttons not working in the IDE, is this issue persistent? Could you try CTRL+F5 to perform a hard refresh of the page?
thesynman commentedon Apr 3, 2021
I hadn't updated pybricksdev - now done. The behaviour is different but still inconsistent. Once it worked OK, but I mostly get something like this:
and it doesn't exit.
Or it will run ok but not exit. It was rock-solid before the update. There's definitely something wrong.
As for pybricks-code, the first time I got this:

The second time I connected it worked. But after that it's the same behaviour I reported before: the hub connects but the run and repl buttons aren't enabled until I press the button on the hub.
BertLindeman commentedon Apr 3, 2021
Using win10 Microsoft Edge Versie 89.0.774.68 (Officiële build) (64-bits)
No working run and repl buttons.
The connect button is also very slow (3 a 4 seconds).
Waited a few minutes after successful connect but no run/repl.
Pybricks Code v1.0.0-beta.8and CTRL-F5 no success.Last night I sometimes had a working connection and now not.
Using
Google Chrome Version 89.0.4389.114 (Official Build) (64-bit)did only succeed the second CTRL-F5 (while connected)
Must be a timeout somewhere?
BertLindeman commentedon Apr 3, 2021
Forgot to tell: running on a technic hub, but the movehub feels similar.
Can confirm that a short press on the hub button starts to run the program on my code.pybricks.com screen.
[EDIT] or some program, not sure where it comes from....
Some time after "connect":

After hub-button press:

laurensvalk commentedon Apr 3, 2021
Thank you both for testing so thoroughly! There have been some big revisions on the Bluetooth side and it looks like we've still got some work to do.
Meanwhile, @thesynman, in case you want to use an older version of
pybricksdev, you can, by reverting to a previous firmware version.[-]Issue after update[/-][+][Bug] Download and REPL buttons not enabled after connecting[/+]thesynman commentedon Apr 3, 2021
@laurensvalk I've already reverted to version
v4.6.0+v3.0.0b2-1-g0072f4ecof the firmware and to commit7a6d2f4of pybricksdev (it might be a good idea to put a tag on that commit so that others can more easily find a working combination).Thanks for your quick responses, and I hope you find the problem.
1 remaining item
dlech commentedon Apr 3, 2021
Where did you see version number? It should be just
v3.0.0b2-1-g0072f4ec.thesynman commentedon Apr 3, 2021
@dlech Yes, sorry, that is the version number - I added the v4.6.0 myself because that was mentioned on the build. I'm unclear about how your version numbering works.
dlech commentedon Apr 3, 2021
I have confirmed this seems to be a Chromium Windows bug and filed an issue. https://bugs.chromium.org/p/chromium/issues/detail?id=1195592
So we need to change the firmware to work around this. (We need to do this anyway, since the notification could be missed due to, e.g. a noisy RF environment, not just this specific Chromium bug.)
I also found additional Bluetooth issues on Windows, so we have reverted Pybricks Code to the previous version for now. (In addition to the GATT error message posted above, I saw one other error message and the Technic hub itself doesn't seem to disconnect when clicking the Bluetooth button in Pybricks code to disconnect)
sys/bluetooth: add status update timer
dlech commentedon Apr 5, 2021
I just pushed v1.0.0-beta.9 with a fix. Can you please update and test again?
BertLindeman commentedon Apr 5, 2021
@dlech just updated code.pybricks.com oke:
Switched OFF
include current programanddownloaded the corresponding firmware using the download firmware button in
Microsoft Edge Versie 89.0.774.68 (Officiële build) (64-bits)After connecting the buttons "Download" and "REPL" are correctly activated.
After pressing the run button I get:
The character before "Value" changes some of the times.
If I replace the program in the editor with a simple program like this:
Then the run succeeds:
But if I add
from pybricks.tools import StopWatchto the program . . . .
The incompatible mpy error returns.
So some success, but not completely yet?
[EDIT] formatting was wrong..
dlech commentedon Apr 5, 2021
I started #290 already for incompatible .mpy issue already. Seems to just be a problem with Edge for some reason (although I didn't try Chrome with a large program).
BertLindeman commentedon Apr 6, 2021
Also tried chrome:
So THIS item can be closed?
laurensvalk commentedon Apr 6, 2021
Before we close this, I'd be curious if @thesynman's issue:
has gotten any better with the latest update.
thesynman commentedon Apr 6, 2021
I can confirm that pybricks-code now seems to work ok, but it's hard to be sure because of #290.
Win 10 and Chrome Version 89.0.4389.114 (Official Build) (64-bit)
@laurensvalk I've pulled the latest from pybricksdev and still seeing the same sort of errors (with the latest firmware). I'm doing:
poetry run pybricksdev run ble "Pybricks Hub" "print('hi there')"and the outcome is inconsistent. Either a) (rarely) seems to work but the program never exits, b) I see checksum errors but the program runs but doesn't exit, c) I see checksum errors and then
Error during program download.In short, pybricksdev is still not working for me.
laurensvalk commentedon Apr 6, 2021
Thanks for confirming! I'll move it to a dedicated issue so we can look at it later.