Python Forum

Full Version: Receiving large data stream using Pyserial
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am having a problem where I am streaming binary data from a micro to PC and I want to graph the data. 

The data is binary data coming in around 100 kBits/sec.  So I setup a thread in python to receive the data and I save the last 2 seconds of data to an array. The issue I have ran into is that when I plot the data the receiving thread halts and appears to cause the Pyserial receive buffer to over flow.  That is the threads are not running concurrently. 

I figure I am not the first person to use Python and stream large data real time into python, does anyone have an example of how to do such a thing?

Thanks
Trampas
You may need to refer to Python's threading topic: https://docs.python.org/2/library/thread...re-example

Avoid the data to be accessed by the receiving thread and plot thread concurrently.