Yesterday I've received my NanoPi Neo with 256Mb of RAM. Such a cute and tiny board:
It has a bunch of pins too :)
Initial setup
I've started with Armbian first, but I hadn't too much luck. I've been told it was the power supply though :)
After, I've downloaded FriendlyCore from Friendly ARM, which is an Ubuntu Core 16.04 system. It's a bit out of date, but it worked out of the box.
I've logged into the machine via SSH and updated the system:
sudo apt update
sudo apt upgrade
As a bit of hardware, I've got Slaesh's CC2652RB stick (from here). I've got the type 4 for maximum range :)
Install zigbee2mqtt
I've installed the system using verbatim the guide on the site. The only change is that I've used /dev/ttyUSB0
instead of /dev/ttyACM0
.
For my own reference, here are the steps I've run:
-
Add the node 14.x repo:
sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
-
Install the required dependencies:
sudo apt-get install -y nodejs git make g++ gcc
-
Clone the zigbee2mqtt repo (and change the ownership)
sudo git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt sudo chown -R pi:pi /opt/zigbee2mqtt
-
Install dependencies:
cd /opt/zigbee2mqtt npm ci --production
You should get an output similar to:
node-pre-gyp info ok added 383 packages in 111.613s
-
Update the configuration file (
/opt/zigbee2mqtt/data/configuration.yaml
) with something like:# MQTT settings mqtt: # MQTT base topic for Zigbee2MQTT MQTT messages base_topic: zigbee2mqtt # MQTT server URL server: 'mqtt://localhost' # MQTT server authentication, uncomment if required: # user: my_user # password: my_password advanced: network_key: GENERATE
You will want to set up your own mqtt server address (I have mine as plugin in HomeAssistant) and credentials.
-
(optional) Start the server:
cd /opt/zigbee2mqtt npm start
I've done this just to see it connects to the mqtt server.
-
Add the service.
Edit
/etc/systemd/system/zigbee2mqtt.service
with something like:[Unit] Description=zigbee2mqtt After=network.target [Service] ExecStart=/usr/bin/npm start WorkingDirectory=/opt/zigbee2mqtt StandardOutput=inherit # Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5) StandardError=inherit Restart=always User=pi [Install] WantedBy=multi-user.target
-
Start the service:
sudo systemctl start zigbee2mqtt
-
Check it's working:
systemctl status zigbee2mqtt.service
-
If all is ok, then enable the service:
sudo systemctl enable zigbee2mqtt.service
Notes
-
If you run zigbee2mqtt from root, redo
sudo chown -R pi:pi /opt/zigbee2mqtt
because the logs created will be owned byroot
:) -
If the service doesn't work, then check it with the
status
command above. You can also see the error in:sudo journalctl -u zigbee2mqtt.service -f
HTH,
Member discussion: