美文网首页
树莓派4B安装NODE-RED

树莓派4B安装NODE-RED

作者: BohanL | 来源:发表于2022-03-25 16:25 被阅读0次

    全部按照GITHUB上对应说明安装。
    GitHub - node-red/linux-installers: Node-RED install scripts for various flavours of Linux

    运行以下命令来更新和升级所有已存在的软件包。

    sudo apt update
    sudo apt upgrade
    

    安装 “build-essential “包。
    通过运行以下命令来安装Node-RED。

    sudo apt install build-essential
    
    bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
    
    Are you really sure you want to do this ? [y/N] ?
    y
    Would you like to install the Pi-specific nodes ? [y/N] ?
    y
    

    全部按字母Y,然后按ENTER继续。

    Running Node-RED install for user pi at /home/pi on debian
    
    
    This can take 20-30 minutes on the slower Pi versions - please wait.
    
      Stop Node-RED                       ✔
      Remove old version of Node-RED      ✔
      Remove old version of Node.js       ✔   
      Install Node.js 14 LTS              ✔         
      Clean npm cache                     ✔        
      Install Node-RED core               ✔     
      Move global nodes to local          ✔      
      Npm rebuild existing nodes          ✔          
      Install extra Pi nodes              ✔              
      Add shortcut commands               ✔              
      Update systemd script               ✔               
                                          
    
    Any errors will be logged to   /var/log/nodered-install.log
    

    如果安装出现bad install错误。

    先运行
    sudo apt-get remove nodejs
    删除/usr/bin/node文件夹
    sudo rm -rf /usr/bin/node
    

    Node-RED在开机时启动。

    sudo systemctl enable nodered
    sudo systemctl start nodered
    

    检查Node-RED服务的状态。

    sudo systemctl status nodered
    

    然后通过HACS添加Node-Red Companion插件
    在Configuration.yaml添加如下字符

    panel_iframe:
     nodered:
       title: 'Node-Red'
       icon: 'mdi:shuffle-variant'
       url: 'http://192.168.***.***:1880/'
    

    在homeassistant界面创建产期令牌
    并且在node-red界面加入IP端口信息'http://192.168..:1880/',以及令牌代码,全部部署即完成。

    相关文章

      网友评论

          本文标题:树莓派4B安装NODE-RED

          本文链接:https://www.haomeiwen.com/subject/llfdjrtx.html