發表文章

目前顯示的是有「centos」標籤的文章

centos 8 安裝node-red 與 mosquitto-1.6.8

今天來用我大centos裝node-red 與 mosquitto 裝到一半 幹咧 阿怎麼沒有mosquitto 只好從官網抓QAQ 然後自己make 自己 make install 不囉嗦 上步驟: yum install epel-release yum install gcc-c++ make yum install openssl-devel firewall-cmd --permanent --zone=public --add-port=1880/tcp firewall-cmd --permanent --zone=public --add-port=1883/tcp firewall-cmd --reload curl -sL https://rpm.nodesource.com/setup_12.x | bash - yum install nodejs npm install -g node-red npm install -g node-red-dashboard npm install -g node-red-admin node-red-admin hash-pw vim .node-red/settings.js (把你的username 跟 password 的hash填進去) wget https://mosquitto.org/files/source/mosquitto-1.6.8.tar.gz tar -zxvf mosquitto-1.6.8.tar.gz make make install mosquitto_passwd -c /etc/mosquitto/passwd admin cp /etc/mosquitto/mosquitto.conf.example /etc/mosquitto/mosquitto.conf vim /etc/mosquitto/mosquitto.conf 199行 加入 user root 因為新的mosquitto 好像不讓root開(? 650行 加入 password_file /etc/mosquitto/passwd 這邊是要指定password file 最後: mosquitto...

node-red 寫成服務時遇到 typeerror the path argument must be of type string. received type undefined

之前有在我的NUC的VM上架過node-red 這次把它寫成服務時 卻噴了 typeerror the path argument must be of type string. received type undefined 這個錯誤 以下是我服務寫成的內容 [Unit] Description=node-redd Daemon after=network.target [Service] Type=forking ExecStart=/home/node-red-start.sh ExecStop=/home/node-red-stop.sh StandardOutput=tty [Install] WantedBy=multi-user.target node-red-stop.sh: #!/bin/sh ps aux | grep node-red | awk '{print $2}' | xargs kill -9 node-red-start.sh: #!/bin/sh node-red & 會噴出錯誤的原因主要是我之前居然是用root開node-red的 他找不到我放在 /root/.node-red/settings.js 所以把node-red-start.sh 內容修改一下: #!/bin/sh node-red -s /root/.node-red/settings.js & 就行了