0.0.32 • Published 6 months ago
netled-device-pi v0.0.32
Updating OS
sudo apt update
sudo apt full-upgrade
Install Node (64b)
taken from https://gist.github.com/stonehippo/f4ef8446226101e8bed3e07a58ea512a
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
Install Node (old 32b devices)
[need to install nvm. re-lookup how to do that]
NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release nvm install 20
Create service
sudo nano /etc/systemd/system/netled.service
[Unit]
Description=netled connection
After=network-online.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=2
User=pi
ExecStart=sudo npx --yes netled-device-pi --host https://netled.io -auto [base64 deviceId:secret]
[Install]
WantedBy=multi-user.target
Start it
sudo systemctl start netled.service
Enable for startup
sudo systemctl enable netled.service
Restart
sudo systemctl restart netled.service
stop
sudo systemctl stop netled.service
Testing isolated-vm
import Isolate from "isolated-vm";
import { netledGlobal } from "../../core/src/netledGlobal.js";
const cjsScriptParts = [
`const netled = { animation: { ${netledGlobal.animation.defineAnimation.toString()} }};`,
seg.js.replace("export default", "const cls =") + ";\n",
];
const cjsScript = cjsScriptParts.join("\n");
logger.info("Loading isolate");
const isolate = new Isolate.Isolate({ memoryLimit: 128 });
const context = await isolate.createContext();
const script = await isolate.compileScript(cjsScript);
script.runSync(context);
const services = context.evalSync("JSON.stringify(cls.services)");
console.log(services);
0.0.32
6 months ago
0.0.31
7 months ago
0.0.30
7 months ago
0.0.29
7 months ago
0.0.28
7 months ago
0.0.27
7 months ago
0.0.26
7 months ago
0.0.25
7 months ago
0.0.24
7 months ago
0.0.23
7 months ago
0.0.22
7 months ago
0.0.21
7 months ago
0.0.20
7 months ago
0.0.19
7 months ago
0.0.18
7 months ago
0.0.17
7 months ago
0.0.16
7 months ago
0.0.15
7 months ago
0.0.14
7 months ago
0.0.13
7 months ago
0.0.12
7 months ago
0.0.11
7 months ago
0.0.10
7 months ago
0.0.9
7 months ago
0.0.8
7 months ago
0.0.7
7 months ago
0.0.6
7 months ago
0.0.5
7 months ago
0.0.4
7 months ago
0.0.3
7 months ago
0.0.2
7 months ago
0.0.1
7 months ago