New QLC+ ... touchscreen support

All the topics related to QLC+ on the Raspberry Pi
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Hey, I moved this discussion here
viewtopic.php?f=7&t=8801&p=38307
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

mcallegari wrote: Fri Jun 05, 2015 12:57 pm Good news everyone !

After a 3 months odyssey with the italian posts (which ended up in me receiving a broken display!) I've finally being able to bring one 3.5" 480x320 TFT at home.
This is the item: http://www.aliexpress.com/snapshot/6696212639.html
It is similar to all the ones we've discussed before in this thread (Watterot, Adafruit, etc..) but it's incredibly cheap...and it just works fine !
I do not suggest to purchase a display with a resolution lower than 480x320. You would have serious problems in designing a Virtual Console on lower resolutions.

The good news is that the latest QLC+RPI image (20150412) has all the necessary software to make them work.
Thanks to the inclusion of the fbtft driver in the standard linux kernel: https://github.com/notro/fbtft
More or less, the supported displays are listed here: https://github.com/notro/fbtft/wiki/LCD-Modules

All the chinese clones marked as "Raspberry Pi LCD/TFT touchscreen" should work, just make sure they use SPI for the display and a compatible driver for the touchscreen surface.
Mine uses the XPT2046 touchscreen controller.

So, I'm proud to say QLC+ on the Raspberry Pi supports another piace to make a fully standalone controller with touchscreen support.
Here's a picture of mine running:
IMG_0883-2.jpg

And here's the instructions to make it work:

Edit 'config.txt' file in the vfat partition and add this line at the end of the file:

Code: Select all

dtoverlay=piscreen,speed=16000000,rotate=90
if 'piscreen' doesn't work for you (e.g. you don't see any image on the TFT, the possible values are:

Code: Select all

hy28a, hy28b, mz61581, piscreen, pitft28-resistive (former pitft), rpi-display, tinylcd35
Also, you might wanna play with the 'rotate' parameter.
(optional) If you want to see the boot messages as well, edit the 'cmdline.txt' file and add this at the end of the kernel parameters:

Code: Select all

fbcon=map:10
(optional)Boot the RPi, login via SSH and test the screen with this command:

Code: Select all

cp /dev/urandom /dev/fb1
Finally, configure QLC+ to start on the new display.
Edit the /etc/init.d/qlcplus file and add the following at the beginning of the line starting with QLCPLUS_OPTS=" ... ":

Code: Select all

-platform linuxfb:fb=/dev/fb1 -plugin evdevtouch:invertx
Enjoy !
Hi Massimo,

I’m very late to the party, but thank you for doing the research on this.

The info above, the edits and sections of code we should take note of, are they all still valid for the latest QLC+ rpi image (as far as you’re aware)?

Thanks
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

I think so.
By the way, there's a chapter in the PDF I provided with the RPi image dedicated to touchscreens and displays.
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

Thanks Massimo

I’ll read the pdf side by side with this post to make sure I choose the right screen and get the setup right 👍🏻
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

mcallegari wrote: Mon Oct 29, 2018 4:24 pm I think so.
By the way, there's a chapter in the PDF I provided with the RPi image dedicated to touchscreens and displays.
Just read the pdf and yep, don’t know why I didn’t realise it had the same info as that earlier post 🤦🏻‍♂️

Found this page on the adafruit site for their tft screens. Certainly appears as though this is for the fbtft compatible screens, so thought you might find it interesting. (don’t have a screen to test it myself yet). It talks about hdmi mirroring (so, tft and hdmi showing the same thing), something I ‘think’ wasn’t possible before. Anyway, here’s the link...

https://learn.adafruit.com/adafruit-pit ... -install-2
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

Massimo

When setting up the screen did you have to change any parameters to adjust the resolution of the screen?
I've got my adafruit 3.5" screen working by running their script, but QLC+ is running so large that I can't even see the tabs to switch to virtual console

Do you think that running the code from your post will sort that?

I'm more than happy to just run the code that you provided in you post, but can you help me a little with one part.
You've said to edit the config.txt file in the vfat partition. I'm assuming it'll be sudo nano config.txt, but can you help by telling me what the path is to the config file. Thanks

