Custom Ionic Application for HereLink - problems sending commands

@Michael_Oborne can you have a look at this problem?

so they way mavlink router works is it respond to the location that sent the packet.

ie when you send a packet, the origin is recorded, this is the udp ip and port of the origin. mavlink router will reply to this.

so you need to listern for packets back on the port your app sends from.

ie dsSend is a socket, you need to listern for packets on this socket, not go creating new sockets

Hi.

That’s the idea I got from the other mentioned post, but after a few attempts, we did not manage to make it work (sending and listening to the same port).

Example full code:

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.io.IOException;
import java.net.SocketException;
import java.net.UnknownHostException;
// Cordova-required packages
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaArgs;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;

public class HerelinkUdpPlugin extends CordovaPlugin {
    private static DatagramSocket ds;
    static {
        try {
            ds = new DatagramSocket();
            ds.connect(InetAddress.getByName("127.0.0.1"), 14552);
        } catch (SocketException | UnknownHostException e) {
            e.printStackTrace();
        }
    }

  @Override
  public boolean execute(String action, CordovaArgs args,
    final CallbackContext callbackContext)  {
      // Verify that the user sent a 'show' action
      if (action.equals("bind")) {
          cordova.getThreadPool().execute(() -> bind(callbackContext));
      } else if (action.equals("write")) {
          write(callbackContext, args);
      } else {
        callbackContext.error("\"" + action + "\" is not a recognized action.");
        return false;
      }
      return true;
  }

  public void write(final CallbackContext callbackContext, CordovaArgs args) {
      try {
          JSONArray objectToTransform = args.getJSONObject(0).getJSONObject("mavlinkmessage").getJSONArray("data");
          byte[] mavlinkMessage = new byte[objectToTransform.length()];
          for (int i = 0; i < objectToTransform.length(); i++) {
              mavlinkMessage[i]=(byte)(((int)objectToTransform.get(i)));
          }
          DatagramPacket dp = new DatagramPacket(mavlinkMessage, mavlinkMessage.length, InetAddress.getByName("127.0.0.1"), 14552);
          ds.send(dp);
          PluginResult dataResult = new PluginResult(PluginResult.Status.OK, dp.getData());
          callbackContext.sendPluginResult(dataResult);
      } catch (IOException | JSONException e) {
          e.printStackTrace();
      }
  }

