# MSP (Multiwii Serial Protocol) receiving data with pyMultiWii issue

I want to get telemetry data from my flight controller (Matek F405-CTR) and send control commands to it via MSP protocol.

I've already configured UART3 port on Matek in Inav configurator (look at pic).

Then I connected usb-serial converter (CP2102) to Matek on UART3 port for testing. So that, Matek controller is defined as COM3 on my PC and CP2102 as COM4

But when I'am trying to run simple test from pyMultiWii lib I get nothing from Matek controller neither from CP2102. I've tried this test for COM3 and COM4 ports as well.

#!/usr/bin/env python

"""show-attitude.py: Script to ask the MultiWii Board attitude and print it."""

from pymultiwii import MultiWii
from sys import stdout

if __name__ == "__main__":

board = MultiWii("COM4")
#board = MultiWii("COM3")
try:
while True:
board.getData(MultiWii.ATTITUDE)
#print board.attitude #uncomment for regular printing

# Fancy printing (might not work on windows...)
message = "angx = {:+.2f} \t angy = {:+.2f} \t heading = {:+.2f} \t elapsed = {:+.4f} \t".format(float(board.attitude['angx']),float(board.attitude['angy']),float(board.attitude['heading']),float(board.attitude['elapsed']))
stdout.write("\r%s" % message )
stdout.flush()
# End of fancy printing
except Exception as error:
print("Error on Main: "+str(error))


May be I'am doing something wrong? I've already read this post, but it dosn't help me. Any advice will be appreciated!

• After some checking seems that pyMultiWii lib doesnt work.. The is a problem in sendSMD() function, I've checked it separately. An error occurs in this function: "ord() expected string of length 1, but int found". So that, everything after this line of code doesn't work. Actually, getData() in example that I've posted doesn't work, it puts just pre-defined self parameters, to be exact - zeros. Thats why I have zeros in the output. – mr.boris Jul 19 '18 at 17:08