Touchscreen Inverted Display not working with python/kivy app


  • Just to preface this... my Raspad3 is working as expected with relation to touchscreen & auto-rotation in all other applications.

     

    I have installed a python app that provides a PWS (personal weather station) display. It has been around for years and is working perfectly in all other functionality on my Raspad3 and 2 other Rpi setups.

    The app requires Kivy to work and provide the graphical interface.

    The trouble I'm having is when I rotate the display the image auto-rotates correctly, however the touchscreen "hot" point mapping does not. ie I have a button to access the 'Menu' in the bottom right corner of the screen. Once rotated that no longer works. But if I touch the top left corner (just above where the word 'Conditions' appears) of the screen it then goes to the 'Menu'. 

    PWS display



  • @Thomas A. Cichowicz ok lets see if we can fix this for you, as i have a feeling this is just a configuration issue, with pi os rather than a raspad issue.

    Can you go to the desktop, and rotate the screen then try and click on the Pi menu and tell me if that works or if you get same behavior as in kivy ( i suspect you will ).


  • CerberusStyle;

        Yes it works fine. As I stated, the touchscreen works perfectly with everything else except under Kivy.

    The screen auto rotates as expected, but the touch mapping does not.


  • @Thomas A. Cichowicz right ok then if it work on the menu then its not an issue with the rotation script/raspad, it is a issue with how kivy handles touch, so you will need to speak to them and see if they have a fix. 


  • @Thomas A. Cichowicz 

    Please enter this command in the Raspberry Pi terminal and take a screenshot feedback the result

     cat /proc/bus/input/devices

    like this pic:


  • ok.. here you go..


  • @Thomas A. Cichowicz 

    This problem is caused by the hardware model update. We did not realize it, sorry.
    You can solve it this way, first clone the code

    cd ~
    git clone https://github.com/sunfounder/python-sh3001.git
    sudo nano python-sh3001/bin/rotate-helper

    This will open the text editor, replace the code I framed in the picture with

    xinput --set-prop'HID 1997:2433''Coordinate Transformation Matrix' $touch

    Then Ctrl+x to exit, y to save.
    Finally, enter the python-sh3001 root directory, execute the

    sudo python3 install.py

    command to install, and then restart.

     

    P.S. If this does not help you, pls install and restart in the next two working days.

    git pull
    sudo python3 install.py

  • Ok..   did all that.. still no joy. 

    pi@tempest:~ $ git clone https://github.com/sunfounder/python-sh3001.git
    Cloning into 'python-sh3001'...
    remote: Enumerating objects: 178, done.
    remote: Counting objects: 100% (178/178), done.
    remote: Compressing objects: 100% (88/88), done.
    remote: Total 178 (delta 101), reused 134 (delta 61), pack-reused 0
    Receiving objects: 100% (178/178), 39.44 KiB | 859.00 KiB/s, done.
    Resolving deltas: 100% (101/101), done.
    pi@tempest:~ $ sudo nano python-sh3001/bin/rotate-helper
    pi@tempest:~ $ cd python-sh3001
    pi@tempest:~/python-sh3001 $ sudo python3 install.py
    Auto rotator service install process starts
    Install dependency
     - update apt-get... Done
     - install i2c-tools... Done
    Setup interfaces
     - turn on I2C... Done
     - Add I2C module... Done
    Setup auto-rotator service
     - copy rotate-helper file... Done
     - add excutable mode for rotate-helper... Done
     - delete config... Done
     - create config... Done
     - change owner... Done
     - change mode... Done
    Install sh3001 python package
     - run setup file... Done
    Finished
    pi@tempest:~/python-sh3001 $ sudo reboot

    don't bother trying to fix it just for me... I've moved on, I've disabled the auto-rotator, strickly manual now. also even if the fix worked I wouldn't use it in that rotation position. The reason is that when the image is inverted it's no longer vertically centered and the image at the top is off screen. So that the frame in the image is off the screen. I know it's not a big deal but just doesn't look good.


Please login to reply this topic!