Like many others, I'd like to pull data as quickly as possible from my Teensy 3.2 and want to figure out the best strategy for Serial communication.
I know I can get better effective throughput by changing my code -- by sending binary data, being careful not to send redundant info, etc -- but here I am sending plain text to keep things simple. It is possible that my python listener code is causing problems and needs to be in a separate thread or should read data bytewise using PySerial's in_waiting rather than readline().
I am using windows and the Teensy USB serial driver.
Basically I don't understand:
1. the difference between send_now() and flush()
2. why I get a "corrupted" data stream using just println()
3. why I can't manage more than about ~300kbps (or ~1Mb/sec if I try to manage the corruption)
I've attached my sketch and a python script for reading and parsing the data.
The results look like this for me:
I know I can get better effective throughput by changing my code -- by sending binary data, being careful not to send redundant info, etc -- but here I am sending plain text to keep things simple. It is possible that my python listener code is causing problems and needs to be in a separate thread or should read data bytewise using PySerial's in_waiting rather than readline().
I am using windows and the Teensy USB serial driver.
Basically I don't understand:
1. the difference between send_now() and flush()
2. why I get a "corrupted" data stream using just println()
3. why I can't manage more than about ~300kbps (or ~1Mb/sec if I try to manage the corruption)
I've attached my sketch and a python script for reading and parsing the data.
The results look like this for me: