<< to CrossControl homepage

Support & Service Center

Linux

Linux questions cover a very broad range, but there is also a huge amount of information freely available on the internet. We recommend to visit

VNC server on CC displays

Virtual Network Computing (VNC) allows someone to remotely view and control a computer, or in this case a display. Each of our CCpilot displays can be extended with a VNC server which means you may remotely connect and control the display from a VNC Client. The VNC server has been developed to be a standalone service, without use of Qt or other services.

Attached to this article are installation archives for each of our units. The ZIP-files contains the following:

  • Installation instructions (README)
  • Documentation (WORD)
  • Archive for installation on target

The different display units use the same general SW but needs some specific options to be able to handle the difference in screen sizes. The following options are available:

  • single-touch = only valid for our iMX5 units as they can only use single touch
  • touch-device = touch device to be used (Default: /dev/input/touchscreen0)
  • port = port number to connect to (Default: 5900)
  • passwd = password to view server data (Default: No passwd used)
  • viewonly = no input to server possible
  • verbose = turn on VNC server logging
  • x-scale = x-scaling for the unit (Default: 125)
  • y-scale = y-scaling for the unit (Default: 125)
  • invert = invert x/y scaling (only needed for CCP VC)
  • fps = number of fps (Default: 2)

To connect to the VNC server in the CC display you will need to start a VNC client/viewer on your remote device and connect to the CC display with the IP address. You should see the display screen mirrored on your VNC client and be able to control the display from the VNC client. The documentation shows how to use the VNC viewer in our virtual machine (LinX SW Suite v4).

Known limitations:

Startup delay

When auto starting the VNC viewer at reboot/power up, the touch drivers are not ready to be used. There is a need to add a delay to the startup script. Add the line "sleep 3" before starting the VNC server!

VI2

The VNC viewer used in our VM environment will show the screen contents of the VI2 rotated. And as the VI2 has no touch, it is not possible to control the screen contents.

X900

The VNC viewer used in our VM environment will not show the screen contents of the X900, but the mouse presses will be translated as correct touches on the target. But you can’t see what changes on screen. This is due to some configuration in the X900.
Information about this will be added later.

V700

The installation ZIP for V700 does not contain information on how to autostart VNC at PowerUp/reboot.
Information about this will be added later.

Environment and Versions: 
LinX SW Suite v4

Stream IP-Video from Display to Display or VM to Display

It can be useful to stream video from one display to another, or from the VM to a display.

For example if we want to test that our application processes IP-Video correctly but we are lacking a camera we could use a command like this:

gst-launch-1.0 videotestsrc ! jpegenc !  rtpjpegpay ! udpsink host=192.168.1.2 port=5003

This pipeline will jpeg encode a videotestsrc (a test stream) and send it to 192.168.1.2/5003

If we want to stream a videofile instead we can do this:

gst-launch-1.0 filesrc location=myvideo.mp4 ! decodebin ! jpegenc ! rtpjpegpay ! udpsink host=192.168.1.2 port=5003

Note: Streaming a video can be very taxing on your network!

To receive a any of the streams above we could use a command like this:

gst-launch-1.0 udpsrc port=5003 caps="application/x-rtp,encoding-name=JPEG,payload=26" ! rtpjpegdepay ! jpegparse ! jpegdec ! autovideosink
Applies to version: 
VS, VI

Sending SubscribeROIVideo through the terminal on imx6-based display

For IP cameras following the ISO17215 standard you will sometimes need to send a message to the camera for it to start broadcasting video.

The message is called SubscribeROIVideo and it takes an index as a parameter. The index is what Region of Interest the camera will stream.

One option is to use the IPCameraSettings library to send messages with a simple interface and the other is to use the echo command.

The command we will be using is:

echo -n -e '\x43\x3f\x01\x31\x00\x00\x00\x0c\x12\x34\x56\x78\x01\x01\x00\x00\x00\x00\x00\<Index as byte>'>/dev/udp/<Camera IP>/<SOME/IP communication port>
For example to subscribe to ROI 6, on a camera with IP 192.168.40.90 and SOME/IP port 17215:
echo -n -e '\x43\x3f\x01\x31\x00\x00\x00\x0c\x12\x34\x56\x78\x01\x01\x00\x00\x00\x00\x00\x06'>/dev/udp/192.168.40.90/17215

For information on what ROI's are available on your camera and its communication port, check with your camera supplier.

Environment and Versions: 
VS, VI

Playing videos and creating a splash video

It is possible to play videos on CrossControl displays. The method for playing videos will differ slightly from display to display.

- For VC/VA/XA/XS: There is an application called 'gplay' available through the Linux command line.

Using the applications described above it is also possible to use a short video as a "splash video" when the display boots up instead of using a static image. The attachment below will install a CrossControl splash video as well as the supporting scripts and files. To install and change the splash video to a custom video of your choice, please follow the README file in the attached zip.

AttachmentSize
Package icon Splash_Video_Example (VC/VA/XS/XA)3.08 MB
Category: 

Full screen applications on Qt 5.9.4

A bug in QtWayland 5.9.4 affects how Qt sends fullscreen requests to Wayland. As a result of this bug, functions such as QMainWindow.showFullscreen() does not make the application full screen - only frameless. In order to bypass the bug, the application’s resolution should be fixed to that of the screen. For QWidget based applications, do the following:

QMainWindow view;
view.resize(1280, 800);
view.showFullscreen();
A similar approach can be used for QML applications.
Applies to version: 
CCP VS 1.2.0.0

Using keyboard input in a Qt application in CClinux 1.2.0.0 or newer

On devices running CClinux v1.2.0.0 or newer, Qt applications using keyboard input need to be invoked with the evdevkeyboard plugin flag enabled:

$ ./myApp -plugin evdevkeyboard
Note: In CClinux 1.4.1.0 this flag is enabled by default when running applications after device startup. If invoking an application during startup (e.g. from a script in rcX.c) the evdevkeyboard plugin still needs to be passed on to the application.
Applies to version: 
CCP VS 1.2.0.0

Startup environment variables

During startup, the environment variables HOME and USER are set as following:

  • USER=””
  • HOME=/

If using these variables in an application which is automatically started using a startup script from any of the rc run levels, the variables might need altering. To do so, simply add the desired variable exports to your startup script. See an example below:

#!/bin/sh
 
case "$1" in
    start)
    export USER=root
    export HOME=/home/root
    myApp &
    ;;
esac
Applies to version: 
CCP VS

Auto update CODESYS application from USB

This information assumes that you are familiar with working in Codesys.
The dcoument attached to this article, covers the situation when you already have a working development environment and the runtime is already installed on the target unit. It will also describe how you create files on an USB-stick that will be automatically installed in the display, when the USB is inserted in an USB-port.

The ZIP-file attached contains a copy of the cc-auto.sh and an install-screen used in the script.

It is valid for all our iMX5 displays (XA/XS, VC/VA). For ou iMX6 displays (VS/VI2) there are some things that differ.

Make sure that you look in the correct document attached at the bottom of this article!

Step 1: Update Codesys application on target device

Make all changes and updates to your CODESYS application in your development environment and test it on your target display.

Step 2: Create Boot application

When you have finished 'Step 1', you want to deploy the updated application to your other target display units, so you need to create a Boot Application.

Step 3: Automatic installation from USB

This section describes how to create an automated way to update several displays with the same Codesys application. The files will be saved on an USB-stick and automatically installed when the USB is inserted in the display.


If you have the possibility, try the auto-installation on one of your own displays, before doing it on the field to be sure that the update is working correctly!

Also be aware of the fact, that if you turn off the autostart of the CC settings screen (StartupGui), you won’t be able to ‘see’ the IP address of the display!
The advice is to set a static IP address on your unit so you will be able to find it and so you can connect to it!

Applies to version: 
XA/XS, VA/VC and VS/VI2

ON/OFF signal in display units

In the document ”CCpilot - Technical manual.pdf” for all the display units, there is a general description of the ON/OFF signal and how to handle these signals. The document states that functionality of the ON/OFF signal and On/Off button are configurable. In other Words, the signals can be changed by software, using the CCAux API.

Note, there are some differences between different display units, depending on the OS (Windows or Linux).
For exact details, read the apropriate Technical Manual.


The following explanations shows how the ON/OFF functionality can be altered by the user, using the CCAux API:

Startup procedure:


How long must the ON/OFF signal be ‘high’ for the start-up procedure to start?
  • When the ON/OFF signal goes high for start-up, there is no delay. It is triggered immediately and there is no settable delay here.
  • The option is to configure it to not start from the ON/OFF signal, by using the CCAux function Config_setStartupTriggerConfig().
  • Another option is to set the ON/OFF signal to be level triggered (instead of the default edge triggered mode).
    This can be done by using the function Config_setOnOffTriggerMode().
    • This means that the device is ON when the signal is high and OFF when it is low. The difference is in the behaviour when the signal changes state during startup and shutdown.

Shut-down procedure:


How long must the ON/OFF be ‘low’ before the unit starts the shut-down procedure?
  • By default the ON/OFF signal must be low for 4 seconds before the XL4 starts the shutdown-procedure.
  • This time can be set between 0 4294967295 (seconds), by using the CCAux function ”Config_setExtOnOffSigTrigTime()”.
  • The action can also be set to suspend or do nothing, by using the CCAux function Config_setOnOffSigAction().

Special handling:


What happens if the system is doing something when ON/OFF goes ‘low’?
Will the OS allow the task to end or is it “hard stopped”?

  • If a process/task is doing something when ON/OFF goes ‘low’, a shutdown signal is sent to OS. And if it has not shut down after around 2 minutes, the system will be shut down hard at that time.
  • There is an API that can be found in PowerMgr.h in CCAux (attached below) where a customer application can delay a shutdown, if some critical action needs to be finished before shutting down.

Configuring Edge vs Level trigger:


As mentioned above, users are able to configure edge vs level startup triggering using the CCAux function 'Config_setStartupTriggerConfig()' using C++ or Qt. With the latest version of the OS, users are able to configure the startup trigger with 'ccsettingsconsole' on most displays. While 'ccsettingsconsole' or CCAux in C++ is the preferred method, in cases where a user is utilizing CODESYS and an older version of the OS, we have included a short Qt application that will set the startup trigger to be either Edge or Level triggered. The Qt executable is included in the 'Ignition_Trigger.zip' file attached to this article. To use this application, extract the binary 'Ignition_Trigger' from the zip file and copy over to the '/opt' directory of the display. Make sure it is executable with 'chmod +x /opt/Ignition_Trigger'. You can then find instructions for use by executing it '/opt/Ignition_Trigger --help'.

Note: The application in the ZIP-file below, was compiled for the VC/VA displays.


Note, the CCAux API differs between the display units, so look in the CCAux API Manual to see which functions that are available for a certain display unit.

AttachmentSize
Plain text icon powermgr.h.txt6.36 KB
Package icon ignition_trigger.zip100.21 KB
Environment and Versions: 
Both Linux (ARM and Windows (x86)
Applies to version: 
XL4, XM, XM2, XA, XS, VC, VA, VS, VI2

Remove default Weston ToolBar and add desktop image

This article will show how to add this function/configuration if you want to change the look of the desktop. The configuration file “weston.ini” should come with the standard Linux image for CCP VS. It is used to replace the original desktop that could be seen below the CClauncher application or the customers own application. With this file it is possible to show a picture chosen by the customer.

In the first releases of the CCP VS Linux image, this file is not present. You can use the ‘weston.ini’ file that can be found in the ZIP-file, attached to this article. Edit the contents, to get the desktop-look that you want.

This file contains the following text:

[shell]
panel-location=""
background-color=0x00000000
background-image=/opt/etc/Weston_background_image.jpg

The option “panel-location” is used by Linux images with version 1.1.0.0 or older. Newer releases will use the option “panel-position” instead.
The color option set to 0x00000000 is black.
The image option is a path to the image that will be shown on the desktop. Note, the image should be exactly 1280x800 pixels. If it is smaller, it will be shown as tile. The CrossControl-logo in the ZIP-file attached to this article, has that size.

Do the following steps:

  1. Make OS on VS writeable:
    # sudo mount -o remount,rw / 
  2. Create the folder below and copy weston.ini to the folder:
    # sudo mkdir /etc/xdg/weston  
  3. Put the file “weston.ini” file on an USB stick and insert into VS

  4. Copy “weston.ini” to the folder:
    # cp /media/usbsda1/weston.ini /etc/xdg/weston  
  5. Place the new desktop-logo in the folder stated in weston.ini file:
    # cp /media/usbsda1/Weston_background_image.jpg /opt/etc  
  6. Remove autostart of CClauncher application:
    # cd /opt/etc/rc5.d
    # ln –sf /dev/null S10cclauncher
  7. Reboot the VS:
    # sudo reboot
  8. The toolbar should disappear and the desktop logo added shall be shown!

The default desktop and toolbar.
AttachmentSize
Image icon Default desktop and toobar447.94 KB
AttachmentSize
Package icon weston_on_ccp_vs.zip33.56 KB
Applies to version: 
CCP VS

Pages

whatever