I'm sending data to PyBoard from my laptop via USB. As you can see - I have to sleep() on each send, otherwise PyBoard blinks with green and red LEDs and just hangs its work.
Here is the receiver part.
I would agree to sleep() once per while-loop iteration, not per line being sent. Is there any limits regarding to that? Speed, amount of data, amount of "write()" calls etc.
USB_VCP buffer
Re: USB_VCP buffer
If it's doing the blinky light thing (probably a hard fault) then I think that's a bug.
Sending data from the pyboard to the host there is a 1K buffer for USB data. Once the buffer fills up, and there is a host connected, then I think that the sender is supposed to block and wait for the buffer to go down. If there is no host connected then I think that the data winds up getting dropped.
Sending data to the pyboard from the host there is also a 1K buffer. I believe that in this direction, the pyboard winds up dropping the data once the buffer gets full since it doesn't have anyplace to put it.
What I do in rshell is that I sent some data (upto about 512 bytes) and then wait for an ACK. Then send some more data, etc.
Sending data from the pyboard to the host there is a 1K buffer for USB data. Once the buffer fills up, and there is a host connected, then I think that the sender is supposed to block and wait for the buffer to go down. If there is no host connected then I think that the data winds up getting dropped.
Sending data to the pyboard from the host there is also a 1K buffer. I believe that in this direction, the pyboard winds up dropping the data once the buffer gets full since it doesn't have anyplace to put it.
What I do in rshell is that I sent some data (upto about 512 bytes) and then wait for an ACK. Then send some more data, etc.
Re: USB_VCP buffer
hm... I'm sending 3 lines that may not reach even 512 bytes in total. Need to investigate more then...
Re: USB_VCP buffer
Ok, my double fault. First is that I'm sending "lines" without line endings, while reading them with "readline()". So I'm getting all 3 at once. Then happens second fault - code unable to handle so many parts from such big string explosion by comma.
Thanks for info )
Thanks for info )