I'm trying to communicate with hardware over USB CDC and Raspberry Pi 3. When the hardware is plugged in it shows as /dev/ttyACM0 and I can open the serial port. However I am never receiving any data. The hardware is sending data and I can see it when I plug it into my PC, but when connected to the Pi nothing seems to be received.
This is a stripped down python script I've tried to use to see if any data is coming through - it will just keep waiting for data that never arrives. I've tried changing the settings and using serial.inWaiting(), but nothing seems to work.
import serial import time port = serial.Serial( port='/dev/ttyACM0', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=None, ) port.setDTR(1) while True: time.sleep(1) command = port.read() print command
Is there anything specific I need to do on the Pi 3 in order to receive data?