This flow reads the IP address, generates and displays a QR-code.
This eases the use of a smartphone to connect to the dashboard by reading the QR-code.
The final IP address can be customised with the customise node:
msg.payload = payload.networkInterfaces.*.address[$contains($, /192./)]
msg.payload = "http://" & payload & ":1880/ui"
The exec node should mention the exact path to qr
for Command.
Here, the exact path is /usr/local/bin/qr
, obtained with which
:
% which qr
/usr/local/bin/qr
The flow requires an external QR-code generator, like the qrcode
Python package.
Install Python packages image
and qrcode
with
pip3 install image
pip3 install qrcode
Usage: qr "Some text" > test.png
Usage: qr "Some text"
Reference: https://pypi.org/project/PyQRCode/
node-red-dashboard
to display the imagenode-red-node-base64
to format the imagenode-red-contrib-os
to read the IP address, could be replaced by another solutionnode-red-contrib-image-output
to debug the flow, could be omitted
Hello to all,
I can run the qr command with putty but I can not run it in the node-red with exec node.Could you help me ?