Skip to content

Getting started

Each release has an archive per platform holding pulzr-codec and engine.wasm, the JavaScript engine, which it finds beside itself.

Platform Archive
Linux, x86_64 pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu.tar.gz
Linux, aarch64 (a Raspberry Pi 4 or 5, Graviton) pulzr-codec-v0.1.0-aarch64-unknown-linux-gnu.tar.gz
macOS, Apple silicon pulzr-codec-v0.1.0-aarch64-apple-darwin.tar.gz
Windows, x86_64 pulzr-codec-v0.1.0-x86_64-pc-windows-msvc.zip
curl -sSLO https://github.com/pulzar-net/pulzr-codec/releases/download/v0.1.0/SHA256SUMS
curl -sSLO https://github.com/pulzar-net/pulzr-codec/releases/download/v0.1.0/pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu.tar.gz
sha256sum --check --ignore-missing SHA256SUMS
tar xzf pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu.tar.gz

Or the container image, ghcr.io/pulzar-net/pulzr-codec, which runs the service.

A codec package is a directory:

File
device.json What the device is, and the libraries its codec uses
decoder.js The codec
examples/*.json Calls and what they must answer

The repository’s examples/http-plug is one, a made-up plug with an HTTP API:

git clone https://github.com/pulzar-net/pulzr-codec
./pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu/pulzr-codec test pulzr-codec/examples/http-plug
ok status-answered.json
ok status-asks.json
ok switch-off.json
ok unreachable.json

Each example ran through the codec exactly as the service runs it: the same engine, the same host API, the same limits. Testing a codec explains the example format; Codecs explains how to write one.

run makes a single call and prints the codec’s whole answer:

echo '{"bytes": [8, 162, 90], "fPort": 1}' > input.json
pulzr-codec run customer decodeUplink decoder.js input.json

The first call’s answer goes to stdout, and each call’s time to stderr (PULZR_LOOP=1 makes it one call).