question

mattie112 avatar image
mattie112 asked

Waveshare 5" LCD getting touch to work

I currently have this screen: https://www.waveshare.com/wiki/5inch_HDMI_LCD

And the visual part works fine, but I'm having a bit trouble with the touch part. I don't get it to work.

I have the following in my config.txt

dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
dtparam=i2c=on
enable_uart=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=39

But no touch. I have confirmed that I have the "ads7846-overlay.dtb" file in the overlays folder so that should be ok.

I also have the /dev/input/touchscreen0 device and when I 'cat' that file and touch the screen I do get output so it must be registering something. The wiki from my screen lists that you can calibrate it but I cannot install the package as dpkg is not present.

Any tips here? Would be great to get the touch working so I could switch from the menu to the overview :)

Raspberry Pi
2 |3000

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

1 Answer
mattie112 avatar image
mattie112 answered ·

Found it!!! The config.txt listed above is correct (well I need to apply some overscan it seems but hey).

And then I followed https://community.victronenergy.com/articles/10516/howto-use-a-hdmi-screen-with-usb-touch-panel-and-u.html

Basically installing the packages with opkg (so yeah no apt / yum / dpkg) was enough for me. It seems that I didn't need to add all those exports but perhaps some other people need to do that.

Oh and just a small reminder, in order to run the ts_calibrate you must have started your pi in HEADLESS mode (so if you already removed the file just execute 'touch /etc/venus/headless')

2 |3000

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