Page 1 of 1
Serial communication from pyboard to pc
Posted: Thu Mar 05, 2015 5:04 pm
by slzatz
My question is related to the fact that I want to communicate programmatically between a pyboard and a raspberry pi although this would obviously apply to any pc. The pyboard.py module running on the pc receives data over USB from the pyboard through print statements in the python code running on the pyboard. It all seems to work pretty reliably but I am asking whether when using USB that is the preferred way to move data from the pyboard to a PC. In my particular case, I am using the raspberry pi as the web client to then move pyboard collected data into the cloud since I've found running a CC3000 on the pyboard to be less than completely reliable. Any thoughts or pointers would be appreciated.
Re: Serial communication from pyboard to pc
Posted: Thu Mar 05, 2015 5:23 pm
by dhylands
You can use USB serial, or a real serial port. The USB serial will generally be faster.
You can talk to the USB serial port using reads and writes by using the
USB_VCP class, then it's quite easy to switch between using a real serial port or the USB serial port.
On the raspberry pi side, the USB serial port just looks like a regular linux serial port. It should show up as /dev/ttyACM0.
I wrote a little python program (needs real python) which will identify your serial ports for you (linux only) called
find_port.py
Re: Serial communication from pyboard to pc
Posted: Thu Mar 05, 2015 7:51 pm
by slzatz
Thanks much, I had missed the existence of the pyb.USB_VCP class -- that's just what I was looking for.
And thanks for link to port identification script.