[SOLVED] Weird responses from Multiwii... sometimes

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
jaumemiralles
Posts: 12
Joined: Tue Mar 22, 2016 5:41 pm

[SOLVED] Weird responses from Multiwii... sometimes

Post by jaumemiralles »

Hi, i can't go further, hope some have a new idea. Thanks in advance...

I'm trying to read telemetry and set RC values via MSP protocol. I can build correctly (at least i think so) the frames based on protocol, and it seems i get to connect to Multiwii via UART correctly. BTW it's a Crius Multiwii SE 2.6.

The weird thing is how Multiwii is responding. One time it responds with a correct "62" type frame after i send a "60" type query. BUT the next time i run my application I get a short response (4-6 bytes) that makes no sense to me. BUT, the next time i run my app, all seems correct again... and so on

I'm aware that I have to be persistent on sending instructions repeatedly. I have checked to do it with single frame, also repeatedly in a for loop, also repeatedly in a thread... also with several commands like MSP_IDENT, MSP_ALTITUDE, MSP_SET_RAW_RC.... also I tried with two different Multiwii boards... Anyway: always the same odd behavior alternating coherent and no-sense responses, for each try.

My suspect is that i'm not initializing multiwii serial stuff correctly, but I don't have any idea as I can't find clear documentation.

Any light to guide me?? Thank you!
Last edited by jaumemiralles on Fri Jun 10, 2016 8:55 am, edited 1 time in total.

jaumemiralles
Posts: 12
Joined: Tue Mar 22, 2016 5:41 pm

Re: Weird responses from Multiwii... sometimes

Post by jaumemiralles »

I'm glad to say I found the problem.

It's not about Multiwii.

I'm using a Raspi to communicate with Multiwii.

I had the idea to test UART on Raspi, so I made a loopback between RX/TX pins.... and i got a message like "Raspberry Login GNU/Linux...". Then I realized I was having a conflict with the UART port. And so, I've seen Raspi BY DEFAULT offers it's UART as a terminal where you can login. So, the next step is disabling it, provided you can login via another protocol like ssh

The steps on this link didn't work for me (http://www.raspberrypi-spy.co.uk/2013/1 ... rial-port/) as I didn't find "/etc/inittab" on my Raspian distribution.

An easier solution for me was the Raspi Config Menu:
- Invoke it with 'sudo raspi-config'
- 'Advanced Options'
- 'A8 Serial...' --> Disable
- Reboot

And the problems with serial UART are gone

gregd72002
Posts: 103
Joined: Fri Dec 12, 2014 5:16 pm

Re: Weird responses from Multiwii... sometimes

Post by gregd72002 »

yep, you need to disable the console on ttyAMA0 :)
Btw, if you interested I've written a MSP library in C that connects to MW and handles all the messaging.
https://github.com/rpicopter/mw-service

It is tested on RPi :)

jaumemiralles
Posts: 12
Joined: Tue Mar 22, 2016 5:41 pm

Re: Weird responses from Multiwii... sometimes

Post by jaumemiralles »

Thanks gregd72002, i'll take a look!
I'm on the same with java.
Let's stay in touch for if we can help each other

Post Reply