  public void bind(final CallbackContext callbackContext) {
    byte[] lMsg = new byte[280];
    try {
        DatagramPacket dp = new DatagramPacket(lMsg, lMsg.length);
        byte[] probe = new byte[32];
        DatagramPacket outListen = new DatagramPacket(probe, probe.length,  InetAddress.getByName("127.0.0.1"), 14552);
        ds.send(outListen);
        while (!ds.isClosed()) {
            ds.receive(dp);
            PluginResult dataResult = new PluginResult(PluginResult.Status.OK, dp.getData());
            dataResult.setKeepCallback(true);
            callbackContext.sendPluginResult(dataResult);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
  }
}

Message we are trying to send (Command Long - RTL):

objectToTransform = [253,33,0,0,0,1,1,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,1,1,207,76]

Note: the result is the same either if we use 14550, 14551, or 14552.

@Michael_Oborne is there anything we are missing? Anything we doing wrong?

so the static init of ds seems ok
the bind function looks as though it would work at first glance

because its a udp connection, does isClosed ever return false?

The close variable of the udp connection is always false. We keep receiving data, we just cannot send anything…

image

in your send
can you use this
DatagramPacket (byte[] buf, int length)

the destination is already defined in the socket init.

Hi @Michael_Oborne,

Always removing the IP and port seems to solved the issue. Thank you.

1 Like

@Michael_Oborne sorry to bother you again.

It seems to work to send and receive messages. However, after sending the first message, the set of messages received change. It seems that the RC controller loses the listening connection to the UAV.

Before sending the 1st message:

After sending the message:

Are we somehow taking control of port 14552, and for that reason, stop listening to the UAV info? Do we need to re-send any other type of message so the UAV keeps sending data?

Note: For testing, the message we’re sending is an RTK.

each port can only have one client, so ensure your send code is only using one socket.

if your running on the herelink itself use
127.0.0.1 14551

if on the wifi then use the port 14552

if using wifi hotspot, you can use port 14550

We are using an app, that will run on the herelink itself. However, we can only connect to the 14552 port. The 14551 outputs W/System.err: java.net.PortUnreachableException: ICMP Port Unreachable.

Source code:

package com.beyondvision.cordova.plugin;
import android.util.Log;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.io.IOException;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Arrays;
// Cordova-required packages
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaArgs;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;

public class HerelinkUdpPlugin extends CordovaPlugin {
    private static DatagramSocket ds;
    static {
        try {
            ds = new DatagramSocket();
            ds.connect(InetAddress.getByName("127.0.0.1"), 14551);
        } catch (SocketException | UnknownHostException e) {
            e.printStackTrace();
        }
    }

    @Override
    public boolean execute(String action, CordovaArgs args,
                           final CallbackContext callbackContext)  {
        // Verify that the user sent a 'show' action
        if (action.equals("bind")) {
            cordova.getThreadPool().execute(() -> bind(callbackContext));
        } else if (action.equals("write")) {
            write(callbackContext, args);
        } else {
            callbackContext.error("\"" + action + "\" is not a recognized action.");
            return false;
        }
        return true;
    }

    public void write(final CallbackContext callbackContext, CordovaArgs args) {
        try {
            JSONArray objectToTransform = args.getJSONObject(0).getJSONObject("mavlinkmessage").getJSONArray("data");
            byte[] mavlinkMessage = new byte[objectToTransform.length()];
            for (int i = 0; i < objectToTransform.length(); i++) {
                mavlinkMessage[i]=(byte)(((int)objectToTransform.get(i)));
            }
            DatagramPacket dp = new DatagramPacket(mavlinkMessage, mavlinkMessage.length);
            ds.send(dp);
            PluginResult dataResult = new PluginResult(PluginResult.Status.OK, dp.getData());
            callbackContext.sendPluginResult(dataResult);
        } catch (IOException | JSONException e) {
            e.printStackTrace();
        }
    }

    public void bind(final CallbackContext callbackContext) {
        byte[] lMsg = new byte[250];
        try {
            DatagramPacket dp = new DatagramPacket(lMsg, lMsg.length);
            byte[] probe = new byte[16];
            DatagramPacket outListen = new DatagramPacket(probe, probe.length);
            ds.send(outListen);

            while (!ds.isClosed()) {
                ds.receive(dp);
                byte[] result = dp.getData();
                Log.i("[MAVLINK READ]", Arrays.toString(result));
                PluginResult dataResult = new PluginResult(PluginResult.Status.OK, result);
                dataResult.setKeepCallback(true);
                callbackContext.sendPluginResult(dataResult);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

By using the port 14552 instead of the 14551, we can receive data, such as the following:

2021-08-03 09:37:17.076 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 28, 0, 0, -67, 1, 1, -93, 0, 0, 125, 93, -125, -69, 66, -2, -18, -71, 74, -7, -33, 59, 0, 0, 0, 0, 0, 0, 0, 0, 39, 6, -99, 58, 80, 26, -74, 58, 2, -39, 0, 0, 0, 0, -20, 3, 0, 0, -19, 3, 0, 0, 39, 1, 55, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:37:17.082 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 2, 0, 0, -66, 1, 1, -91, 0, 0, 28, 20, -15, -107, 66, -2, -18, -71, 74, -7, -33, 59, 0, 0, 0,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 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 28, 0, 0, -62, 1, 1, 32, 0, 0, 70, -65, 26, 0, -69, 73, 92, 65, -42, 56, -127, -63, -6, 104, -103, 64, 38, -115, 4, 61, -92, -68, -34, 60, 22, 114, -37, -68, 8, -51, 0, 0, 0, 0, -20, 3, 0, 0, -19, 3, 0, 0, 39, 1, 55, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:37:17.118 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 20, 0, 0, -61, 1, 1, -15, 0, 0, 91, 44, 123, 104, 0, 0, 0, 0, 43, 0, -38, 60, 41, -60, -74, 60, 3, -60, -28, 60, -56, 92, -34, 60, 22, 114, -37, -68, 8, -51, 0, 0, 0, 0, -20, 3, 0, 0, -19, 3, 0, 0, 39, 1, 55, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:37:17.144 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 18, 0, 0, -58, 1, 1, 74, 0, 0, 11, -41, 35, 61, -83, 74, 47, 61, 92, 79, 55, 67, 103, 71, -35, 60, 34, 1, 6, 7, -98, -25, -123, -70, -60, -53, -111, 58, 9, 98, -1, -1, 0, 0, 0, 100, -106, 83, -19, 3, 0, 0, 39, 1, 55, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:37:17.152 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 12, 0, 0, -57, 1, 1, -78, 0, 0, -56, -54, 50, 57, -16, -16, -87, -68, 36, -53, -106, -65, -96, -27, -35, 60, 34, 1, 6, 7, -98, -25, -123, -70, -60, -53, -111, 58, 9, 98, -1, -1, 0, 0, 0, 100, -106, 83, -19, 3, 0, 0, 39, 1, 55, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:37:17.159 14736-15952/io.ionic.starter I/[MAVLINK READ]: [-3, 24, 0, 0, -56, 1, 1, -74, 0, 0, -32, 42, 83, 58, 83, -60, -105, -68, -122, -54, -102, -65, 92, 79, 55, 67, 20, -97, 22, 23, -111, -63, -128, -6, -81, 127, -111, 58, 9, 98, -1, -1, 0, 0, 0, 100, -106, 83, -19, 3, 0, 0, 39, 1, 55, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

The only problem with 14552, is whenever we send a single mavlink message to that port, it seems that the port loses connection with the UAV, and only outputs HEARBEATS and RADIOSTATUS:

2021-08-03 09:47:37.000 17573-17661/io.ionic.starter I/[MAVLINK READ]: [-3, 8, 0, 0, 95, 42, -6, 109, 0, 0, 0, 0, 0, 0, 62, 0, 0, 93, 4, 97, -117, -99, -103, -65, -105, 22, 104, 81, 22, 23, -89, -63, -128, -6, -113, -4, -81, -70, -47, -115, 0, 0, 0, 0, 37, 4, 0, 0, 69, 4, 0, 0, -84, 67, 53, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:47:37.024 17573-17661/io.ionic.starter I/[MAVLINK READ]: [-3, 8, 0, 0, 97, 42, -6, 109, 0, 0, 0, 0, 0, 0, 63, 0, 0, 94, -118, 70, -117, -99, -103, -65, -105, 22, 104, 81, 22, 23, -89, -63, -128, -6, -113, -4, -81, -70, -47, -115, 0, 0, 0, 0, 37, 4, 0, 0, 69, 4, 0, 0, -84, 67, 53, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:47:37.025 17573-17661/io.ionic.starter I/[MAVLINK READ]: [-3, 8, 0, 0, 98, 42, -6, 109, 0, 0, 0, 0, 0, 0, 63, 0, 0, 96, 70, -78, -117, -99, -103, -65, -105, 22, 104, 81, 22, 23, -89, -63, -128, -6, -113, -4, -81, -70, -47, -115, 0, 0, 0, 0, 37, 4, 0, 0, 69, 4, 0, 0, -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2021-08-03 09:47:37.188 17573-17661/io.ionic.starter I/[MAVLINK READ]: [-3, 16, 0, 0, 6, 1, -16, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, -100, 86, -81, -103, -65, -105, 22, 84, 94, 22, 23, -89, -63, -128, -6, -113, -4, -81, -70, -47, -115, 0, 0, 0, 0, 37, 4, 0, 0, 69, 4, 0, 0, -84, 67, 53, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

Note: On this print the byte values appear as negative by JAVA convention, but if you look at my previous message, the parse handles it well.

the difference here is nothing to do with the packets, its to do with the source. in the seconds log i see no traffic from the drone, the first one i do… was the drone on?

Yes the drone was on. The only difference between logs, is that in the second is after we send a message to the drone. This happens every time we send a message. Afterwards, to receive data again, the only solution is to reboot the RC controller. My guess is that it was to do with the mavlink router on the Herelink RC. But I don’t know how to fix it.

i think you are sending from the wrong sysid/compid, and causing a routing issue with mavlink router
use
sysid 255
compid of 190

I changed the sysid and comid and obtained exactly the same results

objectToTransform = [253,33,0,0,0,1,1,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,1,1,207,76]

=
image

2021-08-03 09:47:37.188 17573-17661/io.ionic.starter I/[MAVLINK READ]: [-3, 16, 0, 0, 6, 1, -16, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, -100, 86, -81, -103, -65, -105, 22, 84, 94, 22, 23, -89, -63, -128, -6, -113, -4, -81, -70, -47, -115, 0, 0, 0, 0, 37, 4, 0, 0, 69, 4, 0, 0, -84, 67, 53, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

=

image

What do you mean by this message?

Hello @Michael_Oborne after using component ID 190 we finally managed to make 14552 bidirectional and we can now send and receive messages. However, One thing we noticed is that we have 3 heartbeats and we don’t know where it’s coming from.

Any idea?

Additionally, can anyone point me to an implementation of the video stream on a custom app? I just want to display the video in a similar way to QGC. Any IP:port that I need to connect via RTSP ?

3 hb’s are from
1 drone
1 camera service
1 board service

and
rtsp://192.168.0.10:8554/H264Video

i have a sample app here