07-20-2021 14:35
07-20-2021 14:35
SDK 6.0 has just been released. Checkout the developer blog for more info:
https://dev.fitbit.com/blog/2021-07-20-announcing-fitbit-os-sdk-6.0/
07-21-2021 00:40
07-21-2021 00:40
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.
07-21-2021 00:45
07-21-2021 00:45
Did you update the import for fs?
07-21-2021 01:16
07-21-2021 01:16
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.
07-21-2021 04:20
07-21-2021 04:20
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.
07-21-2021 04:32 - edited 07-21-2021 04:38
07-21-2021 04:32 - edited 07-21-2021 04:38
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.
07-21-2021 04:45
07-21-2021 04:45
SDK 6 needs to the new imports. 4.3 needs the old import syntax.
07-21-2021 04:57
07-21-2021 04:57
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.
07-21-2021 05:41
07-21-2021 05:41
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.
07-21-2021 05:47
07-21-2021 05:47
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.
07-21-2021 05:54
07-21-2021 05:54
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.
07-21-2021 06:06
07-21-2021 06:06
The code change is required for SDK 6.0 only.
07-21-2021 06:35 - edited 07-21-2021 06:36
07-21-2021 06:35 - edited 07-21-2021 06:36
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.
07-22-2021 11:09
07-22-2021 11:09
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?
07-22-2021 22:15
07-22-2021 22:15
Maybe update the docs saying that old syntax for 4.3.0
07-23-2021 01:11
07-23-2021 01:11
@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.
07-25-2021 04:30 - edited 07-25-2021 04:42
07-25-2021 04:30 - edited 07-25-2021 04:42
@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.
07-25-2021 08:48
07-25-2021 08:48
New 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 😑
08-02-2021 05:27
08-02-2021 05:27
@JonFitbit Hi Jon, any news when we will get the 4.3 rollup problem fixed?
Author | ch, passion for improvement.
08-10-2021 06:37
08-10-2021 06:37
Hi Jon, Its now 3 weeks there has been a problem with 4.3, will it get resolved soon?
Author | ch, passion for improvement.