I want to implement multiwii serial protocol by pyserial
import pyserial
import struct
ser = serial.Serial('/dev/ttyUSB0', 115200)
str = struct.pack('!cccBBB', 'M', '$', '<', 0, 100, 155) # simple MSP_IDENT
print ser.write(str)
print ser.read(3)
above program hang in ser.read.....can you help me?
msp implement help
-
- Posts: 3
- Joined: Fri Mar 15, 2013 5:23 am
Re: msp implement help
i sloved it self
import pyserial
import struct
ser = serial.Serial('/dev/ttyUSB0', 115200)
str = struct.pack('cccBBB', '$', 'M', '<', 0, 100, 100) # simple MSP_IDENT
print ser.write(str)
ser.flush()
print ser.read(3)
import pyserial
import struct
ser = serial.Serial('/dev/ttyUSB0', 115200)
str = struct.pack('cccBBB', '$', 'M', '<', 0, 100, 100) # simple MSP_IDENT
print ser.write(str)
ser.flush()
print ser.read(3)