Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
How do you access the resources folder files in SDK 4.3?
It no longer seems to work.
Which mean Clocks and Apps development and support for anything other than Versa 3 and Sense may have ended.
Author | ch, passion for improvement.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
New format
import * as fs from "fs"
doesn't work in 4.3, it used to in 4.2 and 5.0
Also the file structure is now inaccessible, in 4.3, 5.0 and 6.0 in the OS Simulator 0.9.1
Author | ch, passion for improvement.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
SDK 4.3 does not require the import changes, that only applies to SDK 6.0. 4.3 has the old version of Rollup pinned, so the existing code should just work.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Hi Jon
Was using fine before in 4.2 & 5.0
import * as fs from "fs"
Now it won't work.
fs.readFileSync() complains about needing a function
[TypeError: Expected a function]
Author | ch, passion for improvement.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
SDK 6 needs to the new imports. 4.3 needs the old import syntax.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Yes, but what was working before now isn't.
Previously in 4.2 & 5.0 with
import * as fs from "fs"
fs.readFileSync() was working
Changing to 4.3 it no longer works.
Worse if you change the 4.2 import [which shouldn't be necessary as it was working fine before 6.0] to
import fs from "fs"
then
fs.readFileSync() no longer finds the files.
with the OS Simulator 0.9.1
There shouldn't be a need to change the working 4.2 code and if you do [going back to older versions] its not working.
In 5.0 its not working, nor in 6.0 either, as the files aren't found.
So 2 problems.
Author | ch, passion for improvement.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
One problem solved:
It turns out the file not found message was incomplete but it is still necessary to change the working 4.2 import to the older version for it to run in 4.3.
Author | ch, passion for improvement.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
You only need to update to 4.3 if you want the Weather API.
5.0, 4.3, and 4.2 use the old style imports.
6.0 uses the new style imports.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
What do you call old style import for FS ?
Have always been using till now
import * as fs from "fs"
This doesn't work anymore. So a code change is required.
Author | ch, passion for improvement.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
The code change is required for SDK 6.0 only.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
No, a code change is required for 4.3 .
Previously 4.2 ( like 5.0 ) supported
import * as fs from "fs"
But 4.3 won't.
4.3 will only support the older version
import fs from "fs"
Author | ch, passion for improvement.
Hi Jon,
So, if our existing clock face doesn’t need the weather api or the weekly azm goal info, will it be necessary to upgrade the build to sdk 6.0? Or the clock faces will continue to function normally if built using sdk 5.0 for Versa 3 and sense?
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
@JonFitbitCan having to revert to
import fs from "fs"
cause increased memory usage and Fatal Jerryscript Error: ERR_OUT_OF_MEMORY??
Author | ch, passion for improvement.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
@JonFitbit Hi Jon
There definitely seems to be a bug with 4.3.0, the built code seems to be far more full of carriage returns and the built I/O commands contain errors, unless the source is changed [which causes larger commands], and even removing a considerable portion of the original source it still will not fit in memory.
The original 4.2.0 built code loads fine still.
Does this mean that development for the OS 4 pre Versa 2 platform has already inadvertently ended for anything but tiny mickey mouse projects? Or will there be a fix so development can continue?
Author | ch, passion for improvement.
Best AnswerNew weather options seems like it may have some issues, the weatherCondition is only returning a number.. so far even using the example made for github does the same.
import * as cbor from "cbor";
import { me as companion } from "companion";
import { outbox } from "file-transfer";
import weather from "weather";
import { dataFile, wakeTime } from "../common/constants";
if (companion.permissions.granted("access_location")) {
weather
.getWeatherData()
.then((data) => {
if (data.locations.length > 0) {
const temp = Math.floor(data.locations[0].currentWeather.temperature);
const cond = data.locations[0].currentWeather.weatherCondition;
const loc = data.locations[0].name;
const unit = data.temperatureUnit;
console.log(`It's ${temp}\u00B0 ${unit} and ${cond} in ${loc}`);
}
})
.catch((ex) => {
console.error(ex);
});
}
Returns - [11:28:55 AM]It's 25° celsius and 6 in Sparta
Still no access to o2 😑
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
@JonFitbit Hi Jon, any news when we will get the 4.3 rollup problem fixed?
Author | ch, passion for improvement.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Hi Jon, Its now 3 weeks there has been a problem with 4.3, will it get resolved soon?
Author | ch, passion for improvement.
Best Answer