Strange Communication Delay in Serial Bus, mitigated by adding Serial.print().

I would need to see the rest of your code to be sure, but something similar happened to me with some serial communication.

Essentially, I didn't have a long enough delay in my serial receive function. I had a serial interrupt handler function that would get called before my loop() was handled if there was serial data on the line. In that function, I had a while loop checking whether Serial.available() (or something like that) and processing the data as it came in, and what would happen is that when there wasn't a byte immediately available, it would pop out of the function and run loop() again. As soon as I added a delay(1) inside that loop, it gave enough time for the next byte to arrive, and then it wouldn't pop out of the function, but would keep processing until there was genuinely no more data to be read. So, if something similar is occurring with your system, the Serial.print() creates enough of a delay that it allows more data to come in, allowing your Serial.available() to evaluate to true and continue processing.

Obviously, since I haven't seen your code, all I can do is speculate. Post your code, and we can help you debug more effectively.

Also, a bit of friendly advice. You may get more responses if your subject lines were more descriptive. Say, in your case, "Strange Communication Delay in Serial Bus, mitigated by adding Serial.print(). WTF" Also, a TL;DR is always helpful. :slight_smile: