Description
I'm trying to connect a TFMini to a Feather S2 (with an Ethernet hat if relevant). I'm using busio, with code roughly in-line with the example in the readthedocs.
When processing the mode setting line, the tfmini library successfully sends _STARTCONFIG
, but fails to fully receive _STARTREPLY
. Specifically, everything works on the first boot from power-off, but after resetting the S2 by saving an updated code.py it will only read the first 3-6 bytes of _STARTREPLY
(the number varies with each reset). Powering down the tfmini alone for ~10s appears to sometimes reset things back to a working state.
I assumed it might be a timing issue and tried modifying the library to continue reading until hitting the timeout (which I raised to ~10s), but self._uart.read(1)
continued to return None
.
I flailed around a bit, among other things putting the line tfmini.mode = adafruit_tfmini.MODE_SHORT
in a loop, catching the RuntimeException
and trying again. Then I noticed that the next call to _set_config
would read off the remaining header bytes (before the 0x42
start byte from the next header). There seems to be some sort of buffering going on, but I can't tell if it's coming from the device or the uart library though. Apologies if this issue belongs on the main circuitpython tracker.