No internet connection
  1. Home
  2. General

TinyPilot writing script

By Ken Koon Wong @kenkoonwong
    2023-07-27 18:53:31.887Zassigned to
    • @cghague

    Hi, what is the best way to use existing python scripts available on TinyPilot to import typing onto another python script for automation purpose? Just for a simple example, if I want to set keystrokes of a phrase sent to keyboard every day at 8am, how can I use the existing keyboard/type script of tinypilot to do that? I found https://www.rmedgar.com/blog/using-rpi-zero-as-keyboard-send-reports/ and it works, but I find it cumbersome to look up the HID keyboard events for the entire phrase. Thanks!

    • 1 replies
    1. C

      Hi @kenkoonwong, thanks for reaching out with your question about scripting.

      You can programmatically control a TinyPilot device with the Enterprise tier REST API. However, if the Enterprise tier isn't a good match for your needs, you’d need to create your own scripts. I’d recommend starting with this GitHub discussion, which explains the basics including using debug mode to capture the HID event codes.

      The ability to automatically submit snippets of text on a schedule seems like a good idea, so you might be interested to know that I’ve suggested it as a potential future enhancement. You can subscribe to the GitHub issue if you’d like to be notified of any updates on the idea.