Closed RefineryX closed 5 years ago
Actually... the above error was down to the fact I don't have a pi
user on my system - instead I use diepi
user. I corrected this and rebooted - however it does not start upon boot.
dietpi@SmartHome:~$ sudo systemctl status zigbee2mqtt
● zigbee2mqtt.service - zigbee2mqtt
Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; disabled; vendor preset: enabled)
Active: inactive (dead)
I started again sudo systemctl start zigbee2mqtt
and checked the status and it looks as though its online.
Do you know how I can get this to run after a restart?
Fixed. Had to enable using sudo systemctl enable zigbee2mqtt.service
- wasn't clear in the virtual environment documentation. Having to switch between to pages.
For everyone else who doesn't use virtual env. I got the same issue but with clean installation. I used node as runner instead of npm.
ExecStart=/home/pi/.nvm/versions/node/v10.15.3/bin/node index.js
Please make sure your node path is correct by:
whereis node
WORKS !!!! Really thanks.
2 days to read and try everything nodejs (v12.16.3) is installed from root and haven't pi user, juste 'root' and i created 'jeed'
So, i just replace :
ExecStart=/usr/bin/npm start
by
ExecStart=/root/.nvm/versions/node/v12.16.3/bin/node index.js
and
User=pi
by
User=root
Now, service is launched at boot
2024.06.19 WORKS !!!
So, i change :
User=pi >>>>> User=root
[Unit] Description=zigbee2mqtt After=network.target
[Service] Environment=NODE_ENV=production Type=notify ExecStart=/usr/bin/node index.js WorkingDirectory=/opt/zigbee2mqtt StandardOutput=null StandardError=inherit WatchdogSec=10s Restart=always RestartSec=10s User=root
[Install] WantedBy=multi-user.target
AČIŪ !!!
Followed the Running Zigbee2mqtt in Virtual Environment docs perfectly. Then at step 5: Running as a daemon with systemctl....
I create the file
sudo nano /etc/systemd/system/zigbee2mqtt.service
and addI check start
sudo systemctl start zigbee2mqtt
Upon checking the status, I get this error