[Bug] LPF2 connection manager not ready before script starts #674
Labels
bug
Something isn't working
platform: Powered Up
Issues related to LEGO Powered Up
software: pybricks-micropython
Issues with Pybricks MicroPython firmware (or EV3 runtime)
topic: motors
Issues involving motors
topic: sensors
Issues involving sensors
This is a follow up from #673, but this is a different issue:
When a script is included with the firmware and you start it with the button, it often fails because the devices are not ready yet.
We are already waiting on UART devices to sync up (solved in #673), but there is a step before that as well to detect the device type. This takes about a second. There's a Python script below to reproduce it.
Either this step does not work right immediately after switching on the power to the ports, or it hasn't asynchronously initialized this driver yet by the time the user starts the program.
Perhaps we can wait for all drivers to be ready before allowing the user program to start. We could use a bootup animation to indicate that it is getting ready.
To support this hypothesis, try this hack which works around the problem:
To reproduce
Install this script along with the firmware and attach a motor to port A.
Without the patch, the light turns red if you start this right after boot.
With the patch, it turns magenta and then green once the device is ready.
This is tested on Technic Hub. We don't see this on Prime Hub, but that's probably only because there's already a wait for flash to get ready before the user can start the program.
The text was updated successfully, but these errors were encountered: