This method appears to have a few issues, which I think explains why sometimes the sensor doesn't appear to be reading and when it is, the timing of the FA messages seems a bit sporadic
if tub.available returns anything other than 2 bytes after pin5 first goes low, then we fail to get the right msgLength so we just ignore any data until we do happen to hit the magic 2 bytes. Think handleBytes result.length() == 2 should be >=2
Similarly if for some reason we read more than expected, then we ignore the message, might be better to look for result.length() >= msgLength
This method appears to have a few issues, which I think explains why sometimes the sensor doesn't appear to be reading and when it is, the timing of the FA messages seems a bit sporadic
tub.available
returns anything other than 2 bytes after pin5 first goes low, then we fail to get the right msgLength so we just ignore any data until we do happen to hit the magic 2 bytes. Think handleBytesresult.length() == 2
should be >=2