question

je-wa avatar image
je-wa asked

Alternative HDMI Display on CerboGX

Hi, I've got an 5.0 HDMI Display using USB for touch on Amazon. https://www.amazon.de/gp/product/B07YCBWRQP/

Using HDMI on a CerboGX Display is working fine. But touch isn't it. So I've managed to find out that horizontal touch resolution works well but vertical resolution is "compressed" to the upper range of the display.

Any ideas to change the "y" touch resolution?

Jens


cerbo gxtouchscreen
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

Try running ts_calibrate. It's not installed by default but MIGHT be available via:

opkg install tslib-calibrate 

On further thought, the local GUI needs to be disabled to run ts_calibrate and not sure you can do that on Cerbo.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

je-wa avatar image
je-wa answered ·

Many thanks for the hint using ts_calibrate.


Following this German HowTo for Venus on a RaspberryPI here are the necessary steps:

1. Update the firmware of the CerboGX

2. make root access and ssh to the CerboGX available. Attention: Don't use special characters in the root password on the remote console (don't know why)

3. login via ssh as root@ip_of_your_CerboGX

4. type the following commands:

opkg update
opkg install tslib-calibrate tslib-conf tslib-uinput tslib-tests 
opkg install qt4-embedded-plugin-mousedriver-tslib

5. set some environment variables by typing the following commands:

TSLIB_FBDEVICE=/dev/fb0
TSLIB_TSDEVICE=/dev/input/touchscreen0
TSLIB_CALIBFILE=/etc/pointercal
TSLIB_CONFFILE=/etc/ts.conf
TSLIB_PLUGINDIR=/usr/lib/ts
touch /etc/venus/headless

The last line ensures that the system boots "headless", so don't expect any output on the display after next reboot!

6. Do a reboot

reboot

7. After 2..3 minutes log in via ssh and type

ts_calibrate

the display resolution should be appearing in the ssh session.

On the display you see a crosshair mark at the left upper side. Touch it precisely, then the mark appears at the right upper side, then left down, right down and at the last in the middle.

8. After that procedure disable the headless by typing

mv /etc/venus/headless /etc/venus/headless.off

9. Edit the GUI startup file using the following command (or use vi ;-) ):

nano /opt/victronenergy/gui/start-gui.sh

insert the following lines in the shell file after the last comment line in the #when headfull section:

export TSLIB_TSEVENTTYPE=INPUT
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/touchscreen0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export QWS_MOUSE_PROTO=tslib:/dev/input/touchscree0

Type <ctrl><x> and save the modifications.

10. reboot again and the display should work with correct touch resolution.

11. disable automatic firmware updates on the CerboGX using the touch display or remote console, that might be destroy the work done yet.

12. log in again as root using ssh and type the following:

cd /data
nano rc.local

paste the following lines in that file

!/bin/bash
if diff /data/start-gui.sh /opt/victronenergy/gui/start-gui.sh >/dev/null;
then
echo „no software update detected, exiting“
else
opkg update
opkg install qt4-embedded-plugin-mousedriver-tslib
opkg install tslib-calibrate
opkg install tslib-conf
opkg install tslib-tests
TSLIB_PLUGINDIR=/usr/lib/ts ts_calibrate
rm /opt/victronenergy/gui/start-gui.sh
cp /data/start-gui.sh /opt/victronenergy/gui/start-gui.sh
mv /etc/venus/headless /etc/venus/headless.off
cp /data/backlight_device /etc/venus/backlight_device
cp /data/blank_display_device /etc/venus/blank_display_device
rm /etc/pointercal
cp /data/pointercal /etc/pointercal
reboot
fi

save using <CTRL><X>.

13. Now type the following lines:

cp /opt/victronenergy/gui/start-gui.sh /data/start-gui.sh
cp /etc/venus/backlight_device /data/backlight_device
cp /etc/venus/blank_display_device /data/blank_display_device
cp /etc/pointercal /data/pointercal

After that all these copied files should appear in the /data directory. You can see this by

ls /data

14. the next step is setting the right permissions

chmod 755 rc.local

15. Last step is rebooting the CerboGX

reboot


Conclusion: The solution saves you around 200 € but it consumes one full-functional USB port of the CerboGX.

6 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jackandy avatar image jackandy commented ·

je-wa I was able to follow along until step 7. When I run ts_calibrate, it returns this error:

"ts_setup: No such file or directory"


This is a CerboGX on firmware 2.91 with a Waveshare 7" rev3.

I noticed in this related video that the error was mentioned. The screen used in that video had two micro USB connectors and he said that it has something to do with the order in which they are connected. My screen only has one microusb port. The other end of the microusb cable is plugged into the middle USB port on the CerboGX.

Thanks.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem jackandy commented ·

ts_calibrate is not installed in Venus OS but you can download and install it with:

opkg update
opkg install tslib-calibrate

Then you can run ts_calibrate

I have found that the only thing from the lengthy instructions je-wa included in an above post are the two above. You do need to add lines to /u-boot/config.txt and for dimming using the RPI display you need to install an overlay.

I recently updated RpiDisplaySetup to provide more display configuration options including running ts_calibrate. Might save you or others time in the future or give you ideas of what to do manually.

https://github.com/kwindrem/RpiDisplaySetup


0 Likes 0 ·
markjeff avatar image markjeff jackandy commented ·
I am having this issue too but tslib-calibrate is definitely installed….


I’m stumped.



0 Likes 0 ·
Show more comments
mufmur avatar image mufmur commented ·

Hi. I am using a cerbo GX with a 7" waveshare screen. Right now everything is cropped and zoomed in. What should I do? This is the screen: https://www.waveshare.com/wiki/7inch_HDMI_LCD_(B)

0 Likes 0 ·
jackandy avatar image jackandy mufmur commented ·
If you haven't tried already, unplug your CerboGX's power cord and then plug it back in. When I do that, my screen formats correctly.
0 Likes 0 ·

Related Resources