← Back to rtk-easy.eu
U2 · RTK-EASY Rover/Autopilot

RTK Autopilot REST API — User Guide

This guide is for a user or integrator familiar with REST principles. It describes which HTTP requests RTK AUTOPILOT supports, what data is sent, and what each request is used for.

Assume the RTK AUTOPILOT IP address is 192.168.1.120. All API addresses then start with http://192.168.1.120/api/...

User Guide

Contents
  1. Device status
  2. Waypoint list
  3. Add current position as a waypoint
  4. Save points as a line
  5. Save points as an area
  6. Delete the last waypoint
  7. Delete all waypoints
  8. Configure the waypoint/route server
  9. Send waypoints to the route server
  10. What the route server should return
  11. Load a route from the server
  12. Start the autopilot
  13. Stop the autopilot
  14. Manual driving
  15. Typical workflow
  16. Quick reference

1. Getting device status

GET /api/status

Returns the current RTK AUTOPILOT status.

Example response

{
  "wifiBars": 4, "qlt": "FIX", "sats": 24, "age": 0.5,
  "ntrip": "Connected", "battery": 12.48, "connMode": "ntrip",
  "dataFmt": "NMEA", "apMode": true,
  "lat": 54.89876543, "lng": 23.91234567, "alt": 82.315,
  "heading": 127.4, "rmcHeading": 126.9, "fixHeadHeading": 127.4,
  "autopilotHeadingSource": "fixhead", "autopilot": true,
  "wpIndex": 3, "wpCount": 12, "activeRoute": 1,
  "serverEnabled": true, "serverRouteLoaded": true,
  "serverWpCount": 85, "serverStatus": "LOADED", "apError": ""
}

Key fields

FieldMeaning
wifiBarsWi-Fi signal strength
qltGNSS position quality, e.g. GPS, FLOAT, FIX
satsNumber of satellites in use
ageAge of RTK corrections
ntripNTRIP connection status
batterySupply voltage
lat / lngCurrent latitude / longitude
altAltitude
headingCurrent heading, in degrees
autopilottrue — the autopilot is running; false — it is not
wpIndexIndex of the waypoint currently being driven to
wpCountNumber of waypoints stored locally
serverRouteLoadedWhether a route from the server has been loaded
serverWpCountNumber of waypoints in the server route
apErrorAutopilot error text, if any

2. Getting the waypoint list

GET /api/wp/list

Returns the waypoints held in RTK AUTOPILOT's memory.

{
  "count": 3, "max": 300, "activeRoute": 0, "serverEnabled": true,
  "points": [
    { "id": 1, "lat": 54.89876543, "lng": 23.91234567, "alt": 82.315,
      "route": 0, "closed": false, "quality": "FIX" }
  ],
  "serverCount": 0, "serverPoints": []
}

points — waypoints collected by the user. serverPoints — the route received from an external route server, ready for the autopilot.

3. Adding the current position as a waypoint

POST /api/wp/add

Adds the current RTK position as a new waypoint. No request body is needed — RTK AUTOPILOT reads the coordinates straight from the GNSS receiver.

Example success response

{ "ok": true, "id": 4, "lat": 54.89876543, "lng": 23.91234567,
  "alt": 82.315, "quality": "FIX" }

This lets a user physically mark points with the RTK antenna, without sending coordinates themselves.

4. Saving collected points as a line

POST /api/wp/save-line

Finishes the collected waypoints as a line. At least 2 points are required.

{ "ok": true, "type": "line" }

A line can be used as a path or any other linear object.

5. Saving collected points as an area

POST /api/wp/save-area

Finishes the collected waypoints as a closed area. At least 3 points are required. RTK AUTOPILOT automatically closes the polygon by adding the first point at the end.

{ "ok": true, "type": "area" }

This mode can be used, for example, to hand off a work area's boundary to a route planning server.

The waypoint server must be enabled for the area function to work.

6. Deleting the last waypoint

POST /api/wp/delete-last

Deletes the last recorded waypoint.

{ "ok": true }

7. Deleting all waypoints

POST /api/wp/clear

Deletes the local waypoints and the route received from the server. Also stops the autopilot.

{ "ok": true }

8. Setting the waypoint server

POST /api/waypoint-config

Specifies the external server that processes the collected geometry and can produce the robot's final route.

Content-Type: application/x-www-form-urlencoded

wpEndpoint=http://192.168.1.50&wpServerEnabled=1

Only give the server's base address:

http://192.168.1.50

Do not write http://192.168.1.50/api/waypoints — RTK AUTOPILOT appends /api/waypoints itself.

{ "ok": true }

9. Sending waypoints to the route server

POST /api/wp/server/send

