• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Rotating IR-Frame

Scheduled Pinned Locked Moved General Discussion
8 Posts 5 Posters 1.4k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    Bender352
    last edited by Bender352 Apr 10, 2021, 12:24 PM Apr 10, 2021, 12:12 PM

    Hi,
    I struggled a little bit to rotate my IR-Frame to work with my mirror in portrait mode.
    So, I wrote this little guide to help you out. This is a guide from a noob to noobs ;)

    first if you want to rotate your screen, follow this instruction
    How to rotate your screen

    then open a command prompt on your raspberry

    now you must create a new folder

    mkdir ~/startup_scripts
    

    before we create a script, we need some information. Type this in your command prompt

    xinput -list
    

    it will show you something like this

    pic1.JPG

    this shows you the name of the IR-Frame, in my case it is IrScreen cc (yours could be different)

    open a 2nd command prompt, it is time to create our script

    type the following command

    nano ~/startup_scripts/portrait.sh
    

    enter this code

    xinput set-prop "THE NAME OF YOUR IF_FRAME" --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
    

    now youmust enter the exact name of your IR-Frame in the code. In my case the code would look like this

    xinput set-prop “IrScreen cc” --type=float “Coordinate Transformation Matrix” 0 1 0 -1 0 1 0 0 1

    save and exit with Crtl+X and Y

    next step, make the script executable type

    sudo chmod +x ~/startup_scripts/portrait.sh 
    

    now we can test it type

    bash ~/startup_scripts/portrait.sh
    

    your IR-Frame should be set in the right orientation now,

    in case it is inverted then your screen is in portrait mode (rotated 90 clockwise)
    this will inverse the curser, open the portrait.sh file in the nano editor

    nano ~/startup_scripts/portrait.sh
    

    replace the numbers with the following
    0 -1 1 1 0 0 0 0 1

    and it should work for you

    now we only have to add some line to this on every startup of you raspberry.

    sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
    

    and add this line

    @lxterminal -e /home/pi/startup_scripts/portrait.sh
    

    123.JPG
    close and save it with Ctrl+X and Y

    all done

    if you like it, feel free for a up-vote or a comment

    F E 2 Replies Last reply Apr 18, 2021, 4:18 PM Reply Quote 1
    • F Offline
      fordi @Bender352
      last edited by fordi Apr 18, 2021, 4:20 PM Apr 18, 2021, 4:18 PM

      @bender352
      Hi there, thank you for taking the time to write your guide, its something that i would find incredibly useful to get working.

      Here is a copy of xinput -list

      pi@raspberrypi:~ $ xinput -list
      ⎡ 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)]
      pi@raspberrypi:~ $

      After running portrait.sh I’m getting an error: Unable to find “multi

      I have typed the whole line in like you did but i dont think it likes the word touch in portrait.sh?

      CC6BD895-849D-47F1-85F4-2CE08FE5C1B2.jpeg

      Do you have any ideas please?

      B 1 Reply Last reply Apr 23, 2021, 6:05 PM Reply Quote 0
      • B Offline
        Bender352 @fordi
        last edited by Apr 23, 2021, 6:05 PM

        @fordi is it exatly the same name, I think it could alse be case sensitve.
        you could also use the ID Number. Problem is, if you chance the usb port you will probably get also a new ID Number and it wouldn’t match the number in the line.

        Is your name 2 time Multi touch Multi touche overlay device? with that many spaces?

        can you copy paste the

        xinput -list
        

        here

        F 2 Replies Last reply Apr 25, 2021, 6:53 AM Reply Quote 0
        • F Offline
          fordi @Bender352
          last edited by Apr 25, 2021, 6:53 AM

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • F Offline
            fordi @Bender352
            last edited by fordi Apr 25, 2021, 7:05 AM Apr 25, 2021, 7:01 AM

            @bender352

            Hi there, thank you for assisting. Here you go!

            992C87B0-AFB9-42AE-9F2C-9F0C0071D966.jpeg

            Realised the image I was trying to send before was far too big, so have made it smaller.

            There are slot of spaces in the name. Why can’t the manufacturer keep it simple? When I copy paste the text spaces are removed in this forum so i sent a photo.

            B 1 Reply Last reply Apr 28, 2021, 7:33 PM Reply Quote 0
            • B Offline
              Bender352 @fordi
              last edited by Apr 28, 2021, 7:33 PM

              @fordi
              you could try to reference to you IR-Fram via the ID (instead of the device name). But in case you change the USB port it my change so you also have to change the ID number in your script.

              try this

              xinput set-prop 6 --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
              
              F 1 Reply Last reply May 31, 2021, 6:52 PM Reply Quote 0
              • F Offline
                fordi @Bender352
                last edited by May 31, 2021, 6:52 PM

                @bender352 that’s kind of you thank you. So sorry for the delayed reply!!

                1 Reply Last reply Reply Quote 0
                • E Offline
                  elatt @Bender352
                  last edited by Oct 5, 2021, 1:55 AM

                  @bender352 late reply but whenever I try to make it executable it tells me
                  chmod: cannot access ‘/home/pi/startup_scripts/portrait.sh’ : No such file or directory
                  I completed all the steps but wondering if I’m missing something

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy