Read the statement by Michael Teeuw here.
Magic Mirror with touchscreen Display/Monitor
-
@BJK pm2’s JOB is to start and run stuff AND KEEP it running…
so, if it ends. pm2 will start it back up…
and if it errors too many times too fast it will stop restarting…
-
@BJK I don’t start the xin.sh (with pm2). if you read in the xin.sh file you will find instructions how I did it… :) Here you can download the xin.sh.
The script (if you don’t want to download it):
#!/bin/bash # Before I just tested with the xinput command directly in the autostart file, but that did not work. So now instead I just created a script called xin.sh. # nano ~/xin.sh # Then added # DISPLAY=:0.0 xinput --set-prop "Multi touch Multi touch overlay device" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1 # There should actually be 3 spaces between “Multi touch” and “Multi touch overlay device”. For some reason the board removes the extra spaces here. # # You can actually find the “name” of the device with this commandDISPLAY=:0.0 xinput list # Shows something like this: # # Virtual core pointer id=2 [master pointer (3)] # Virtual core XTEST pointer id=4 [slave pointer (2)] # Multi touch Multi touch overlay device id=6 [slave pointer (2)] # Virtual core keyboard id=3 [master keyboard (2)] # Virtual core XTEST keyboard id=5 [slave keyboard (3)] # # Depending on what you have connected to your RPi. 🙂 # # So, after creating the xin.sh I added that to the autostart file for LXDE: # Like this: # nano ~/.config/lxsession/LXDE-pi/autostart # Added at the end of the file. # @/home/pi/xin.sh # Restarted and it works. # DISPLAY=:0.0 xinput --set-prop "Multi touch Multi touch overlay device" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
You have to figure out your own “matrix” of course… :) Not sure if mine is the same…
-
Thank you! :beaming_face_with_smiling_eyes:
Now, after your precise suggestions, I did read up on the autostart for Raspberry:
https://forums.raspberrypi.com/viewtopic.php?t=313191
https://forums.raspberrypi.com/viewtopic.php?f=66&t=294014and using:
“sudo nano /etc/xdg/lxsession/LXDE-pi/autostart”I pasted my line at the end of the the autostart:
@/home/pi/xin.sh
and then saved the fileIn the xin.sh file, I have:
line1: #!/bin/bash
line 2: DISPLAY=:0.0 xinput --set-prop “Multi touch Multi touch overlay device” “Coordinate Transformation Matrix” 0 -1 1 1 0 0 0 0 1So, just two lines and "line1or2: " is not part of the file :smirking_face: (and - as you said - I do have a bit different coordinate compared to you)
AND now it WORKS! Thank you !
-
@BJK Great to hear!! :)
-
@BJK LXDE/autostart is running as root I think…
pm2 autostart is NOT running as root, so u have to use sudo