-
Notifications
You must be signed in to change notification settings - Fork 9
Overlapping messages #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Stand corrected, the serial.flush() reduced the problem but still getting a random few overlapping messages on the network arduino. Serial console on the first alarm panel aruino is showing just fine so the problem is with the timing on the serial connection to the second arduino when the incoming alarm panel message come in too close together. Seems to only happen on the display message but the overlapping message that cuts in could be a status message or a display message which I think is due to the display message being significantly longer. Still researching this problem. |
Is the message that cuts in complete and then the original message finishes or do they intertwine?
or
|
I changed the Json into a much smaller packet so it fits in the 64bit serial limit and to keep it small as possible. Your core structure is the same, just different message format in your Json section. Here are some sample collisions. In all cases, the second message cuts into the first message and the first message never completes and the second message takes over and prints in full. |
On occasion the Serial.read() on my network arduino would get overlapping messages from the Alarm Panel arduino on the Serial.println() when the display message and the status message were really close together on an event change like arming system. The Serial.read() would start getting the Display message and then the Status message would cut in and would get a mixed string of display and status. A quick fix to that was to add Serial.flush(); to the end of each Display and Status message. So far that seems to be working great with no issues. Just thought I would pass that along.
The text was updated successfully, but these errors were encountered: