This is a follow-on from the "serial timeout for entry to config mode being too short" issue (#21). The increase to 4s did not help, it was still really tricky to get into config mode.
Actual problem is that once the first character has been received in getSettings()
then getPass()
is called which calls Serial.readBytes()
with the default stream timeout (1s). If there is >1s delay between any character then Serial.readBytes()
times out, the entire 5 character keystring is not received and the keystring test fails.
Solution is to avoid calling getPass()
until at least 5 characters have been received. Until then, the 4s timeout is still running and if insufficient (or zero) characters are received then the timeout happens and the normal startup procedure continues.
There is a further related problem with Serial.parseInt()
and Serial.parseFloat()
timing out on multi-digit numeric entry, especially on commands with multiple numbers and spaces. This didn't seem to be much of a problem on simpler commands and can be further minimised by setting a slightly longer timeout via Serial.setTimeout()
.
I have a pull request to submit with a tested fix for these issues.