This operation does not work on Windows, and does not appear to be
crucial on other platforms either. The browser seems to already handle
resetting the endpoints as needed when connecting or closing the browser
(at least on Linux)
Add a function to pad EV3 firmware size to avoid potentially triggering
bugs in the EV3 bootloader. When we do a download command with too small
of a payload, the bootloader can send a bad response. We can work around
this by ensuring that the firmware size is such that the last chunk is
the maximum size. This way we never send a small chunk that could
trigger the bug.
Add an extra progress between erasing and writing. This makes the
progress not stall for quite as long before progressing when flashing
smaller firmwares.
Change from erasing 1 sector at a time to erasing 2 sectors at a time.
This works around a USB issue where commands that don't take long to
execute can receive an incorrect response.
The point of erasing 2 sectors at a time is that when we write the data
to the sectors that we just erased, the last (partial) chunk of data is
now twice as large, which makes it take twice as long to write. This
seems to be long enough to avoid the USB issue.
Add a hack to not fail if the EV3 bootloader sends an echo of the request
instead of the expected response. There is a known compatibility issue
with the EV3 bootloader USB and, e.g. Windows with USB 3.0 ports. This
apparently causes a race condition where commands that don't take long
to process before sending a response will have the request echoed back
instead of receiving the actual response. If this happens, we can
ignore it and assume the command was successful. It just won't work, e.g.
for the version command since that has a payload in the response.
This hasn't been used for a long time in Pybricks Code. We're only keeping it in the firmware because Pybricks Code raises an error otherwise.
Disabling it saves about +400 bytes on Move Hub and Technic Hub and helps simplify the firmware. By removing it we don't run untested code if someone connects to the advertised NUS service.
Remove didStart and didFinish actions from firmware flashing sagas as
they are not used for anything.
didFailToFinish is not so easily removed as it is used to trigger error
toasts.
Add some calls to hide the progress toasts when an error occurs during
firmware flashing. Without this, the toasts would remain visible even
after the error alert was shown.
For some reason, the type checker doesn't catch this, but
FailToFinishReasonType.Unknown requires an error argument, otherwise
we get an unhandled exception.
Dispatch an error in case there is no firmware URL. Normally this should
never happen, but currently it does because we don't have EV3 firmware
yet. The error is more useful than just spinning forever.
Basic support for restoring the official EV3 firmware. Is missing a video
and needs a bunch of helpful error messages, but basic functionality
is working.
This is just the UI bits (new file template, Pybricks firmware install,
official firmware restore).
The Pybricks firmware flashing hangs because we don't have a EV3 firmware
yet in @pybricks/firmware. Official firmware restore has an alert()
placeholder so at least it does something.
Rename the requested program ID from slot to progId and the running
program ID to runningProgId. These can also have the value of built-in
programs, not just slot numbers, so it doesn't make sense to call them
slots.
I meant to change this before merging the previous commit, but missed it.
The mismatch test was hard to understand and didn't increase coverage,
so let's leave it out.
* Update for changed StartUserProgram command semantics
* Added new capability flags and fixed-purpose slot definitions
* Update for new start REPL command
* Updated StartUserProgram command and Status event for slots
* Added new AppData command and event
---------
Co-authored-by: David Lechner <david@pybricks.com>
Enable the stream option on the text decode for the stdout and uart
stream handlers that pipe data to the terminal. This fixes improperly
printing multibyte unicode characters that get split across multiple
data packets.
A new decode is added for each different stream in case both are used
at the same time.
Fixes: https://github.com/pybricks/support/issues/1743
Mac users have recently been reporting failed firmware updates due to
the hub disconnecting during the update process. This is likely due to
the Mac sending packets faster than the hub can handle. This changes
the arbitrary BLE firmware burst size from 10 to 8 to reduce the chance
of the hub getting overwhelmed.
Fixes: https://github.com/pybricks/support/issues/1787
For some reason, two is now using the last item in the svg group for
centering, which was one of the eyes. The changes the order so that the
body is not the last item and centering works again.
Dialogs were off of the screen due to the overlays being bigger than
the view port. This is fixed by adding some style to limit the size.
Also multi-step dialogs are hard-coded to have min-width of 800px in
blueprints.js, so we need to override this on smaller screens.
Fixes: https://github.com/pybricks/support/issues/1271
* build(deps): bump pyodide from 0.23.4 to 0.24.1
Bumps [pyodide](https://github.com/pyodide/pyodide) from 0.23.4 to 0.24.1.
- [Release notes](https://github.com/pyodide/pyodide/releases)
- [Commits](https://github.com/pyodide/pyodide/compare/0.23.4...0.24.1)
---
updated-dependencies:
- dependency-name: pyodide
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* updates for pyodide 0.24.0
- fix breaking file rename
- replace use of deprecated type
* use @pyodide/webpack-plugin
Pyodide 0.24 made some breaking changes that broke the way we were
integrating it with webpack manually. We can use the official webpack
plugin instead.
* webpack: add hack for pyodide
This works around "Critical dependency: the request of a dependency is an expression"
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Lechner <david@pybricks.com>