Raspberry Pi 3B+ でNode-Red環境を整える

  • 投稿日:
  • by
  • カテゴリ:  

はじめに

Raspberry Pi 3B+でNode-Redを最新化し、使用できるようにします。

環境

  • Mac Book Pro Late 2013
  • Raspberry Pi 3B+
  • Node-Red 8.11.3

目次

  1. Node-REDアップグレードスクリプト取得
  2. アップグレード
  3. 開発環境へアクセス

Node-REDアップグレードスクリプト取得

curlでスクリプトを取得します。

$ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

back

アップグレード

Node-Redを最新化します。いくつか質問されますが、全て「Y」でインストールを続行します。

$ update-nodejs-and-nodered

back

開発環境へアクセス

Node-Redを起動します。

$ sudo node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://10.1.254.31:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org
12 Aug 13:26:38 - [info] 

Welcome to Node-RED
===================

12 Aug 13:26:38 - [info] Node-RED version: v0.18.7
12 Aug 13:26:38 - [info] Node.js  version: v8.11.3
12 Aug 13:26:38 - [info] Linux 4.14.52-v7+ arm LE
12 Aug 13:26:40 - [info] Loading palette nodes
12 Aug 13:26:45 - [info] Settings file  : /root/.node-red/settings.js
12 Aug 13:26:45 - [info] User directory : /root/.node-red
12 Aug 13:26:45 - [warn] Projects disabled : editorTheme.projects.enabled=false
12 Aug 13:26:45 - [info] Flows file     : /root/.node-red/flows_raspberrypi.json
12 Aug 13:26:45 - [info] Creating new flow file
12 Aug 13:26:45 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

12 Aug 13:26:45 - [info] Server now running at http://127.0.0.1:1880/
12 Aug 13:26:45 - [info] Starting flows
12 Aug 13:26:45 - [info] Started flows

http://raspberrypi.local:1880/へアクセスします。

起動したNode-Redは、[Ctrl]+[c]で停止されませんので、コマンド実行して停止する必要があります。

$ sudo node-red-stop

Stop Node-RED

Use   node-red-start   to start Node-RED again

back