0.0.32 • Published 7 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
7 months ago
0.0.31
8 months ago
0.0.30
8 months ago
0.0.29
8 months ago
0.0.28
8 months ago
0.0.27
8 months ago
0.0.26
8 months ago
0.0.25
8 months ago
0.0.24
8 months ago
0.0.23
8 months ago
0.0.22
8 months ago
0.0.21
8 months ago
0.0.20
8 months ago
0.0.19
8 months ago
0.0.18
8 months ago
0.0.17
8 months ago
0.0.16
8 months ago
0.0.15
8 months ago
0.0.14
8 months ago
0.0.13
8 months ago
0.0.12
8 months ago
0.0.11
8 months ago
0.0.10
8 months ago
0.0.9
8 months ago
0.0.8
8 months ago
0.0.7
8 months ago
0.0.6
8 months ago
0.0.5
8 months ago
0.0.4
8 months ago
0.0.3
8 months ago
0.0.2
8 months ago
0.0.1
8 months ago