edit: just found 'df -Th' to find the name of the vfat partition
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

New Image.jpg
This is the config file in my boot sector, with the code generated by the adafruit script
I tried changing dtoverlay and speed to the values posted by Massimo, but it made no difference on my little display

Has anyone had any joy in changing the screen resolution of QLC+ on a SPI driven display?

Also, I tried the random pixel thing, but it didn't work. I am getting a display, so I'm assuming I'm using the correct driver. Could I be mistaken?

Thanks

**EDIT**

Didn't realise changing screen resolution was as simple as going into raspi-config!!!

Got it working, but the QLC+ GUI behaviour seems erratic. I'm going to play around with different drivers (etc) to see if that is what is causing the issue.

Currently found that 800 x 600 appears great until you use the tabs at the bottom to switch between IO / Virtual Console / etc. Once I leave the IO page the tabs and top menu disappear.

If I go to 1024 x 720 then the different pages seem to interfere with each other and glitch out.

Will play with changing drivers/etc. in config.txt and upload pics or videos when I get chance.
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

mcallegari wrote: Fri Jun 05, 2015 12:57 pm
Frank wrote:Is there a possibility to reduce the resolution of the hdmi output (maybe VGA or so), so that the shown virtual console could be more useable at the small touchscreen??? Or has the "mirrored" display content always "full hd" resolution? (... and is therefore always only the "upper left corner" of the full hd internal representation...?).
I don't understand this one. Are we still talking about TFT displays (which are SPI) or HDMI panels ? They are separate outputs, and QLC+ cannot render on both simultaneously.
The Adafruit script I ran inserted code allowing display of QLC+ simultaneously on spi and hdmi. I wonder (given Massimo’s last sentence above) if the adafruit code is what is corrupting the spi display? (I didn’t try connecting hdmi after I found how to adjust resolution in raspi-config). More experimentation this weekend!

https://www.raspberrypi.org/documentati ... t/video.md

**edit**
Looking at info in this link shows that I’m outputting video to hdmi at a different resolution than defined in raspi-config. I’m thinking this is creating conflict and could be why my display is weird. So, first job is to make sure that hdmi and spi and identical.

(I connected to my HDMI screen at home this morning, while also using the spi tft, and it just works now. No idea what fixed it, but I'm not going to look a gift horse in the mouth)

Also, the tft doesn't power off during shutdown, it just retains its last image.
This link shows you how to make the backlight of the screen turn off. I've implimented it. It works. I think its worthwhile, especially if you have installed a shutdown/wakeup button

https://willhaley.com/blog/power-off-ra ... -shutdown/

**edit**
'Kinda' connected to all this, if you want to install a physical shutdown button to your rpi (very useful if headless or very small screens)
- add this code to /boot/config.txt
dtoverlay=gpio-shutdown,gpio_pin=3,active_low=1,gpio_pull=up
- wire a 'normally open' momentary switch between pins 5 and 6 on the GPIO header

When running pressing the button will issue the 'shutdown' command. Safe to remove power when the green ACT led stops flashing.
If you don't remove the power at that point then pressing the button again restarts your rpi.
richbass
Posts: 86
Joined: Wed Sep 12, 2018 10:44 am
Real Name: Richard

If using the adafruit spi tft displays, here is one easy way to dim the screen backlight (which I find is far too bright by default)

either by ssh or by exiting QLC+ enter the following code:

sudo sh -c 'echo "0" > /sys/class/backlight/soc\:backlight/brightness'
gpio -g mode 18 pwm
gpio pwmc 1000
gpio -g pwm 18 500

The final figure of 500 is what actually sets your brightness, and this can be anything between zero (off) and 1023.
Once you've played around and figured out the value you like you can make the RPi boot to your chosen value by doing this:

sudo nano /etc/rc.local

and entering those same four lines of code, with the brightness value you desire.
Just make sure you enter the lines of code before 'exit 0'

**edit**
For the code above to work you need install wiringPi

Follow the instructions here

http://wiringpi.com/download-and-install/
(very simple)
Post Reply