Touch display pligun: screen not correctly detected

Github issue #385

I have a RPI3 with the official touch screen. On rotating the screen via the web ui, the display rotates, but the touch does not.

Symptom/effect is here:
volumio-plugins/plugins/miscellanea/touch_display/index.js, lines 975 to 980

 if (rpiScreen) { 
   bootstring = 'lcd_rotate=2' + os.EOL + 'display_hdmi_rotate=2' + os.EOL; 
 } else { 
   bootstring = 'display_lcd_rotate=2' + os.EOL + 'display_hdmi_rotate=2' + os.EOL; 
   transformationMatrix = '-1 0 1 0 -1 1 0 0 1'; 

I would think rpiScreen would be set here but apparently somethings broken:

 // detect Raspberry Pi Foundation original touch screen
        exec('/bin/grep "^rpi_ft5406\\>" /proc/modules', { uid: 1000, gid: 1000 }, function (error, stdout, stderr) {
          if (error !== null) {
  'No Raspberry Pi Foundation touch screen detected.');
          } else {
            rpiScreen = true;

Output if I run the command in terminal (ssh):
rpiScreen is not set, but it should be.

$ /bin/grep "^rpi_ft5406\\>" /proc/modules
rpi_ft5406 16384 0 - Live 0x00000000

Thanks for reporting. I think I have discovered the reason for the issue. Could you still post or PM the results of cat /boot/config.txt
The fix for your problem will probably be part of the changes I am currently working on in order to enable the plugin to make use of the new userconfig.txt instead of boot.txt (which will preserve rotation and GPU memeory settings in case of a system update).

$ cat /boot/config.txt
initramfs volumio.initrd
#### Touch Display setting below: do not alter ####

#### Volumio i2s setting below: do not alter ####

Note that I changed the script so it writes ‘lcd_rotate’ instead of ‘display_lcd_rotate’.

So, initially you had “display_lcd_rotate” in /boot/config.txt? That would be the wrong entry I expected after your report on GitHub.

Thanks for your feedback!

To add:

the logfile does contain this:

2019-12-03T08:53:21.532Z - info: Raspberry Pi Foundation touch screen detected.
2019-12-03T08:53:21.567Z - info: Using Xorg socket /tmp/.X11-unix/X0
2019-12-03T08:53:21.666Z - info: Backlight module of a Raspberry Pi Foundation touch screen detected.

So the screen is detected but rpiScreen is unset somewhere along the code…?
My Javascript knowledge is too poor to debug this.

Problem has been localized. I hope to be able to commit a bug fix soon. :slight_smile:

The issue should be remedied with version 1.1.4 of the plugin which has been released just lately.