arduplot icon indicating copy to clipboard operation
arduplot copied to clipboard

Issue: If main loop rate is < 1000 milliseconds, values received over the socket connection are split across multiple lines in the plot.

Open lemonkey opened this issue 4 years ago • 3 comments

If you have a fast main loop where each iteration takes less than a second, due to the TCP socket polling in filter_plotter.py, it ends up appending multiple values together into a single string before sending it over to plotserialdata.py, which results in multiple different lines on the plot (legend) instead of a single line with different values.

If you slow down the main loop rate to be >= 1000 ms, it's fine.

lemonkey avatar Jul 31 '22 06:07 lemonkey

It seems to be tied to the hardcoded interval=1000 for the animation function.

ani = animation.FuncAnimation(fig, animate, interval=1000)

lemonkey avatar Jul 31 '22 07:07 lemonkey

FYI, my current fix is to use 100 for the animation interval.

lemonkey avatar Jul 31 '22 07:07 lemonkey

@lemonkey Thank you for sharing your investigation and the finding. I think your finding will be a good FAQ for future. I'll close this issue and put your finding in the Wiki.

yhur avatar Jul 31 '22 12:07 yhur