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_numberconfigured (PUT /api/devices/manage/{device_id}/sim). - Device has correct
device_type_id(enables manufacturer-specific SMS format).
OTA Workflow (Recommended)
- Configure SIM details.
- Preview command text.
- Send command.
- 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_serverrebootstatus_queryconfig_apnconfig_intervalpower_save
Manufacturer Format Examples
Vehk automatically picks the format from device_type_id:
| Manufacturer format | Example command pattern |
|---|---|
| iTriangle | set$IMEI@pass#CFG_GPRS:APN,,,IP,PORT* |
| Meitrack | 0000,A21,1,IP,PORT,APN,, |
| Coban/Concox | adminip,IP,PORT# |
| SinoTrack | 8040000 IP PORT |
| Teltonika | login 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:
- Copy command text from response.
- Send SMS manually to
sms_target. - 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, thenstatus_query. - Check Gateway tab for active connection attempts.