Hi everyone, due to the coronavirus, I have to work at home for my project, which is adapted from my co-worker.
One part of the project is interfacing as: Raspberry Pi 3 <-> RS485 Converter <-> speed controllers -> fans
We use the RS485 Converter as:
On my Pi, I'm using Nodered (Nodejs v12.16.1). The starting flow is:
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.63:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
To find more nodes and example flows - go to http://flows.nodered.org
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
9 Apr 15:54:39 - [info]
Welcome to Node-RED
===================
9 Apr 15:54:39 - [info] Node-RED version: v1.0.4
9 Apr 15:54:39 - [info] Node.js version: v12.16.1
9 Apr 15:54:39 - [info] Linux 4.19.66-v7+ arm LE
9 Apr 15:54:40 - [info] Loading palette nodes
9 Apr 15:54:44 - [info] Dashboard version 2.19.4 started at /ui
9 Apr 15:54:44 - [info] Settings file : /home/pi/.node-red/settings.js
9 Apr 15:54:44 - [info] Context store : 'default' [module=memory]
9 Apr 15:54:44 - [info] User directory : /home/pi/.node-red
9 Apr 15:54:44 - [warn] Projects disabled : editorTheme.projects.enabled=false
9 Apr 15:54:44 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
9 Apr 15:54:44 - [info] Server now running at http://127.0.0.1:1880/
9 Apr 15:54:44 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
9 Apr 15:54:44 - [info] Starting flows
9 Apr 15:54:47 - [info] Started flows
9 Apr 15:54:47 - [info] serial port /dev/ttyUSB1 opened at 115200 baud 8N1
Now I'm not sure how I should be able to talk to the speed controller via RS485. I got confused between the:
node-red-contrib-modbus
,
node-red-contrib-serial-modbus
, and the
node-red-contrib-serialport-rs485
.
I do not know which one to use. But the last one seems most suitable for my project, so I tried to install it but failed. It said
`Failed to install: node-red-contrib-serialport-rs485
Install failed
Check the log for more information`
This is the log:
Log
I'm working via realVNC installed in the PI, so I'm not really able to test each method. With the three libraries above, can anyone suggest which one should I use? and if possible, how could I test them in my case? My goal is to turn on/off the fans as well as able to adjust their speed.
Thank you in advance for any help.
I'll provide more info if anyone needs it.