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:

Nicko453 wrote:QLCPLUS_OPTS="-platform linuxfb:fb=/dev/fb1 -plugin evdevtouch:invertx --web --operate"
Yes, that should do it...but you need to make sure that /dev/fb1 is actually there first...

Have you tried the command I suggested ?

Code: Select all

cp /dev/urandom /dev/fb1
By the way, it would be nice if you can post a link to the product page and a link to the vendor instructions that you tested to be working (so I can evaluate the differences with the display I own)
User avatar
Frank
Posts: 66
Joined: Tue Jun 09, 2015 7:34 am
Real Name: Frank

Dear Massimo,

when using "rpi-display" (for a Watterott 2,8") instead of "piscreen" (for your original 3,5" display) the Rpi uses the TFT as expected and the touch surface responds too...
... but the direction of the touch coordinates can't be changed via "-plugin evdevtouch:invertx" or "...inverty" for example.

So the "rotate" parameter (inside 'config.txt') has to be "0". Any other value for "rotate" rotates the screen content as expected, but the touch coordinates don't match the buttons and sliders (for example) because they aren't influenced by that parameter (invertx and so on). Currently it would be necessarily to have a "swapaxis" parameter to match a "rotate= 90" value, but if "evdevtouch" doesn't work at all I don't know what to do...

Did you found any further information about this behaviour yet?

BTW,

Code: Select all

evtest /dev/input/event0
[/b]
works fine and shows the touch coordinates. Maybe you found a solution already?

Many thanks in advance!
Frank
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

-plugin evdevtouch:rotate=90
...or whatever value you need
User avatar
Frank
Posts: 66
Joined: Tue Jun 09, 2015 7:34 am
Real Name: Frank

Dear Massimo,

I'm really impressed about your experience, really! And you can believe it or not, I "googeled" a lot of time but couldn't find any hint so far...

I'm wondering why the original TFT (you'd used) reacts to "invertx" as well as to "inverty", but the other display needs a "rotate" parameter... Is this documented inside the TFT driver???

Did you find any solution for calibrating the touch functionality? Are the min and max values for every axis stored inside any configuration file that can be edited? Or do other parameters exist for that "-plugin evdevtouch:" already? This would help a lot while using these nice touchscreens...

Many, many tanks for your valuable hints and solutions!
Frank
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

I googled "evdevtouch rotate" and the 4th result was this:
http://stackoverflow.com/questions/2175 ... pplication

[EDIT]
Did you find any solution for calibrating the touch functionality?
Qt has no calibration parameters, but kernel drivers do. You should look up here: https://github.com/notro/fbtft/wiki/Touchpanel
User avatar
Frank
Posts: 66
Joined: Tue Jun 09, 2015 7:34 am
Real Name: Frank

"Even a blind pig can find an acorn" :shock:
... this aims at myself, of course!


Dear Massimo,

your notes concerning calibrating the touch functionality weren't successfully so far, because my experience isn't high enough to understand exactly how to configure a kernel driver. But I won't loose the hope that you will explain or test it by yourself, because this calibration should be very important for an effective use of a TFT touchscreen...

But another result is available now! I was wondering why you mentioned some special types of TFT like
hy28a, hy28b, mz61581, piscreen, pitft28-resistive (former pitft), rpi-display, tinylcd35.

Firstly I thought, this listing was only an example of the possibilities the Notro driver (included in the linux kernel)...
But then I found, that you had delivered these "overlay files" inside the /root/overlays folder and therefore I searched for a specific overlay for the Waveshare 32 touchscreen. This one can be found here: https://github.com/swkim01/waveshare-dt ... verlay.dtb

Copying the file into that folder and changing the line of /boot/config.txt to

Code: Select all

dtoverlay=waveshare32b,speed=16000000,rotate=270
("rotate=270" for my specific application of course) after reboot this delivered the "long awaited" functionality of that (cheap) TFT.

