Skip to content

Tips, tricks, and hacks

Chris edited this page Apr 13, 2022 · 24 revisions

This page will have instructions for cool things to do with your DJI gear.

Editing files on the device

Once connected to goggles or airunit via adb, you have busybox to your disposal. Unfortunately most of the functions are not symlinked, but it is easy to do so yourself:

ln -s /sbin/busybox /system/bin/vi

Instead of running:

busybox vi /path/to/file

You can now run:

vi /path/to/file

The same can be done for other busybox functions you are interested in like ping, unzip, wget or less. A full set of functions will be shown if you simply run busybox without any parameters.

Those symlinks will persist between reboots and powercycles.

Internet connectivity

For different use-cases it might be important for you to have internet access on your goggles or air-unit when connected to the PC. In order to do so, you have to share your internet connection from your PC to your goggles or airunit.

Linux

On Linux you should see a new USB Ethernet network device popping up when attaching the goggles or air unit, you can verify this by running ifconfig with no hardware connected and then again with the hardware connected, it might look something like this:

enp3s0f0u4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:c4:22:af:83:d8  txqueuelen 1000  (Ethernet)
        RX packets 9  bytes 592 (592.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

For the sake of example my device with Internet connection is enp34s0.

On the Linux computer we now:

  1. Create a bridge
  2. Add devices to the bridge
  3. Bring the bridge up
sudo ip addr flush dev enp34s0
sudo ip addr flush dev enp3s0f0u4
sudo brctl addbr br0
sudo brctl addif br0 enp34s0 enp3s0f0u4
sudo ip link set dev br0 up

On the goggle or airunit we only need to run dhcptool:

dhcptool rndis0

We can now check with ifconfig that we received an IP from our local router:

rndis0    Link encap:Ethernet  HWaddr 8A:4C:79:BE:5B:DF
          inet addr:192.168.1.21  Bcast:192.168.1.255  Mask:255.255.255.0 
          inet6 addr: fe80::884c:79ff:febe:5bdf/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:358 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:60017 TX bytes:15260 

use ping to test that we can in fact connect to the outer world:

ping 1.1.1.1

DNS

Unfortunately DNS resolution is broken with the busybox tools like ping, wget and nslookup and this seems to be a known issue:

There are known issues with DNS functionality in statically-linked glibc programs (like busybox in this case), because libnss must be dynamically loaded. Building a uClibc toolchain and linking busybox against that would resolve this.

You can get an official busybox build, push that to your goggles/airunit and use that instead:

wget https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv7m
adb push busybox-armv7m /blackbox
adb shell
chmod a+x /blackbox/busybox-armv7m

Now you can link the applets that require DNS resolution to this version of busybox:

ln -s /blackbox/busybox-armv7l /system/bin/ping
ln -s /blackbox/busybox-armv7l /system/bin/wget
ln -s /blackbox/busybox-armv7l /system/bin/nslookup

Windows

TODO...

Clone this wiki locally