Herelink custom qgroundcontrol app

Hello.

I have been working on this for a while now. Long story short, I am unable to use a custom qgroundcontrol app on your remote.

In detail.
I was able to compile both herelink version and stock qgroundcontrol from github.
Used the information on your docs about overriding the stock qgroundcontrol app by flashing a custom oem partition.
Tried both. Stock app gives me a udp bind error and herelink qground shows nothing but a white screen.
By investigating further the stock app that came with the firmware keeps running and its not overridden.
Now is there a way to completely uninstall the app? I guess it would need a rooted filesystem but thats not the case i guess.
I even tried uninstalling it via adb but then it was still running under another (? root maybe) user and not letting me reinstall my version again.

Having a custom qgroundcontrol is crucial to us. We are thinking of making herelink controller our stock option with our drones. Our company makes marine drones and a flying drone app doesnt make sense. We also want to connect qgroundcontrol to our backend for data collection so we need to find a solution. We are a potentially big buyer so please respond. You could email me for a faster respond.

Thanks

Some more info.
Tried all of those steps on every firmware available. Even beta. Same outcome.

Are you using this repo?

Yes. First I compiled this version which when installed and executed gives me a white screen.
Then I compiled the mavlink version which runs successfully but at start it gives me an udp port bind error and doesn’t connect to telemetry but video feed works .
Both of them were compiled with no source code modifications whatsoever and Both are placed in the oem partition and flashed, not at the same time of course, but the stock app that comes preinstalled seems to be there and still running.

How did you know the original qgc is still running?
https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/oem-image-setup#example-app-change
In the example the custom QGC should override stock QGC.
But as you say “UDP blind error”, something should be occupying the port.

Can you try to re-flash the firmware?
https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/upgrading-firmware#flashing-firmware-ground-station
Also try to go to Android settings and force stopping the QGC before flashing your own.

I followed the instructions to the letter.
I modified the oem.img accordingly and flashed it.
I tried both versions of qgroundcontrol. Reflashed firmware to stock and retried.Same outcome. Reflashed and upgrded to beta. Still nothing.
I know because i tried to uninstall the app via adb , I cant remember the exact command I gave i am on my phone, and the app is still there , in settings apps is there and says that is installed but not for this user. If i try to reinstall at that point the app via qtcreator it fails saying this app cannot be installed.

You can’t override the stock QGC. You can disable the stock and install a custom QGC that has a slight backend name change.

You may try if it works in this way. I think those 2 QGC are conflicting on a port.

Tried to set the app name to org.mavlink.qgroundcontrol-1 and org.mavlink.qgroundcontrol1.
Still same result. I am all out of ideas.

Have you disabled the stock QGC?
Can you confirm what version does it show on your custom QGC?

I finally found a way to disable qgc that came with the controller. Now the compiled app works as expected. Version is 388aa2aaa 2020-04-19 17:41:03 +0530.

Can you run your application using Android Studio? Do you have any way to debug it?

I’m developing a custom app that also communicates using mavlink, but it is not developed from QGroundControl. However, I’m having problems sending commands to the drone (ex: sending SET MODE), and for that reason I wanted to debug the QGC source code in Android Studio, to better understand how that communication is done.

On the other hand, if you know how the QGC application is sending the modes I would appreciate it. I’ve already managed to create the buffer data correctly, and when sending that buffer via serial to pixhawk it works correctly. I’m just not understanding how I can send the same information via HereLink (I’ve tried via UDP via port 14551)

Best Regards,
Dário Pedro

I was looking to do something similar but havent found the way to disable the stock QGC… may I ask how you disabled yours?

Same boat. How can one stop the process bound to the 14550 UPD port? I can see that a process owned by root is listening on that port even when the stock QGC is not running in the foreground. All attempts to dig deeper so I can kill the process seem to run into the same issue - I need root access.

14550 is for traffic from air unit. You can’t stop it.

Thanks, Alvin. I suspected that maybe the case. Can you please explain how I can load a custom build of QGC onto a HereLink with regard to the UDP port issue? What port can I listen on with my own app, so as to communicate with the air unit?

It seems that mavlink-router is running in the background. Does that route to port 14552? I see that port is also in use. Should I use mavlink-router to route to another port e.g. 14553?

I’ve read that I can modify the OEM and reflash the controller, but is there a way I can run some proof of concepts tests before getting into a whole process with replacing the entire rootfs? Looking at the CubePilot repo, it looks like I need to merge changes from that to get full support for the HereLink hardware, which seems like another “major” task in this process, and again I’m looking to skip all that for the moment at least and just prove I can link to a real world vehicle, from the real world controller, via a fork from the mainline QGC.

14551 is the mavlink router for internal QGC communication. If you disable Herelink QGC, this will be freed and can be used by your custom QGC.

Also, if you are building from other versions of QGC (like official QGC), you will need to merge our commits. Those are the support for Herelink hardware.

I discovered the file /system/etc/mavlink-router.optimus.conf and saw how it was routing to 14551 for the stock QGC. I found I could leverage that by doing exactly as you describe (i.e. listening on that port myself while the stock app is not running). I also found the exact commit on the CubePilot QGC repo that aligns with the controller I’m working on, so I can merge those changes into my source. I’m now in good shape on all this!

Thanks for the help! I’ll be back to bug you again about something else before long. :slight_smile:

Hi,

I am also trying to build and deploy https://github.com/CubePilot/qgroundcontrol-herelink

@Alvin are we suppose to build master branch or herelink-v4.0.8 branch?

I was able to build master but when I deploy the qgc I build from the herelink repo master branch - qgc keeps crashing :confused:

Have you disabled the stock QGC on Herelink?

Hi @Alvin

Thanks for the propmt reply

yes I have disabled it through adb shell - adb shell pm disable-user --user 0 org.mavlink.qgroundcntrol

I was contemplating doing this - OEM Image Setup - CubePilot

it seems like a long process if I want to keep uploading a new version of qgc.

I was also able to build and deploy the qgc from https://github.com/mavlink/qgroundcontrol

this one does not crash but I get that udp bind error message.