Hilscher Community Forum
Several questions - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Hardware (https://forum.hilscher.com/forum-4.html)
+--- Thread: Several questions (/thread-727.html)



Several questions - rlahnsteiner - May-6th-2021

Hi, I just purchased my first NetPI RTE and have several questions:

1) Can I access the network settings in the Control panel from a node-red-app? 
2) How can I write/read data from a USB media from Node-red? (Tried to install usbmount, but didn't install.)
3) How can I change the display resolution? I get 640x480 only, unable to change it.
4) How can I set the Chromium-Browser to Kiosk-mode?

Thanks for your assistance.

Best regards

Robert


RE: Several questions - Armin@netPI - May-6th-2021

Hello and welcome,

to your questions.:

1. You know netPI is a Docker host. So it has the netPI OS specific settings and those you can change in a Docker container. Also the security demand was high from the beginning of the development of the netPI product. With this information in your mind we have decided for a deep cut between options relevant for the Host OS only and those you can typically change in additional user containers. For us it was most important that no Docker container ever can compromise the netPI Host OS.  Based on this information I can tell you that no container application including Node-RED ever can change netPIs parameter in a direct way. The only chance you have is to acccess netPIs web UI over a RESTapi as I explained here https://forum.hilscher.com/thread-317.html a while ago. In Node-RED you could use the http request node ... but to be honest ... what do you do after you changed the IP address in node-red ... it will no longer be available over the old ip address and the device needs a power reset in any case. 

2. What is needed first for using an USB drive is that the drive gets available your container. This is nothing Node-RED specific but a general setup of Docker using the "add device" function. Then in turn the /dev/... device is available and seen in the container and then you can use the standard "mount" command in the Node-RED ontainer or start script to mount it. More info about how others get managed this find in this thread: https://forum.hilscher.com/thread-631.html

3. The display resolution is configured to auto-detection mode when the netPI's Rasperry Pi graphics chip is powered. It is set to 1920x1080 by default and is negotiated automatically with the connected monitor over the HDMI bus. But if the monitor does not support this resultion then the PI graphics chip does not offer this resultion and false back to a lower resolution. Also very important is that a monitor is connected during power on to the HDMI port already, else the resolution can't be negotiated and also false back to a lower one in case you plug in the HDMI cable during runtime. On a stanard Raspbian OS you can change the resolution to a fixed value using the "config.txt" file located on the FAT32 boot partition of the SD card. This is the only method you can change a resolution on a Raspberry Pi based product in general. But with netPI you have no chance to modify this file directly over a container, since this access is prohibited cause of our Docker security restrictions. The only chance you have is to open netPI housing, take the SD card out and modify the "config.txt" file manually on an other Linux machine for example.

4.  I am sorry to say that Chromium browser is a user program I have no knowledge of. I used Kiosk mode on my iPad once ... but how to active it with a chromium browser I don't know. And I also don't know if is is possible at ll

Remark: if you feel the netPI OS security restrictions are too high for your demands ... you can always take our the Hilscher SD card and put in you own SD card with Raspbian OS on it and then there is no security and no Docker at all.

Armin


RE: Several questions - rlahnsteiner - May-7th-2021

(May-6th-2021, 12:35 PM)Armin@netPI Wrote: Hello and welcome,

to your questions.:

1. You know netPI is a Docker host. So it has the netPI OS specific settings and those you can change in a Docker container. Also the security demand was high from the beginning of the development of the netPI product. With this information in your mind we have decided for a deep cut between options relevant for the Host OS only and those you can typically change in additional user containers. For us it was most important that no Docker container ever can compromise the netPI Host OS.  Based on this information I can tell you that no container application including Node-RED ever can change netPIs parameter in a direct way. The only chance you have is to acccess netPIs web UI over a RESTapi as I explained here https://forum.hilscher.com/thread-317.html a while ago. In Node-RED you could use the http request node ... but to be honest ... what do you do after you changed the IP address in node-red ... it will no longer be available over the old ip address and the device needs a power reset in any case. 

