「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
Rasbian上に、イケてるNode-RED環境を構築する。
既定でインストールされている。
$ node-red
$ node-red-pi --max-old-space-size=256
http://{ラズパイのIPアドレス}:1880/
Apple Piを使うので、GPIO 6を使う。
[
{
"id": "b04f4d8.27109b",
"type": "tab",
"label": "フロー 1",
"disabled": false,
"info": ""
},
{
"id": "af2680ad.55fbc",
"type": "trigger",
"z": "b04f4d8.27109b",
"op1": "1",
"op2": "0",
"op1type": "str",
"op2type": "str",
"duration": "1000",
"extend": false,
"units": "ms",
"reset": "",
"bytopic": "all",
"name": "",
"x": 380,
"y": 100,
"wires": [
[
"9f2430cd.ca7c2"
]
]
},
{
"id": "9f2430cd.ca7c2",
"type": "rpi-gpio out",
"z": "b04f4d8.27109b",
"name": "",
"pin": "31",
"set": "",
"level": "0",
"freq": "",
"out": "out",
"x": 580,
"y": 100,
"wires": []
},
{
"id": "a08e5a7f.768288",
"type": "inject",
"z": "b04f4d8.27109b",
"name": "",
"topic": "",
"payload": "1",
"payloadType": "num",
"repeat": "2",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 190,
"y": 100,
"wires": [
[
"af2680ad.55fbc"
]
]
}
]
docker run -d -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red:1.2.0-10-arm32v6
以下のコマンドで起動する。
sudo systemctl enable nodered.service
sudo systemctl disable nodered.service
サービスの自動起動を設定し、コンテナ側も自動起動を設定する。