Servers by jDrones

Garbage/noise characters being generated over direct serial connection

(Rick) #1

I am running MAVProxy on a companion computer with a -out 127.0.0.1:9001 relay to communicate with some processes on the CC.

I’m using a Cube Black and I’ve tried it with a Pi3 over USB and a TX1 over UART. In both cases, I get garbage characters appearing whenever I send MAVLink commands relayed through MAVProxy. For example, here I am sending a baro calibration request:

LOITER>
LOITER> ArkmI_
TLWD=xi=B\`=|D<1 3bomAM">o!<ZYy!,\xANB`e=po<0}zsIn:;Geh*[
#H8K>:=Z X4t6?.?L=' 2<^[4_JL7="=RAPM: Calibrating barometer
APM: Barometer calibration complete
Got MAVLink msg: COMMAND_ACK {command : 241, result : 0}
Calibrated

The garbage appears less often at lower baudrates. I might expect some noise when connected over radio, but a direct serial or USB connection shouldn’t do this. In fact, some of the garbage chunks contain legible pieces such as garbled parameter names, so it’s not just random noise. I’m guessing that mavlink messages are somehow colliding, but I’m not sure what I did wrong. Any hints?

(Fj) #2

I had similar issue, i found this:

Frequently Asked Questions and Issues

I have random “noise” displaying on the console, showing as corrupted text. How do I remove it?

MAVProxy will, by default, show corrupted packets. To disable showing them, use set shownoise false in the MAVProxy console.

https://ardupilot.github.io/MAVProxy/html/getting_started/faq.html

(Rick) #3

Yeah, I found that also, but turning off the displaying of noise doesn’t solve the issue. Usually, the noise is from corrupt radio telemetry packets, but in my case, I’m using a direct serial or USB connection which shouldn’t have so much corruption.

(Rick) #4

I ran MAVProxy with the --show-errors option. I got a lot of these errors:

MAV error: BAD_DATA {invalid MAVLink CRC in msgID 22 0x6c88 should be 0x42a8, data:['fe', '19', '33', '1', '1', '16', '33', '33', 'ab', '41', '15', '3', 'ff', 'fe', '1e', '34', '1', '1', '18', '80', '20', '33', '93', '2', '0', '0', '0', '41', '7d', '5c', '16', '88', '6c']}
MAV error: BAD_DATA {Bad prefix, data:['41']}
MAV error: BAD_DATA {Bad prefix, data:['b7']}
[...]

What could cause crc errors? These errors appear regularly and it’s over a very short wired connection, so link noise and corruption are unlikely. Am I sending the wrong Mavlink version messages?

(Stephen) #5

Have you tried with different computers/laptops? Just to rule out a hardware issue.

Most likely not, but you can use the --mav10 or --mav20 arguments in MAVProxy startup to force the version of Mavlink to use.

(Rick) #6

Yeah, I tried a Pi 3 and a TX1. On both, I tried a serial UART and USB connection. Same results.

Tried this also, no combination of --mav options and SERIAL_PROTOCOL setting seemed to change anything.

One thing to note is that baudrate strongly affects how many errors I get. At 57600 baud, I get no errors at all until I do something with a high communication load like start a log download, at which point the errors trickle in. At 1500k baud I get a constant flood of errors, even when idle.

(Rick) #7

Also found that it seems to have nothing to do with my companion computer process. Just running MAVProxy by itself without a relay results in the same problem. And the invalic CRC isn’t the only error, I variously get

  • unknown MAVLink message ID
  • invalid MAVLink CRC
  • incompat_flags

But they’re probably all probably coming from the same problem of not parsing mavlink messages correctly… or something.

(Mike Boland) #8

It looks more like you are missing flow control in your connection.
Maybe one side is using XonXoff and the other RTS/CTS??

(Rick) #9

I don’t have flow control connected. I did have BRD_SER2_RTSCTS = 2, so I set it to 0 in case it was not detecting correctly but I still get errors. Also I originally encountered this issue when connecting over USB, although I haven’t tried that again in a while.

(Rick) #10

I found that I get LOT of errors on Copter 3.5.7, but much fewer errors on Copter 3.6.10.
In all cases, I’m using MAVProxy 1.8.8 and pymavlink 2.3.4

(Stephen) #11

You could try upgrading your pymavlink. I think 2.3.8 is the latest.

Also, which flight controller hardware are you using?

(Rick) #12

Cube Black.

Updated to MAVProxy 1.8.12 and pymavlink 2.3.8. No errors yet, testing continues…