2. What is needed first for using an USB drive is that the drive gets available your container. This is nothing Node-RED specific but a general setup of Docker using the "add device" function. Then in turn the /dev/... device is available and seen in the container and then you can use the standard "mount" command in the Node-RED ontainer or start script to mount it. More info about how others get managed this find in this thread: https://forum.hilscher.com/thread-631.html

3. The display resolution is configured to auto-detection mode when the netPI's Rasperry Pi graphics chip is powered. It is set to 1920x1080 by default and is negotiated automatically with the connected monitor over the HDMI bus. But if the monitor does not support this resultion then the PI graphics chip does not offer this resultion and false back to a lower resolution. Also very important is that a monitor is connected during power on to the HDMI port already, else the resolution can't be negotiated and also false back to a lower one in case you plug in the HDMI cable during runtime. On a stanard Raspbian OS you can change the resolution to a fixed value using the "config.txt" file located on the FAT32 boot partition of the SD card. This is the only method you can change a resolution on a Raspberry Pi based product in general. But with netPI you have no chance to modify this file directly over a container, since this access is prohibited cause of our Docker security restrictions. The only chance you have is to open netPI housing, take the SD card out and modify the "config.txt" file manually on an other Linux machine for example.

4.  I am sorry to say that Chromium browser is a user program I have no knowledge of. I used Kiosk mode on my iPad once ... but how to active it with a chromium browser I don't know. And I also don't know if is is possible at ll

Remark: if you feel the netPI OS security restrictions are too high for your demands ... you can always take our the Hilscher SD card and put in you own SD card with Raspbian OS on it and then there is no security and no Docker at all.

Armin
Thanks for your help.

I found out how to autostart Chromium in Kiosk-Mode. Just by putting a chromium.desktop file into /etc/xdg/autostart with the content
[Desktop Entry]
Type=Application
Name=Chromium
NoDisplay=false
Exec=chromium-browser --disable-infobars --noerrdialogs --app=http://172.17.0.2:1880/ui --kiosk

Another question: Can I install node-red-contrib-fram into an existing container? Or can I do it from pallet in Node-Red?


RE: Several questions - Armin@netPI - May-7th-2021

I see two options:

1. You could use our Node-RED example https://hub.docker.com/r/hilschernetpi/netpi-nodered where the FRAM node is already preinstalled
    
In the related source code Docker file build script you see how this Node-RED installs this node under https://github.com/HilscherAutomation/netPI-nodered/blob/master/Dockerfile

2. You can install it in your own Node-RED as the Dockerfile is doing it. 

I translated the different Docker file command for you to use in a bash script


Code:
FRAM_NODE=netPI-nodered-fram
FRAM_NODE_VERSION=1.2.0
FRAM_NODE_DIR=/tmp/$FRAM_NODE-$FRAM_NODE_VERSION
curl https://codeload.github.com/HilscherAutomation/$FRAM_NODE/tar.gz/$FRAM_NODE_VERSION -o /tmp/$FRAM_NODE
tar -xvf /tmp/$FRAM_NODE -C /tmp/
mkdir /usr/lib/node_modules_tmp/node-red-contrib-fram
mv $FRAM_NODE_DIR/node-red-contrib-fram/fram.js \
    $FRAM_NODE_DIR/node-red-contrib-fram/fram.html \
    $FRAM_NODE_DIR/node-red-contrib-fram/package.json \
    -t /usr/lib/node_modules_tmp/node-red-contrib-fram
cd /usr/lib/node_modules_tmp/node-red-contrib-fram
npm install

Starting a second Node-RED instance as you proposed is possible but I can't recommend since the first Node-RED occupies the standard port 1880 already and the second container cannot start and would need another port. This is only possible if you would start both containers in bridged mode ... and use the port mapping feature of Docker. 

Thx
Armin