Hi everyone.
I would need your quick help.
I read my GPS Sensor and wanted to mount it to the Thinger Platform.
Here is my Code:
thing["GPSData"] << [](pson& out){
myfile.open("/var/log/thinger.txt", ofstream::out | ofstream::app);
myfile << currentDateTime() << " | Start IP Thing: " << endl;
int fd = openPort("/dev/ttyUSB0");
int i=1;
while (i) {
float lat, lon;
getLocation(fd,&lat,&lon);
int intlat = (int)lat;
int intlon = (int)lon;
if (intlat == 0){
// cout << "GPS is not Ready: " << lat << " | " << lon << endl;
}
if (intlat != 0){
cout << "lat: " << lat << endl;
cout << "lon: " << lon << endl;
out["Latitude"] = lat;
out["Lognitude"] = lon;
i=0;
}
}
myfile.close();
};
When I run thinger, the two cout gives me the following output, which is correct:
lat: 48.391415
lon: 7.935467
But on the Thinger Server i got the following
How can I correct my Code that the Longitude and Latitude becomes equivalent to the Cout.
Many Thanks
Roman