yesyes wrote;
Can you think of any way of supporting a float data type in agentuino? I'd like to send my temperature data with one or 2 decimal places. Currently you only seem to have some integers and strings.
SNMP doesn't support floating points. Strings are possible as per included example e.g. sysName and sysDescr but read the limitations section on our main project page.
Now back to floating point values, as the saying goes, there is more than one way to skin a cat! Use multipliers and divisors.
Know what your measuring; based on the sensor and parameter being measured there is always a max/min range and resolution that it can measure. So let's use Temperature and RH as an example. Say the sensor measures temperature from 70 deg C to -40 deg C and RH from 0 to 100 %.
INT is 65535 (unsigned 16bit int) but it can handle signed values as well -32000 to 32000 (approximation but a 16bit float)
Temperature:
70.00 (upper range) = 7000 (x100)
-40.00 (lower range) = 4000 (x100)
To normalize this further for other types of sensors (some can measure down to -50 deg C etc.) we could simply use 10,000 (max upper range) and -10,000 (min lower range) having an error value of 10,001. So if the system detects an out of bound measurement (out of range of the sensor's parameter being measured) you can flag it as an error. So if you receive an SNMP value of 2345, simply divide by 100 to get 23.45 deg C.
RH (floating point with RH is rarely used due to the type of measurement - it's relative )
0 (lower range) = 0
100 (upper range) = 100
RH is always 0 to 100 (%) and again you could use 101 to reflect an error.
Resolution; if the sensor's parameter's resolution is only 0.1, your not adding accuracy by offering a resolution of 0.01.
The error codes aren't required and are used as basic QA/QC (meteorological QA/QC is a whole other subject).
On the string side, are you sure you need strings e.g. you can use enumerators in SNMP which consume an INT value versus a string (in the MCU wold that's needless memory consumption). For example, Precipitation Situation; 1-Light Rain, 2-Moderate Rain, 3-Heavy Rain.
I read the Melexis temperature sensor continuously once per loop
You don't need to sample that frequently for meteorological related applications. As per WMO/NWS standards it is recommended to sample air temperature at either 3 or 5 second intervals and is averaged over 1-minute. Soil temperature is sampled every minute due to the slow rate of change.
Hope this shed's some light on measurements using SNMP. The above examples are methodologies used in existing meteorological standards that I have been involved with.
Regards,
Eric