Smile NT-01
GPS Vehicle Tracker
User Manual
PHP Code (upload.php):
<?php
/*-------------------------------------------------------------------
* Author: Nelso Technology Pvt. Ltd. Last modified On: 08/03/2018
*--------------------------------------------------------------------*/
$settings='';
$r = file_get_contents('php://input');
//raw data
/* Dummy Position data: (Uncomment to check if data is inserted properly to database.)*/
//$r = "$866104025429336,WB24K-7980,2016-08-
11/15:55:00,24.799030,90.377548,0,4,97%,0,0,0,0,0,1,1,184,0.0,11.8,,12,-66.0,,,$";
//Upon first power on device sends model information to the server
//$r = "#555555555555555~MODEL~DG-Tracker Smile HW Ver-1.0~1.1~2016-01-18~Airtel#";
if(substr_count("$r",'$') == 2){
$str = str_replace('$', '', $r);
$exploded = explode(",",$str);
$IMEI = $exploded[0];
//IMEI of device
$vehicle = $exploded[1]; //Vehicle Number
$date = $exploded[2];
//Date (2016-08-11/15:55:00,24)
$lat = $exploded[3];
//Latitude
$lon = $exploded[4];
//Longitude
$velocity = $exploded[5]; //Speed (Km/hr)
$state = $exploded[6];
//State (Numeric Value as defined below)
$fuel = $exploded[7];
//Fuel in Tank (%)
$analog1 = $exploded[8]; //Reserved
$analog2 = $exploded[9]; //Reserved
$digital1 = $exploded[10];//Reserved
$digital2 = $exploded[11];//Reserved
$digital3 = $exploded[12];//Reserved
$digital4 = $exploded[13];//Reserved
$digital5 = $exploded[14];
//Reserved
$course = $exploded[15]; //Course
$distance = $exploded[16];
//Odometer Reading
$battery_voltage = $exploded[17];
//Vehicle Battery Voltage
$temperature = $exploded[18];
//Device Temperature
$satellite = $exploded[19];
//No. of satellite in view
$altitude = $exploded[20];
//Altitude
$field1 = $exploded[21];
//Reserved
$field2 = $exploded[22];
//Reserved
$field3 = $exploded[23];
//Reserved
$explodedDate = explode("/",$date);
$datetime = $explodedDate[0] ." ". $explodedDate[1];
//2016-08-11 15:55:00,24
www.nelsotech.com
7