mavp2p icon indicating copy to clipboard operation
mavp2p copied to clipboard

mavp2p not routing ParamExt commands

Open sanderux opened this issue 1 year ago • 4 comments

Hi @aler9

When testing a newer version of mavp2p we found that it seems to not route ParamExt commands

[E] at D:\a\auterion-qgroundcontrol\auterion-qgroundcontrol\src\FactSystem\ParameterExt.cc:207 - "No response for param set: "CAM_NEUTRAL"" [D] at D:\a\auterion-qgroundcontrol\auterion-qgroundcontrol\src\FactSystem\ParameterExt.cc:211 - "Param set retry: "CAM_STREAM" 2" [D] at D:\a\auterion-qgroundcontrol\auterion-qgroundcontrol\src\FactSystem\ParameterExt.cc:211 - "Param set retry: "CAM_STREAM" 3" [E] at D:\a\auterion-qgroundcontrol\auterion-qgroundcontrol\src\FactSystem\ParameterExt.cc:207 - "No response for param set: "CAM_STREAM"" So AMC is sending out the parameter change to switch between EO/IR and to set the gimbal mode. Payload manager doesn't receive any param change. Looking at the mavp2p configurations sounds like a good next step

Could that be related to this commit? https://github.com/bluenviron/mavp2p/commit/217a5ca1d2af1f5b28ad5db34833a18e2660064e

sanderux avatar Dec 29 '23 08:12 sanderux

@aler9 i dove a little deeper and it seems it does route the messages but it seems to truncate the payload. Using an older mavp2p the message comes through with many bytes populated towards the end of the payload, on the new mavp2p on the first 20 or so are populated, the rest is 0x0

sanderux avatar Jan 10 '24 10:01 sanderux

@sanderux @aler9 I have also seen that when QGC or Mission Planner does not negotiate stream rates, and mavp2p is configured with --streamreqdisable I can no longer receive parameters or send commands.

Autonomost avatar Jan 25 '24 00:01 Autonomost

Hello, since #18 and #29, the router forwards messages, addressed to a certain system ID and component ID, only to the node which is broadcasting that specific system ID and component ID.

Therefore, this bug may be caused by one of the following things:

  • the router inability to route PARAM_EXT_SET messages to the desired target; this might be caused by the fact that the target doesn't broadcast its system ID or component ID and therefore the router doesn't send him the message
  • the router inability to correctly re-encode PARAM_EXT_SET messages. In order to obtain TargetSystem and TargetComponent of a message, the router has to decode the message, and then to re-encode it.

Unfortunately i don't have ready-to-use SITLs that support PARAM_EXT_SET, therefore i was not able to replicate the issue. In order to debug further, we need network dumps of the data exchanged between the control station and the router, and between the router and the drone. They can be generated in this way:

  1. Download wireshark (https://www.wireshark.org/)
  2. Start capturing on the interface used for exchanging packets (if the router and the external hardware or software are both installed on your pc, the interface is probably "loopback", otherwise it's the one of your network card)
  3. Start the router and replicate the issue
  4. Stop capturing, save the result in .pcap format
  5. Attach

aler9 avatar Apr 26 '24 11:04 aler9

024/05/03 12:34:45 mavp2p v0.0.0 2024/05/03 12:34:45 router started with 2 endpoints 2024/05/03 12:34:45 channel opened: tcp:172.20.110.10:5799 2024/05/03 12:34:45 node appeared: chan=tcp:172.20.110.10:5799 sid=2 cid=101 2024/05/03 12:34:45 node appeared: chan=tcp:172.20.110.10:5799 sid=2 cid=154 2024/05/03 12:34:45 node appeared: chan=tcp:172.20.110.10:5799 sid=2 cid=1 2024/05/03 12:34:45 node appeared: chan=tcp:172.20.110.10:5799 sid=1 cid=194 2024/05/03 12:34:45 node appeared: chan=tcp:172.20.110.10:5799 sid=1 cid=191 2024/05/03 12:34:45 node appeared: chan=tcp:172.20.110.10:5799 sid=1 cid=236 2024/05/03 12:34:46 node appeared: chan=tcp:172.20.110.10:5799 sid=1 cid=51 2024/05/03 12:34:46 node appeared: chan=tcp:172.20.110.10:5799 sid=1 cid=192 2024/05/03 12:34:46 node appeared: chan=tcp:172.20.110.10:5799 sid=1 cid=155

2024/05/03 12:32:40 &frame.V2Frame{IncompatibilityFlag:0x0, CompatibilityFlag:0x0, SequenceNumber:0xc0, SystemID:0xff, ComponentID:0xbe, Message:(*common.MessageParamExtSet)(0xc000258ba0), Checksum:0x870f, SignatureLinkID:0x0, SignatureTimestamp:0x0, Signature:(*frame.V2Signature)(nil)}, &common.MessageParamExtSet{TargetSystem:0x2, TargetComponent:0x65, ParamId:"CAM_STREAM", ParamValue:"", ParamType:0x1}

Seems like ParamValue should not be empty

sanderux avatar May 03 '24 10:05 sanderux