No internet connection
  1. Home
  2. General

how to start add feature to tinypilot

By @binooetomo
    2023-12-05 05:04:25.811Z

    Hi ...
    I have some knowledge on Python Flask, and Arduino.
    I want to to try to add feature to tinypilot so that tinypilot able to do remote ATX controll to managed node.

    It'll consist of:
    a. A python script that extend existing flask script
    b. A python script that act as worker (must be started every boot time)

    1. Is there any documentation where to put files on tinypilot for the scripts?
    2. Is it breaking the law if it will need redis installed?. I will need it since I will use RS232 to communicate to managed nodes. so it will single threaded. need kind of queueing system to anticipate operational request.
    3. Is it breaking the law if it'll need tinypilot to have and import additional python modules (i.e: celery)

    Sincerely
    -bino-

    • 2 replies
    1. Thanks for reaching out!

      Is there any documentation where to put files on tinypilot for the scripts?

      We don't document it, but it should be straightforward to find where a file lives by looking at where similar files currently live.

      We do have documentation here:

      Is it breaking the law if it will need redis installed?. I will need it since I will use RS232 to communicate to managed nodes. so it will single threaded. need kind of queueing system to anticipate operational request.

      Is it breaking the law if it'll need tinypilot to have and import additional python modules (i.e: celery)

      It's not breaking TinyPilot rules, but we also wouldn't be accepting changes that add power control into the main codebase. We can help you manage your own fork and point people to it when they request power control, but we don't have the bandwidth to support power control features.

      That said, adding redis and celery for this seems like overengineering. Wouldn't you basically just need the TinyPilot to turn a Pi GPIO pin on or off? Why would that require a whole separate queue and processing module? Turning on a GPIO pin takes a few milliseconds, so it's not going to lock up the main thread. Even if it did, you could do it with Python's native subprocess module like we do already for background tasks:

      https://github.com/search?q=repo%3Atiny-pilot%2Ftinypilot%20subprocess&type=code

      1. B@binooetomo
          2023-12-06 03:07:50.792Z

          Dear Sir.

          I really appreciate you for spending your valuable time for responding to my post.

          I knew that turning GPIO high/low will take very short time.

          But I'm planing to use this to controll multiple node. Nodes that didn't have tinypilot in it.

          and the topology will like: this

          Since it will use Raspi's UART, it will only comunicate to one node at a time.
          Thats why it will need some queueing mechanism. and there will only one process that accessing UART pin.

          But if the flask run with only single process/worker, I'll good without any queueing mechanism.

          Sincerely
          -bino-