I have 2 Arduinos connected through their respective TX/RX 1.
One of the Arduinos is the sender and the other one is the receiver. I have the receiver print on the monitor (Serial.println) when there is a serial event on RX1. My issue is that there seems to be a lot of data that is sent on Serial1 from the sender at setup. Is there anything I can do about this?
I use serialEvent1() to handle the incoming messages.
I'll have a look at this link. It tried with basically a polling routine in the loop(), but it was still picking up the initial garbage. Not sure if the garbage is not just an artifact of the begin() function.
There should not be any data transferred over the serial lines except what your sketches explicitly write.
If you're seeing stuff that's not in the code, you may be picking up some sort of transmission line noise.
You might also check to see if hardware handshaking is configured but not physically wired.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.
Now that you say it, I think it probably is noise. It is an intermittent problem. I could reliably reproduce it when I was at home. Then yesterday I was on the road and could not reproduce it at all, no garbage on the line then. Then tonight, I get some once in a while.
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
SKIP - a book about connecting industrious people with elderly land owners