0.0.32 • Published 8 months ago

netled-device-pi v0.0.32

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

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

8 months ago

0.0.31

9 months ago

0.0.30

9 months ago

0.0.29

9 months ago

0.0.28

9 months ago

0.0.27

9 months ago

0.0.26

9 months ago

0.0.25

9 months ago

0.0.24

9 months ago

0.0.23

9 months ago

0.0.22

9 months ago

0.0.21

9 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago