Installing Video/Audio device

From wiki.ferrari.mo.it
Jump to navigation Jump to search

Installing Video/Audio device

The chosen device is a Nanopi M4 from FriendlyElec.

Estimated hardware costs:

Per device: $ 80.97, including:

  • Board;
  • Power adapter and cable;
  • Heat sink;
  • EMMC module (16GB);
  • American/European adapter.

Plus, shipping costs ($ 11.00).

In the case of fast and secure shipping with DHL (recommended), an average of $ 5.00, plus the VAT on the entire costs will be added.

Total cost: € 85 (plus VAT) per piece.

Installation

Download the 'Official-ROMs-eMMC-20190718.7z' file from the FriendlyArm Google repository (about 16GB).

Then, extract the 'rk3399-eflasher-friendlydesktop-bionic-4.4-arm64-20190718.img' file and flash it through balenaEtcher to a (minimum 16GB) SD card.

Insert both the eMMC module and the SD card on the NanoPI M4 device, and power on it. Connect a monitor and a keyboard/mouse to the device, and flash the eMMC module. Then remove the SD card and restart it.

Software

Connect via SSH, and install the required modules.

apt-get update
apt-get install x11vnc
apt-get install vlc
apt-get install clementine
apt-get install shotwell
apt-get install libreoffice
apt-get install smbclient

Maybe vlc should be started with the command:

vlc --vout x11

Configuration

Then configure the board:

npi-config

Set:

  • timezone;
  • language;
  • name of the device;
  • audio device.

From the GUI, configure the audio via the left-top corner icon. Both the devices listed should be set to 'analog audio' and set to active.

Transfer your background (1920x1080) and, with right-click on the desktop, select desktop preferences and set the background image.

Icons:

  • From a terminal, go to '/home/pi/desktop' and move the unneeded files;
  • from the left-top menu, select the needed icons and right-click, then select 'add to desktop'.

VNC

Command to run x11vnc:

x11vnc -auth /var/run/lightdm/root/:0 -loop

Remote and local storage

Create a local link to the desktop for the (optional) local storage:

ln -s /local /home/pi/Desktop/localstorage

/xxxx is the path of the local storage, maybe this should be mounted with the usual command

mkdir /local
mount /dev/xyz /local

Create a remote link to the desktop for the remote storage:

mkdir /remote
mount -t cifs //<IP>/<DIR> /remote -o username=<X>,password=<Y>,vers=2.0
ln -s /remote /home/pi/Desktop/remotestorage

Start at boot

Create the file /etc/systemd/system/x11vnc.service:

[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service

[Service]
ExecStart=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth guess -rfbauth /etc/x11vnc.pass
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2

[Install]
WantedBy=multi-user.target

Then, enable it:

systemctl enable x11vnc.service

Disable screen

Go to the menu, and then to Preferences - Light Locker settings. Disable it.

You should create a script that executes this command:

xset dpms force off

If the monitor is seeking for a signal, maybe it will we reactivated in seconds. So, maybe you have to do a script that repeats the same command every second until the monitor gives up searching.