Skip to content

Partial _STARTREPLY response header #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
okennedy opened this issue May 19, 2022 · 0 comments · Fixed by #13
Closed

Partial _STARTREPLY response header #12

okennedy opened this issue May 19, 2022 · 0 comments · Fixed by #13

Comments

@okennedy
Copy link
Contributor

okennedy commented May 19, 2022

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.

okennedy added a commit to okennedy/Adafruit_CircuitPython_TFmini that referenced this issue Jul 18, 2022
Reset input buffer on init (closes adafruit#12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant