Software development
Learn more about developing the software with AIRLink and running your own custom apps.

Accessing AIRLink Mission Computer with SSH

Open Terminal and access AIRLink Mission Computer with SSH using the following command:
Copied!
You will be asked for the password, the default credentials are:
    Login: smartap
    Password: smartap
If you log in successfully you will see the following welcome page:
If you are connected to AIRLink using WiFi Access Point mode and your computer doesn't support local DNS, you would need to use IP address 10.42.0.1 instead of airlink.local.
That's all you need for the development and we assume now you know what to do :)

Root access

SSH root access is not available as standard for security and safety reasons. However, this can be provided by Sky-Drones upon request. Please contact us to get an access.

Read / Write MAVLink Telemetry data

SmartAP AIRLink provides user access for MAVLink telemetry stream which is useful for 3rd party applications development where you need to have access to the data from / to Autopilot and to / from Ground Control Station.
AIRLink supports 3 ports for user applications: 2 absolutely independent UDP ports and 1 TCP port for third party apps access:
#
Type
Host
Port
Protocol
1
UDP
127.0.0.1
14560
MAVLink
2
UDP
127.0.0.1
14561
MAVLink
3
TCP
127.0.0.1
14556
MAVLink
For developer's convenience we offer code samples for reading and writing MAVLink messages. This example displays how to read HEARTBEAT message from the other MAVLink nodes and send HEARTBEAT from our example.

UDP Example

Read / write MAVLink using UDP connection:
1
#!/usr/bin/python3
2
# Usage example of MAVLink UDP port for user applications
3
# To execute:
4
# python3 heartbeat_example_udp.py
5
# or
6
# python3 heartbeat_example.py 127.0.0.1:14560 35
7
# in this case: 127.0.0.1:14560 - address and port of mavlink source,
8
# now available 14560 and 14561 udp ports
9
# for user applications
10
# 35 - system-id for signature
11
#
12
13
import pymavlink.mavutil as mavutil
14
from pymavlink.dialects.v20 import common as mavlink
15
import sys
16
import time
17
from threading import Thread
18
19
20
if len(sys.argv) != 3:
21
# use default arguments if no arguments given from command line
22
srcSystem = mavlink.MAV_COMP_ID_USER1
23
remote_address = "127.0.0.1:14560"
24
else:
25
# use arguments from command line
26
srcSystem = int(sys.argv[2])
27
remote_address = sys.argv[1]
28
29
# create connection
30
mav = mavutil.mavlink_connection(
31
'udpout:' + remote_address, source_system=srcSystem)
32
33
34
def sender_loop():
35
while True:
36
mav.mav.heartbeat_send(mavlink.MAV_TYPE_GENERIC,
37
mavlink.MAV_AUTOPILOT_INVALID,
38
mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED,
39
0,
40
mavlink.MAV_STATE_STANDBY)
41
time.sleep(2)
42
43
44
send_thread = Thread(target=sender_loop)
45
send_thread.daemon = True
46
send_thread.start()
47
48
while True:
49
msg = mav.recv_match(blocking=True)
50
if msg.get_type() == 'HEARTBEAT':
51
print("HEARTBEAT from %d: %s" % (msg.get_srcSystem(), msg))
52
53
Copied!
Run this example with:
1
python3 heartbeat_example_udp.py
Copied!

TCP Example

Read / write MAVLink using TCP connection:
1
#!/usr/bin/python3
2
# Usage example of MAVLink TCP port for user applications
3
# To execute:
4
# python3 heartbeat_example_tcp.py
5
# or
6
# python3 heartbeat_example.py 127.0.0.1:14556 35
7
# in this case: 127.0.0.1:14560 - address and port of mavlink source,
8
# now available 14556 tcp port
9
# 35 - system-id for signature
10
#
11
12
import pymavlink.mavutil as mavutil
13
from pymavlink.dialects.v20 import common as mavlink
14
import sys
15
import time
16
from threading import Thread
17
18
19
if len(sys.argv) != 3:
20
srcSystem = mavlink.MAV_COMP_ID_USER2
21
remote_address = "127.0.0.1:14556"
22
else:
23
srcSystem = int(sys.argv[2])
24
remote_address = sys.argv[1]
25
26
mav = mavutil.mavlink_connection(
27
'tcp:' + remote_address, source_system=srcSystem)
28
29
30
def sender_loop():
31
while True:
32
mav.mav.heartbeat_send(mavlink.MAV_TYPE_GENERIC,
33
mavlink.MAV_AUTOPILOT_INVALID,
34
mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED,
35
0,
36
mavlink.MAV_STATE_STANDBY)
37
time.sleep(2)
38
39
40
send_thread = Thread(target=sender_loop)
41
send_thread.daemon = True
42
send_thread.start()
43
44
while True:
45
msg = mav.recv_match(blocking=True)
46
if msg.get_type() == 'HEARTBEAT':
47
print("HEARTBEAT from %d: %s" % (msg.get_srcSystem(), msg))
48
49
Copied!

Run the example

Run the example with the following commands:
1
# Login via SSH
3
4
# Make sure that you have the example
5
# file in your home directory and run it with
6
python3 heartbeat_example_udp.py
Copied!
Once you run the example above you should expect the following output. This is the Heartbeat message coming from the Flight Controller:
If you connect with the Ground Control Station software you will also see the heartbeat coming from the GCS:
Feel free to use these code samples for your custom apps development using SmartAP AIRLink and MAVLink communication protocol.

Get Video feed

AIRLink provides video feed access via RTSP either locally (127.0.0.1) or remotely (airlink.local). Currently, we support integrated CSI camera and HDMI input as well as NextVision cameras over Ethernet:
#
Video feed
Type
Host
Port
Address
1
CSI Camera
RTSP
127.0.0.1 or airlink.local
8554
rtsp://airlink.local:8554/camera/0
2
HDMI Input
RTSP
127.0.0.1 or airlink.local
8554
rtsp://airlink.local:8554/camera/1
3
NextVision Camera
RTSP
127.0.0.1 or airlink.local
8554
rtsp://airlink.local:8554/camera/2
To check the video stream using a standard GStreamer pipeline use the following command:
1
gst-launch-1.0 rtspsrc location=rtsp://airlink.local:8554/camera/0 ! rtph264depay ! avdec_h264 ! autovideosink sync=false
Copied!
If you have any other questions related to the software development with AIRLink please get in touch with our support team here.
Last modified 1mo ago