No internet connection
  1. Home
  2. General

Possible to add a Mouse Jiggler?

By @ppxntwq
    2021-02-23 20:26:59.523Z

    Would like to be able to keep remote device awake that doesn't have typical "sleep" settings.

    • 9 replies
    1. It's unlikely that I'll add this to the web app anytime soon, but you can do this easily with a shell script.

      If you SSH in to your TinyPilot and run these commands, it will jiggle the mouse every three seconds.

      wget https://gist.githubusercontent.com/mtlynch/906534da530482e9afcf1e1309b3dbbe/raw/3e51ba4fe87d609503d19cf1404d259d1a1ea9e2/tinypilot-jiggle.bash
      chmod +x tinypilot-jiggle.bash
      ./tinypilot-jiggle.bash
      

      The script is pretty straightforward, so you can modify it to tweak the timing:

      https://gist.github.com/mtlynch/906534da530482e9afcf1e1309b3dbbe

      1. T
        In reply toppxntwq:
        Brandon Friesen @TCW
          2022-06-24 15:28:01.132Z

          I would like to see this added to the WebUI. I have a hardware based jiggler that moves the mouse cursor 1pixel at a time but it would be nice not to have to plug another device into the target machine.

          1. Thanks for the feedback!

            Have you tried using the software-based jiggle script above?

          2. T
            In reply toppxntwq:
            @tinyuser2022
              2022-11-22 09:29:28.198Z

              Hi, the script works but how can you run it in the backround without a permanent ssh connection?

              1. TMike @tiny_flyer
                  2022-11-29 16:49:27.111Z

                  To run any script to persist in the background add you would execute the command as follows
                  nohup ./tinypilot-jiggle.bash &

                  The nohup portion runs the command regardless of console connection. The ampersand "&" runs the process in the background. Used together it runs the script in the background and doesn't stop when the connection is dropped

                  1. Thanks for sharing this Mike! It's worth noting that the script won't automatically restart if the TinyPilot device has been rebooted when using this method - you'll need to SSH in and manually launch it each time that happens. There are ways to get the script to automatically launch on startup but I'd advise against that as it's caused issues for troubleshooting in the past.

                    1. TMike @tiny_flyer
                        2022-12-01 14:27:35.610Z

                        Thank you for clarifying Charles. You are correct.

                  2. T
                    In reply toppxntwq:
                    @tinyuser2022
                      2022-11-29 19:25:47.612Z2022-11-29 21:13:49.754Z

                      Hi, i added a cronjob with the specific mouse parameters from the script. So it just runs in the background even after a reboot. Since now i do not have any hassle.

                      # m h  dom mon dow   command
                      */5 * * * * /bin/echo -ne "\0\x03\x16\x58\x4c\0\0" > /dev/hidg1
                      */5 * * * * /bin/echo -ne "\0\xbc\x1b\xdd\x2a\0\0" > /dev/hidg1
                      
                      1. Thanks for sharing this with us @tinyuser2022!