A request to the RTK AUTOPILOT device, telling it to hand off its collected waypoints to the configured external server.

RTK AUTOPILOT then sends, on its own:

POST http://SERVER/api/waypoints
Content-Type: application/json

Example data sent to the server

{
  "deviceId": "AA:BB:CC:DD:EE:FF", "source": "rover",
  "routes": [
    { "id": 0, "type": "area", "name": "Area 1",
      "points": [
        { "lat": 54.898765, "lng": 23.912345, "alt": 82.3, "quality": "FIX" },
        { "lat": 54.898800, "lng": 23.912500, "alt": 82.4, "quality": "FIX" }
      ] }
  ]
}
FieldMeaning
deviceIdRTK AUTOPILOT device identifier / MAC address
sourceData source — "rover" in this case
routesList of objects created by the user
typeObject type: line or area
pointsThe object's RTK coordinates

10. What RTK AUTOPILOT expects from the route server

The server can return an already-computed robot route.

Simplest format

{ "points": [
  { "lat": 54.898700, "lng": 23.912300, "alt": 82.1 },
  { "lat": 54.898750, "lng": 23.912450, "alt": 82.2 },
  { "lat": 54.898810, "lng": 23.912600, "alt": 82.2 }
] }

Minimum required fields per point: { "lat": 54.898700, "lng": 23.912300 }. alt is optional — 0 is used if it's missing. The route must have at least 2 valid points.

RTK AUTOPILOT also understands: { "route": { "points": [...] } } or { "routes": [ { "points": [...] } ] }.

If the server responds to the POST with a route immediately, RTK AUTOPILOT loads it automatically. In that case /api/wp/server/send can return:

{ "ok": true, "status": "SENT_AND_LOADED" }

11. Fetching a route from the server

POST /api/wp/server/load

Tells RTK AUTOPILOT to query the configured server.

RTK AUTOPILOT then sends:

GET http://SERVER/api/waypoints

The server must return waypoints in one of the JSON formats described above.

On success

{ "ok": true, "status": "LOADED", "count": 85 }

This means an 85-waypoint route was received from the server and is ready for the autopilot.

12. Starting the autopilot

POST /api/autopilot/start

Starts autonomous driving along the current route.

{ "ok": true }

If the autopilot cannot be started:

{ "ok": false, "error": "..." }

In that case the HTTP status may be 409 Conflict.

13. Stopping the autopilot

POST /api/autopilot/stop

Stops the autopilot and the robot.

{ "ok": true }

14. Manual robot control

POST /api/drive

The command is passed as a URL parameter:

POST /api/drive?cmd=COMMAND
CommandMeaning
FForward
BBackward
LTurn left
RTurn right
SStop

Example — drive forward: POST /api/drive?cmd=F · Stop: POST /api/drive?cmd=S

{ "ok": true }

Important: an F, B, L or R command takes control away from the autopilot — an active autopilot is switched off.

Forced stop

POST /api/drive?cmd=S&force=1

This stops the robot and turns off the autopilot regardless of the current control state.

15. Typical workflow

  1. Add RTK points: POST /api/wp/add
  2. Add another point: POST /api/wp/add
  3. Repeat until the required area is collected.
  4. Finish the area: POST /api/wp/save-area
  5. Send the area to the route server: POST /api/wp/server/send
  6. RTK AUTOPILOT sends it on as POST /api/waypoints
  7. The server computes the robot's path and returns { "points": [ ... ] }
  8. RTK AUTOPILOT stores the received route.
  9. Start the autopilot: POST /api/autopilot/start
  10. Check status while driving: GET /api/status
  11. Stop the autopilot: POST /api/autopilot/stop

Quick API reference

EndpointPurpose
GET /api/statusGet RTK AUTOPILOT status
GET /api/wp/listGet the waypoint list
POST /api/wp/addAdd the current RTK position as a waypoint
POST /api/wp/save-lineFinish collected points as a line
POST /api/wp/save-areaFinish collected points as an area
POST /api/wp/delete-lastDelete the last waypoint
POST /api/wp/clearDelete waypoints and the server route
POST /api/waypoint-configSet the external waypoint/route server
POST /api/wp/server/sendSend collected geometry to the server
POST /api/wp/server/loadFetch the ready route from the server
POST /api/autopilot/startStart the autopilot
POST /api/autopilot/stopStop the autopilot
POST /api/drive?cmd=FDrive forward
POST /api/drive?cmd=BDrive backward
POST /api/drive?cmd=LTurn left
POST /api/drive?cmd=RTurn right
POST /api/drive?cmd=SStop
POST /api/drive?cmd=S&force=1Force-stop the robot and the autopilot