
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
node-matter
Advanced tools
Matter protocol for node.js with no native dependencies (and very limited dependencies).
Matter is a new secure / reliable / local / standard protocol for smart devices that will launch at the end of 2022.
It is supported and Google / Apple / Amazon and 200+ other companies and it is supposed to bring a revolution in smart home automation by unifying WiFi / Bluetooth / Zigbee (through Thread) and by making all smart devices inter-compatible and secure (through the standard and secure Matter protocol).
To know more about Matter: https://csa-iot.org/all-solutions/matter/
This package requires Node 16+ for the required Crypto primitives
npm i -g node-matter
matter
This starts a Matter server listening on port 5540.
This first version only includes the OnOff cluster (on/off smart thing, like a plug or a bulb). You can use -on and -off parameter to run a script to control something. For instance, on a Raspberry Pi, this will turn on / off the red LED:
matter -on "echo 255 > /sys/class/leds/led1/brightness" -off "echo 0 > /sys/class/leds/led1/brightness"
Experimental
matter-controller -ip [IP address of device to commission]
This will commission a Matter device (for debugging purpose only for now).
Main.ts defines the server behavior. You can add / remove clusters, change default parameters, etc...
new MatterServer()
.addChannel(new UdpChannel(5540))
.addProtocolHandler(Protocol.SECURE_CHANNEL, new SecureChannelHandler(
new PasePairing(20202021, { iteration: 1000, salt: Crypto.getRandomData(32) }),
new CasePairing(),
))
.addProtocolHandler(Protocol.INTERACTION_MODEL, new InteractionProtocol(new Device([
new Endpoint(0x00, "MA-rootdevice", [
new BasicInformationCluster({ vendorName: "node-matter", vendorId: 0xFFF1, productName: "Matter test device", productId: 0X8001 }),
new GeneralCommissioningCluster(),
new OperationalCredentialsCluster(),
]),
new Endpoint(0x01, "MA-OnOff", [
new OnOffCluster(executor("on"), executor("off")),
]),
])))
.start()
It should work with any Matter-compatible home automation app when Matter will be released.
Compile chip-tool from project-chip
Provisioning the device:
chip-tool pairing onnetwork 222 20202021
Controlling the device:
chip-tool onoff toggle 222 1
Clearing the data:
chip-tool pairing unpair 222
and/or
chip-tool storage clear-all
You can also control it with Matter test app: https://github.com/project-chip/connectedhomeip/tree/master/src/android/CHIPTest You can find a compiled apk in /matter-test-apk in this repository.
Provisioning the device: click "provision with WiFi" > "Input Device address" > type IP address of the machine running node-matter
Controlling the device: click "Light on/of" and you can control the light
Well, the original codebase is platform dependent, has finicky tool version requirements and is over 8GB with all dependencies. This tool is less than 500kB and works on anything supporting node. Sure, it supports only the barebone Matter protocol for now.
Not yet, but I know how to make it works with a few tricks.
Adding more clusters should be pretty easy now the core protocol is working. Have a look at the implementation of the OnOff cluster: pretty simple, right?
I am planning on adding more clusters, so stay tuned or pinged me to implement first the one you need.
For other questions, you can reach out to: mfucci@gmail.com or post a message on the github forum.
FAQs
Matter protocol for node.js
We found that node-matter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.