Matter writeAttribute Crashing
-
Starting at least last night, using any
writeAttribute
Matter method started erroring with an uncatchable exception which completely crashes the script.This exact kind of code worked at least a week ago (maybe even earlier yesterday), and then last night when I was working on some changes I noticed a new crash that was not happening within my code.
I'm not sure what would have caused this as I don't think my Matter devices had any firmware updates, nor the Flic Hub LR getting a firmware update.
It appears that the attribute is getting set, but something after that point in underlying Flic code is not expecting a
Success
value.EXAMPLE CODE:
const matterModule = require('matter') const matterDevices = matterModule.getNodes() const matterDeviceIDsForNames = {} for (const thisMatterDevice of matterDevices) { matterDeviceIDsForNames[thisMatterDevice.name] = thisMatterDevice.nodeId } const thisMatterDeviceID = matterDeviceIDsForNames['Living Room Corner Lamp'] const brightnessPercentage = 80 const brightnessLevel = Math.round(254 * (brightnessPercentage / 100)) matterModule.writeAttribute(thisMatterDeviceID, 1, 'Level Control', 'OnLevel', brightnessLevel, () => {})
ERROR OUTPUT:
SyntaxError: unexpected token: 'Success' at <input>:1 at parse (native) at handlePacket (core.js:3259) at onPipeData (core.js:3336)
-
@pico The hub checks for updates automatically every 24 hours. Unfortunately there is no history on the device of updates. If there are new features for an update, we typically show those in the changelog of the Android/iOS app.
-
@Emil Looks like it's fixed in 4.4.1, thank you so much!
Out of curiosity, is there a set time that the Flic Hub LR auto-checks and installs updates? Also, there a log of update history on the device to see when updates were installed? And is there a changelog available anywhere?
-
@pico No, it was a firmware update. Please try to update to the latest firmware 4.4.1 and see if it resolves the issue.
-
@Emil Awesome, thank you so much!
I'm glad this was easy to track down. I'm curious, is there any explanation as to how this popped up in previously working code when no firmware updates were done in the meantime? Does the Flic Hub LR have other OTA updates to the SDK runtime that are separate from the device firmware?
-
@pico thanks for the report. Found the issue. Will fix the upcoming week.