Rolf Meyerhoff replied to the topic 'Initialization of Sesto Senso' in the forum. 5 years ago

I've debugged the code and the problem is in the TimerHit() method. The temperature frequency counter is increased and then compared against the update frequency. When they match then the temperature is updated. In this case it only works once as the counter is never set back to zero. I've added the last line in the if statement and now it works as expected:

    if (m_TemperatureCounter++ == SESTO_TEMPERATURE_FREQ)
    {
        rc = updateTemperature();
        if (rc)
        {
            if (fabs(lastTemperature - TemperatureN[0].value) >= 0.1)
            {
                IDSetNumber(&TemperatureNP, nullptr);
                lastTemperature = TemperatureN[0].value;
            }
        }
        m_TemperatureCounter = 0;  // <- Was missing.
    }

Maybe someone with access to the repository can add this to the code .

Read More...