Showing posts with label Node-red. Show all posts
Showing posts with label Node-red. Show all posts
Connect SAJ Solar Inverter to Node-Red (part 3)
Node-Red flow part 2
Node 7:
Display Day power text nodeNode 8:
Display Day power gauge nodeNode 9:
Display State text nodeNode 10:
Display Power text nodeNode 11:
Display Power gauge nodeNode 12:
Display Power chart nodeNode 13:
Display Max Power text nodeConnect SAJ Solar Inverter to Node-Red (part 2)
Node-Red flow part 1
Node 1:
Inject every second a TimestampNode 2:
Connect to http://192.168.1.24/real_time_data.xmlNode 3:
Convert XML to a Javascript ObjectNode 4:
Convert the Javascript Object to individual ObjectsNode 5:
Convert the OnjectsNode 6:
Select the objectsConnect SAJ Solar Inverter to Node-Red (part 1)
My SAJ Solar Inverter:
Model: Sununo Plus 4K-M:
http://www.saj-solar.com/SAJ Solar Inverter local webpage:
http://192.168.1.24SAJ Solar Inverter local data:
http://192.168.1.24/real_time_data.xmlNode-Red program:
Node-Red screenshot:
https://192.168.1.31:1880/uiNode-Red Security
Log in to the Raspberry Pi using Putty
and login with admin and your password.
Stop Node-Red
sudo systemctl disable nodered.service
node-red-stop
sudo reboot & exit
Generating new SSH keys
cd .node-red
(cd /home/pi/.node-red or cd ~/.node-red)openssl genrsa -out privatekey.pem 1024
openssl req -new -key privatekey.pem -out private-csr.pem
openssl x509 -req -days 365 -in private-csr.pem -signkey privatekey.pem -out certificate.pem
ls -all
and you find 3 new files:- certificate.pem
- private-csr.pem
- privatekey.pem
Update settings.js
nano settings.js
- uncomment lines:
- var fs=required("fs");
- https: {
- key: fs.readFileSunc('/home/pi/.node-red/privatekey.pem')
- cert: fs.readFileSunc('/home/pi/.node-red/certificate.pem')
- },
- adminAuth: {
- type: "credentials",
- users: [{
- Username: "admin",
- password: " --- ",
- permissions: "*"
- }]
- },
- save & exit settings.js
Install node-red-admin
su
(to log as root)npm install -g node-red-admin
exit
pwd
cd .node-red
node-red-admin hash-pw
Start Node-red
sudo systemctl enable nodered.service
node-red-start
and login with admin and your password.
Update Node-Red on the Raspberry Pi
Update Raspberry Strecht Lite to the latest version.
Log in to the Raspberry Pi using PuttyType the following commands one by one
sudo rpi-update
sudo reboot & exit
(reboot the Raspberry Pi)sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get dist-upgrade
sudo reboot & exit
(reboot the Raspberry Pi)
Install the latest Node.js and Npm
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
To find the version type this commands:
node -v
v8.9.3
npm -v
5.5.1
Install n
sudo npm install -g n
sudo n latest
sudo npm install -g npm@latest
sudo reboot & exit
(reboot the Raspberry Pi)
node -v
v9.3.0
npm -v
5.6.0
Start and Stop Node-Red
node-red-stop
- to stop Node-rednode-red-start
- to start Node-Rednode-red-log
- to view the recent log outputsudo systemctl enable nodered.service
- to autostart Node-Red at every bootsudo systemctl disable nodered.service
- to disable autostart on bootFix the Serialport Error
cd .node-red
node-red-stop
sudo npm rebuild
de-red-start
(ctrl c to exit Node-red)
Start Node-Red as a service
sudo systemctl enable nodered.service
node-red-start
(ctrl c to exit Node-red)
Node-Red
Install Node-red on the Raspberry Pi
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
https://youtu.be/3SxMvdSnaQk
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
What do you need?
- Raspberry Pi
- Power supply 5V 2A
- SD Card with Raspbian Strech Lite link
- UTP Cable
- Case for the Raspberry Pi
- PuTTy on a Windows or Linux computer.
https://youtu.be/3SxMvdSnaQk
Subscribe to:
Posts (Atom)