Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

new fitbit sdk is breaking my app

hello, I recently got the notification for the new sdk version but I am developing an app for the older versa devices, and the new sdk version broke all of the sensor readings and can'tScreen Shot 2020-10-03 at 4.24.09 PM.pngScreen Shot 2020-10-03 at 4.24.16 PM.pngScreen Shot 2020-10-03 at 4.25.36 PM.png find a solution can someone help me? this all worked just fine before the new sdk release. 

Best Answer
0 Votes
3 REPLIES 3

I was able to fix it but now the gyroscope and barometer isnt working when they worked before.

 

Best Answer
0 Votes

accel code: if (Accelerometer) {
const accel = new Accelerometer({ frequency: 1 });
accel.addEventListener("reading", () => {
accelData.text = JSON.stringify({
x: accel.x ? accel.x.toFixed(1) : 0,
y: accel.y ? accel.y.toFixed(1) : 0,
z: accel.z ? accel.z.toFixed(1) : 0
});
});
sensors.push(accel);
accel.start();
} else {
accelLabel.style.display = "none";
accelData.style.display = "none";
console.log("ERROR 404: failed to load Accelerometer info on fitbit because the sensor was not detected.");
}

 

gyro code:

if (Gyroscope) {
console.log("This device has a Gyroscope!");
const gyroscope = new Gyroscope({ frequency: 1 });
gyroscope.addEventListener("reading", () => {
console.log(
`Gyroscope Reading: \
timestamp=${gyroscope.timestamp}, \
[${gyroscope.x}, \
${gyroscope.y}, \
${gyroscope.z}]`
);
});
gyroscope.start();
} else {
console.log("This device does NOT have a Gyroscope, or is not loading correctly! divice cannot display gyroscope data!");
console.log("ERROR 404: failed to load gyroscope info on fitbit because the sensor was not detected.");
}

Best Answer
0 Votes

Is this on simulator or physical watch?

Peter McLennan
Gondwana Software
Best Answer
0 Votes