Open kevinjwalters opened 3 years ago
@Gadgetoid How do the tests work for this library? There's no mocking of pimoroni_physical_feather_pins
in https://github.com/pimoroni/pms5003-circuitpython/blob/4323b7511ee2e74129e9726869cd8af35382132d/library/tests/test_setup.py#L33-L38 so it looks like it fails if it's not executed on real hardware? Do you have some way or running these tests on an actual Feather?
Reminder, client code which does not read all the data out of the serial/UART buffer immediately or just wants to be more robust will have to catch the new FrameLengthError
too but #6 negates need.
ChecksumMismatchError
- attributable to buffer fills and truncation - covered in #3RuntimeError: buffer size must match format
fromPMS5003Data
- attributable to buffer fills, truncation and reads half way through PMS5003 sends (on CPython these would bestruct.error: unpack requires a buffer of 28 bytes
- needs better exceptionMemoryError
around frame length - attributable to buffer fills and truncation - needs sanity checking based on a general or per-frame-type maximum length constant">HHHHHHHHHHHHHH"
to parse (see point 2).plotters_combined.py
as it appears not to be on a Feather nRF52840 Express sometimes - needs a stop/start via REPL to fix at the momentread(XX)
looks well behaved on REPL so unlikely to be that. This could just be bogus values causing something likeread(32768)
which would appear to get be stuck. https://github.com/adafruit/circuitpython/issues/3876TypeError: object of type 'NoneType' has no len()
- code does not accomdoate the legitimate return value of None from CircuitPython's UART's read() (same as MicroPython).Other:
PMS5003Data
repr
passes checksum to format but does not use it.CircuitPython default
UART
rx buffer size is 64 and the frames from the PMS5003 are 32 bytes which is why problems occur less frequently than one might expect.