-
Enter sudo raspi-config in a terminal window
-
Select Interfacing Options
-
Navigate to and select Serial
-
Choose No (Login shell over serial)
-
Choose Yes (Enable serial hardware)
-
Choose OK
-
Choose Finish
-
Reboot
-
Install git "sudo apt-get update && sudo apt-get install git"
-
Clone this repository "git clone https://github.com/bebben88/nibe2mqtt"
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
Make it autostart on boot
sudo systemctl enable nodered.service
Start Node-RED
sudo systemctl start nodered.service
Import the flow from the file nodered.flows Now you can Deploy.
open folder "cd nibe2mqtt" Build the nibegw.c script with the command "gcc -std=gnu99 -o nibegw nibegw.c"
./nibegw -h
-h Print help
-v Print debug information
-d <device name> Serial port device (default: /dev/ttyS0)
-a <address> Remote host address (default: 127.0.0.1)
-p <port> Remote UDP port (default: 9999)
-f Disable flow control (default: HW)
-r <address> RS-485 address to listen (default: 0x20)
-i Send all messages by UDP (default: only modbus data)
-n Don't send acknowledge at all
-o Send acknowledge to all addresses
-t Test mode
-l <port> Local UDP port for read commands (default: 9999)
-w <port> Local UDP port for write commands (default: 10000)
-q Print data in log format
run example:
./nibegw -v -d /dev/serial0
Verify that the packets are flowing in and Node-RED is sending on Outgoing messages. Then turn it off with CTRL + C.
To make nibegw autostart, follow these steps.
- Move the autostartscript.
sudo cp /home/pi/nibe2mqtt/nibegw.service /lib/systemd/system/nibegw.service
- Make it executable
sudo chmod 644 /lib/systemd/system/nibegw.service
- Reload systemctl daemon
sudo systemctl daemon-reload
- Enable autostart
sudo systemctl enable nibegw.service
- Start NibeGW
sudo systemctl start nibegw.service