alduxvm / pyMultiWii

MultiWii Serial Protocol (MSP) API to send and receive data from firmware using MSP
GNU General Public License v3.0
153 stars 84 forks source link

Error in sendCMDreceiveATT. (tuple index out of range) #33

Open EonAndahalf opened 4 years ago

EonAndahalf commented 4 years ago

Hello!

I'm getting an error in the terminal:

Error in sendCMDreceiveATT. (tuple index out of range)

I'm using a Jetson nano (Ubuntu 18.04 (Python 3.6.9) ) to control a Mamba F405 FC over serial port, with the example code:

data = [1500,1500,1000,1500,1000,1000,1000,1000] board.sendCMDreceiveATT(16,MultiWii.SET_RAW_RC,data)

Everything else is working fine except sending channel data. The weird thing is that the flight controller is receiving every channel data from my script and I can actually control the FC, except that error.

Thank you in advance!

alduxvm commented 4 years ago

Did you activated serialRX on the GUI of the flight controller?

alduxvm commented 4 years ago

Also, I will recommend to use the sendCMD function, not the send and receive...

EonAndahalf commented 4 years ago

Hi ! "Did you activated serialRX on the GUI of the flight controller?"

If you mean on the Ports tab, then I have activated MSP on UART3, as that is where I connect the Jetson Nano. ( J41 GPIO pins on jetson nano to UART3 on the Flight controller ) as for the serialRX it is activated on UART1 by default. Betaflight is not allowing me to simultaneously activate MSP and serialRX on UART3. Not really sure where serialRX is supposed to be activated.

"Also, I will recommend to use the sendCMD function, not the send and receive..."

The sendCMD function requires an argument: 'data_format', and I cant seem to find what format that has to be.

EonAndahalf commented 4 years ago

Also the "Receiver" section in the "Configurations" tab is set to: "MSP RX input (control via MSP port)"

alduxvm commented 4 years ago

regarding serialRX... thats an specific section of the flight controller firmware, not from the companion computer. What firmware are you running on the flight controller? baseflight or betaflight?

if the above is not configured properly you will never be able to send commands to the flight controller. Also, you can see the function arm/disarm to see how to use the sendCMD function... but as I mentioned before, if you do not solve the first section of the configuration of the flight controller, the rest will not work... Also, in some flight controllers, only one input is used... if you have a radio hooked to the flight controller you need to remove it or you will not be able to write the commands to the FC... that totally depends on the firmware you're using on the FC

Niko-La commented 9 months ago

@EonAndahalf did it work?