OK, so in EnvironmentalTelemetry.cpp i found:
LOG_INFO(
"(Sending): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, temperature=%f, voltage=%f\n",
m.variant.environment_metrics.barometric_pressure, m.variant.environment_metrics.current,
m.variant.environment_metrics.gas_resistance, m.variant.environment_metrics.relative_humidity,
m.variant.environment_metrics.temperature, m.variant.environment_metrics.voltage);
Which tells me the order in which the values are sent (barometric pressure, then current and so forth) across the mesh.
So looking at the environmental_measurement_pb2.py python source code I set up the descriptor in that same order:
_ENVIRONMENTALMEASUREMENT = _descriptor.Descriptor(
name=âEnvironmentalMeasurementâ,
full_name=âEnvironmentalMeasurementâ,
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name=âbarometric_pressureâ, full_name=âEnvironmentalMeasurement.barometric_pressureâ, index=0,
number=1, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name=âcurrentâ, full_name=âEnvironmentalMeasurement.currentâ, index=1,
number=2, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name=âgas_resistanceâ, full_name=âEnvironmentalMeasurement.gas_resistanceâ, index=2,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name=ârelative_humidityâ, full_name=âEnvironmentalMeasurement.relative_humidityâ, index=3,
number=4, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name=âtemperatureâ, full_name=âEnvironmentalMeasurement.temperatureâ, index=4,
number=5, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name=âvoltageâ, full_name=âEnvironmentalMeasurement.voltageâ, index=5,
number=6, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
Since the values are sent as float across the mesh, the descriptor is set up to accept floats (type=2).
The results that I see are:
Pressure: 0.0
Current: 0.0 (the OLED is showing -1mA)
Gas Resistance: 9.542455448153696e+21
Rel Humidity: 0.0
Temp: 0.0
Voltage: 0.0 (OLED shows 1V)
Do I have a clear understanding of how the values are being sent?
Is the Gas Resistance realistic given there is no board to get a reading from (I have ONLY the INA219 board (current/voltage monitor) installed on the T-Beam)?
Is it safe to assume that the temps are sent across the mesh in Centigrade (I have the "Convert to Fahrenheitâ set)?
Since I am reading 1V at -1mA on the OLED shouldnât I be seeing the same thing in the telemetry stream?