Open njbuch opened 6 years ago
Could be related to the other issue about a failed MQTT connection?
@njbuch I will check and update you
@njbuch This is the sequence,
In your example, the serial port is no initialized in setup. It is initialized when calling mc.loop()
I can confirm the sequence you write, when the device is booted first time after flash, but if the device is off and then powered on, the before() is never called and sensors does not work....
No worries on this one, I have solved it by:
void loop() {
// This is required for the Mycontroller device works...
mc.loop();
//You can add your logic here.
if(!custom_initdone)
{
custom_init();
}
sendMeasurements();
}
I have realized that the reason for some erronous readings from some sensors, is due to the fact that the sensor-init is never done.
It seems that the device starts probing sensors without the before() or setup() is called. In the above, these two functions are declared:
and