TediHamdani I already replied you in flespi chat. Let's continue communication there if you have more questions.
For other users of gps-server.net platform I will share a copy of my reply here.
We contacted gps-server.net team a year or so ago but unfortunately they were not welcoming any integration from flespi side. However one of our clients using custom PHP script to perform data conversion from flespi http stream directly into gps-server.net. I do not know if you are able to create and maintain such a script and so far this is the only way to go. Here is the code if you are able, please let us know if it will work for you:
var loc = {
"op": "loc",
"net_protocol": "TCP",
"protocol": msg.telemetry["protocol.id"],
"ip": msg.telemetry.peer,
"port": msg.telemetry["channel.id"],
"imei": msg.telemetry.ident,
"dt_tracker": msg.telemetry.dt,
"loc_valid": 1,
"params": {},
"event": ""
};
// position parameters
if (typeof msg.telemetry["position.latitude"] !== "undefined"){
loc.lat=msg.telemetry["position.latitude"];
}
if (typeof msg.telemetry["position.longitude"] !== "undefined"){
loc.lng=msg.telemetry["position.longitude"];
}
if (typeof msg.telemetry["position.altitude"] !== "undefined"){
loc.altitude=msg.telemetry["position.altitude"];
}
if (typeof msg.telemetry["position.direction"] !== "undefined"){
loc.angle=msg.telemetry["position.direction"];
}
if (typeof msg.telemetry["position.speed"] !== "undefined"){
loc.speed=msg.telemetry["position.speed"];
}
if (typeof msg.telemetry["position.satellites"] !== "undefined"){
loc.params["gpslev"]=msg.telemetry["position.satellites"];
}
if (typeof msg.telemetry["position.hdop"] !== "undefined"){
loc.params["hdop"]=msg.telemetry["position.hdop"];
}
if (typeof msg.telemetry["position.pdop"] !== "undefined"){
loc.params["pdop"]=msg.telemetry["position.pdop"];
}
// digital input bitmask
// this should move to gps-server api decoder instead
// we need to invert the array we got from the bitmask to get the right di value order
if (typeof msg.telemetry["di"] !== "undefined"){
var n = msg.telemetry.di.length;
for (var i = 1; i <= n; i++) {
loc.params["di"+i]=msg.telemetry.di[n-i]; //parseInt() ?
}
}
// analog input
if (typeof msg.telemetry["ain.1"] !== "undefined"){
loc.params["ai1"]=msg.telemetry["ain.1"];
}
if (typeof msg.telemetry["ain.2"] !== "undefined"){
loc.params["ai2"]=msg.telemetry["ain.2"];
}
// device parameters
if (typeof msg.telemetry["external.powersource.voltage"] !== "undefined"){
loc.params["accv"]=msg.telemetry["external.powersource.voltage"];
}
if (typeof msg.telemetry["battery.voltage"] !== "undefined"){
loc.params["batv"]=msg.telemetry["battery.voltage"];
}
// GSM parameters
if (typeof msg.telemetry["gsm.cellid"] !== "undefined"){
loc.params["cellid"]=msg.telemetry["gsm.cellid"];
}
if (typeof msg.telemetry["gsm.lac"] !== "undefined"){
loc.params["lac"]=msg.telemetry["gsm.lac"];
}
if (typeof msg.telemetry["gsm.mnc"] !== "undefined"){
loc.params["mnc"]=msg.telemetry["gsm.mnc"];
}
if (typeof msg.telemetry["gsm.signal.level"] !== "undefined"){
loc.params["gsmlev"]=msg.telemetry["gsm.signal.level"];
}
if (typeof msg.telemetry["gsm.signal.dbm"] !== "undefined"){
loc.params["gsmlev"]=msg.telemetry["gsm.signal.dbm"];
}
// tacho parameters
if ((typeof msg.telemetry["tacho.driver.card.code.1"] !== "undefined") && (msg.telemetry["tacho.driver.card.code.1"] != " ")){
loc.params["tacho_drv1_id"]=msg.telemetry["tacho.driver.card.code.1"].slice(0, -2);
}
if ((typeof msg.telemetry["tacho.driver.card.code.2"] !== "undefined") && (msg.telemetry["tacho.driver.card.code.2"] != " ")){
loc.params["tacho_drv2_id"]=msg.telemetry["tacho.driver.card.code.2"].slice(0, -2);
}
// vehicle parameters
if (typeof msg.telemetry["tacho.vehicle.mileage"] !== "undefined"){
loc.params["odo"]=msg.telemetry["tacho.vehicle.mileage"]/1000;
}
// https://docs.gps-server.net/user-manual/sensor-parameters
msg.payload = loc;
return msg;