Instruction For Ubuntu Node-Red-pm2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

 Sudo apt update

 Sudo apt upgrade

1. To Enable Automatic Login.

2. Install and Configure X11VNC Server.


 x11vnc package will provide the vnc server software capability.  The software is available
in the Ubuntu repository by default and can be installed quickly through the command
line. To install the x11vnc component, you simply issue the following command. 

sudo apt-get install x11vnc -y

 Securing VNC connection through password usage

sudo x11vnc -storepasswd /etc/x11vnc.pass

 Taking Ownership of the file to change the Permission of x11VNC.pass

 Set correct permissions on the /etc/x11vnc.pass file 


 sudo chown -R iot /etc/x11vnc.pass
 Creating the service Unit File for x11vnc

 pkexec chown root:root /etc/sudoers /etc/sudoers.d -R

sudo gedit /lib/systemd/system/x11vnc.service

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -loop -forever -bg -rfbport 5900 -xkb -noxrecord -noxfixes -noxdamage
-shared -norc -auth /run/user/1000/gdm/Xauthority -rfbauth /etc/x11vnc.pass
[Install]
WantedBy=multi-user.target

This file need to be populated with the following information. As mentioned earlier, the UID for gdm
account is critical in this configuration (see text in orange). Ensure that the uid value in the file
match your configuration.  This information needs to be correct in order to have the service start
and running and save the file.

 Enable and Start the Service


 sudo systemctl enable x11vnc.service
 sudo systemctl daemon-reload
 sudo systemctl start x11vnc.service

 Start vnc at login.

Open Startup Application.

Click Add and in the dialog box, provide a name and the command line to be executed
(x11vnc -rfbport 5900 -rfbauth /etc/x11vnc.pass)
3. Firefox in Startup

 Open Startup Application add firefox.


 Type Firefox in command box.
 Save and reboot.
Node Red in startup
1. pm2 start /usr/local/lib/node_modules/node-red/red.js

2. pm2 startup

3. sudo env PATH=$PATH:/usr/local/bin


/usr/local/lib/node_modules/pm2/bin/pm2 startup system -u iot
--hp /home/iot

Install RS232 Driver


sudo chmod 777 /dev/ttyUSB0

sudo usermod -aG dialout iot

Time
1. In nano /etc/ntp.conf file, modify as below.  This will
set our NTP server

2. Add pool (ntp server ip) iburst


3. Restart Ntp.service:
Systemctl restart ntp.service
4. Local time to hwclock
hwclock --systohc --localtime

You might also like