Showing Temperature value

Hi,

I am trying to build an app to show the temperature value. It is running successfully on the SDK and showing values but in the device Venu 2, it is showing 0. What is the reason I can't figure it out. Any help is appreciated.

Here is my implementation:

import Toybox.Graphics;
import Toybox.WatchUi;
import Toybox.Sensor;
import Toybox.System;
import Toybox.ActivityRecording;
import Toybox.SensorLogging;
using Toybox.FitContributor as Fit;

class RawloggerView extends WatchUi.View {

    private var session = null;
    private var temperature = null;
    var temperatureField = null;

    const TEMPERATURE_FIELD_ID = 11;

    private var sensorLogger = null;

    function initialize() {
        View.initialize();
        Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]);
        Sensor.enableSensorEvents(method(:onSensor));

        session = createSession();
        session.start();

        temperatureField = session.createField(
            "temperature",
            TEMPERATURE_FIELD_ID,
            Fit.DATA_TYPE_SINT16,
            {:mesgType => Fit.MESG_TYPE_RECORD, :units => "C"}
        );

        temperatureField.setData(0.0);
    }

    function createSession() {
        var session = ActivityRecording.createSession({
            :name => "Rawlogger",
            :sport => Activity.SPORT_GENERIC,
            :subSport => Activity.SUB_SPORT_GENERIC,
            :sensorLogger => self.sensorLogger
        });
        return session;
    }

    function onLayout(dc as Dc) as Void {
        setLayout(Rez.Layouts.MainLayout(dc));
    }

    function onShow() as Void {
        try {
            if (session != null) {
                session.start();
                System.println("Session Started!");
            }
        } catch (e) {
            System.println(e.getErrorMessage());
        }
    }

    function onUpdate(dc as Dc) as Void {
        View.onUpdate(dc);

        dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_BLACK);

        if (temperature != null) {
            dc.drawText(225, 15, Graphics.FONT_SYSTEM_XTINY, temperature.toString(), Graphics.TEXT_JUSTIFY_VCENTER);
        } else {
            dc.drawText(225, 15, Graphics.FONT_SYSTEM_XTINY, "0.0", Graphics.TEXT_JUSTIFY_VCENTER);
        }
    }

    function onSensor(sensorInfo as Toybox.Sensor.Info) as Void {
        System.println("Sensor callback triggered.");
        if (sensorInfo != null) {
            System.println("Sensor info is not null.");

            if (sensorInfo.temperature != null) {
                temperature = sensorInfo.temperature;
                temperatureField.setData(temperature);
                System.println("Temperature: " + temperature);
            } else {
                System.println("Temperature data is null.");
            }
        } else {
            System.println("Sensor info is null.");
        }
        WatchUi.requestUpdate();
    }

    function onHide() as Void {
        Sensor.unregisterSensorDataListener();
        session.stop();
        var saved = session.save();
        if (saved) {
            System.println("Session successfully saved.");
        } else {
            System.println("Failed to save the session.");
        }
    }
}