-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
It's hard to put a finger on, but the brick seems pretty unstable at the moment. This may be caused by a bunch of different things, so I'm just collecting some observations for now.
UART issues
Sensors seem to have various issues that appear related to the UART driver but this isn't as easy to test.
An easier test seems to be to enter paste mode on the REPL (CTRL+E
) and paste something like the following. Anything of similar length will probably do.
try:
from pybricks.pupdevices import Motor
except ImportError:
from pybricks.ev3devices import Motor
It's expected that some characters may be missing since there is no pushback, but it shouldn't get stuck.
The pbio
event loop keeps running since the run animation keeps going, but the REPL no longer accepts new characters. If the UART driver gets stuck then this could explain sensor issues too.
Exiting the program with the stop button also works, and new output is shown. It's just input that gets stuck.
I/O operations seem to affect loop time (or ADC)
When you plug in the NXT color sensor or NXT light sensor, it toggles through the colors (or on/off). This is smooth while idle, but you can see it stutter when I/O operations run. Or in this case any program while the run animation is running on the screen. Before we had the animation, it would flicker while typing or pasting text into the REPL.
I'd like to revisit some of the ev3_dcm code to fix some of its timing. It could well be down to this rather than being a symptom of another issue, but it's worth keeping an eye on. Nothing should visually blink once we get this right.
MicroPython crash
Looking into timing, I was dusting off some of our motor benchmarks in order to run them with pybricks/pybricks-micropython#361 (thanks @ArcaneNibble!). I didn't get much further than the import stage yet. Attempting to run the following makes the brick crash and reboot.
try:
from pybricks.pupdevices import Motor
except ImportError:
from pybricks.ev3devices import Motor
This doesn't seem to crash when typing it into the REPL directly (if slowly) on the current master branch.