When I put my IOT device outside for its purpose I got some strange readings on modemTemp.
You can see it cooling down in its box:
"modemTemp":12
"modemTemp":9
"modemTemp":7
"modemTemp":5
"modemTemp":3
"modemTemp":1
"modemTemp":0
"modemTemp":65535
"modemTemp":65535
"modemTemp":65534
Looking at my code did not explain the issue as I am using float for all temperature variables.
But suspecting somewhere on the way there was some unsigned integer (uint) conversion that broke the values.
As the data goes via 3 systems in different clouds it was a bit of a trace.
In the end I found the issue in file: TinyGsmClientSIM7600.h:
/*
Temperature functions
*/
protected:
// get temperature in degree celsius
uint16_t getTemperatureImpl() {
sendAT(GF("+CPMUTEMP"));
if (waitResponse(GF(GSM_NL "+CPMUTEMP:")) != 1) { return 0; }
// return temperature in C
uint16_t res = streamGetIntBefore('\n');
// Wait for final OK
waitResponse();
return res;
}
So changing the uint to int will solve the problem (or float as in some other implementations).
Yes devices can operate in less than 0°C :-)
Hi I am using TinyGSM for sim7600
When I put my IOT device outside for its purpose I got some strange readings on modemTemp. You can see it cooling down in its box: "modemTemp":12 "modemTemp":9 "modemTemp":7 "modemTemp":5 "modemTemp":3 "modemTemp":1 "modemTemp":0 "modemTemp":65535 "modemTemp":65535 "modemTemp":65534
Looking at my code did not explain the issue as I am using float for all temperature variables. But suspecting somewhere on the way there was some unsigned integer (uint) conversion that broke the values. As the data goes via 3 systems in different clouds it was a bit of a trace.
In the end I found the issue in file: TinyGsmClientSIM7600.h: /*
So changing the uint to int will solve the problem (or float as in some other implementations). Yes devices can operate in less than 0°C :-)