Calibration - as mentioned very often - is a big wish nevertheless....

Frank
User avatar
Frank
Posts: 66
Joined: Tue Jun 09, 2015 7:34 am
Real Name: Frank

Hi,

as I reported this morning, in the end it wasn't impossible to connect another TFT touchscreen to the RPi QLC+ based on Massimos actual image file (July 7th, 4.9.1) .

Because the "WaveShare 3.2 inch" display is of size 320 x 240 pixels, it could be interesting for somebody to see it in comparison to another "3.5 inch" display with 480 x 320 pixels. The latter is the same one as Massimo described here (see above).

The picture below shows these two display side by side with a similar content (basing on the same project file)... At the left side you can see the "large" display (480 x 320), at the right the smaller one (320 x 240).

One can see of course, that the "big" display shows more details (because of the higher resolution), but the "small" one is very good usable too! The latter (at least the two exemplars I own) has a much more better precision concerning the touch accuracy! While the "large" display should get a possibility to calibrate the touch functionality, the small one works "out of the box" very accurately. But this may be accidentally...

I think that such a touchscreen is really very helpfully to get the RPi QLC+ stand alone, for electing from different sequences / chasers and playback them...

BTW, I'm using very small FTDI circuit boards (powered from the RPi USB connector, consuming only a few milliamperes) that are connected (soldered) to (very tiny) wireless DMX transmitters. This way there is no wiring necessarily between the RPi QLC+ and the lamps that are controlled by the RPi. If anybody is interested in this technique, I could present a construction guidance, if Massimo permits this...

Frank
DSC_0699.jpg

Enclosed two little photos of the wireless dmx-transmitter consisting of two parts (FTDI circuit and wireless dmx):
part_1.jpg
part_2.jpg
BigByte76
Posts: 2
Joined: Fri Aug 07, 2015 9:21 am
Real Name: Michael Norman

I recently purchased a 10" universal LCD with HDMI interface and capacitive multi-touch form chalkboard electronics and I'm having trouble getting single touch working which according to there website it should work by default. I have tried using the raspbian image to make sure it works straight out of the box which it does. Is there anything special that needs to be done to get usb touch screens to work with the qlc+ image?
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

BigByte76 wrote:I recently purchased a 10" universal LCD with HDMI interface and capacitive multi-touch form chalkboard electronics and I'm having trouble getting single touch working which according to there website it should work by default. I have tried using the raspbian image to make sure it works straight out of the box which it does. Is there anything special that needs to be done to get usb touch screens to work with the qlc+ image?
Are the touch events captured on /dev/input/event ?
My image is a standard Raspbian, but stripped to the bone. Maybe this particular touchscreen requires some extra packages not installed in my image.
Did you check the touch screen events using XOrg on the standard Raspbian ?
BigByte76
Posts: 2
Joined: Fri Aug 07, 2015 9:21 am
Real Name: Michael Norman

mcallegari wrote:
BigByte76 wrote:I recently purchased a 10" universal LCD with HDMI interface and capacitive multi-touch form chalkboard electronics and I'm having trouble getting single touch working which according to there website it should work by default. I have tried using the raspbian image to make sure it works straight out of the box which it does. Is there anything special that needs to be done to get usb touch screens to work with the qlc+ image?
Are the touch events captured on /dev/input/event ?
My image is a standard Raspbian, but stripped to the bone. Maybe this particular touchscreen requires some extra packages not installed in my image.
Did you check the touch screen events using XOrg on the standard Raspbian ?
I tried to see if the events are captured but I get a bad command error, my guess is I'm not typing it in correctly. Also, where do you get the XOrg from and how to use it?

I did some more searching on the manufactures website of my touchscreen and says it needs the 'hid-multitouch'. I tried following there instructions linked bellow. Can you think of anything else?
http://www.chalk-elec.com/?p=2060
http://www.chalk-elec.com/?p=2028

Thanks,
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