Skip to main content

OTA Command Examples

Use OTA commands to remotely configure supported GPS/OBD devices by SMS from Device Configurator.

Prerequisites

For a device to receive OTA commands:

  • Device is registered in Vehk Axle.
  • Device has a valid imei.
  • Device has sim_number configured (PUT /api/devices/manage/{device_id}/sim).
  • Device has correct device_type_id (enables manufacturer-specific SMS format).
  1. Configure SIM details.
  2. Preview command text.
  3. Send command.
  4. Check history and device live status.

Step 1: Configure SIM

curl -X PUT "https://<api-host>/api/devices/manage/<device_id>/sim" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"sim_number": "+919876543210",
"apn": "Airteliot.com",
"carrier": "Airtel"
}'

Step 2: Preview Command

Preview the exact SMS command before sending:

curl -H "Authorization: Bearer <TOKEN>" \
"https://<api-host>/api/devices/manage/<device_id>/ota/command?command_type=config_server&device_password=aquila123"

Response includes:

  • sms_message (exact text to send)
  • sms_target (device SIM)
  • manufacturer_format

Step 3: Send OTA Command

curl -X POST "https://<api-host>/api/devices/manage/<device_id>/ota" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"command_type": "config_server",
"device_password": "aquila123",
"params": {
"apn": "Airteliot.com",
"server_ip": "20.207.115.231",
"port": 5050
}
}'

Step 4: Check OTA History

curl -H "Authorization: Bearer <TOKEN>" \
"https://<api-host>/api/devices/manage/<device_id>/ota/history?limit=20"

Supported Command Types

  • config_server
  • reboot
  • status_query
  • config_apn
  • config_interval
  • power_save

Manufacturer Format Examples

Vehk automatically picks the format from device_type_id:

Manufacturer formatExample command pattern
iTriangleset$IMEI@pass#CFG_GPRS:APN,,,IP,PORT*
Meitrack0000,A21,1,IP,PORT,APN,,
Coban/Concoxadminip,IP,PORT#
SinoTrack8040000 IP PORT
Teltonikalogin pass setparam 1245:IP

If manufacturer is unknown, system falls back to iTriangle format.

If SMS Provider Is Not Configured

If server SMS_API_KEY is not configured, API still generates sms_message and returns manual instructions.

You can then:

  1. Copy command text from response.
  2. Send SMS manually to sms_target.
  3. Re-check device in Management → Live Status and Diagnostics.

Troubleshooting

400 Device has no IMEI

  • Update device with a valid IMEI first.

400 No SIM number configured

  • Configure SIM using /api/devices/manage/{device_id}/sim.

Command sent but device does not reconnect

  • Verify APN and SIM data plan.
  • Verify server IP/port.
  • Try reboot, then status_query.
  • Check Gateway tab for active connection attempts.

Next Steps