Skip to main content

Control Raspberrypi board with ssh and python

Project description

Raspberry Pi controller

help

Raspberrypi controller Wiki

Feature

  1. Connect in ssh to the Raspberry Pi or any linux (Feature may be not presents)
  2. Can connect using IP or DOMAIN (.local included)
  3. Module and Global call are supported
  4. The function can be run on the Raspberry Pi by adding @raspberry_control.raspberry_command() on top of a function and get the result
  5. Get Output of a function that was run on the raspberry
  6. Real-time output
  7. Run command on the Raspberry Pi with raspberry_control.run_command("command here")
  8. You can do @raspberrypi.timeout(time,default) will change the timeout for a functions
  9. Get file from the server and read it ? / write it localy and update after on the server

Example

import raspberrypi_control # import package for raspberrypi controlling over ssh  
import os # raspberryPi control can automacly install package.
import time  
  
rp = raspberrypi_control # rp is for RaspberryPi  
  
i = 1234567890  
  
  
@rp.raspberry_command() # When function is called its automatcly run on the raspberrypi fallback : local
def test():  
    print("Hello RaspBerryPi")  
    return "finished"  
  
  
@rp.raspberry_command() # When function is called its automatcly run on the raspberrypi fallback : local
def other():  
    global i  
    print("Hello RaspberryPi h")  
    th = 0  
    print(i)  
    os.system("echo Hello World")  
    while True:  
        th = th + 1  
        if th == 30:  
            time.sleep(0.1)  
            break  
    return th  
  
  
if __name__ == "__main__": # put all you're code to run at start here. Because if not the code will be run 2 time  
    rp.raspberrypi().set_raspberry_info("username here", "password here") # set login info here
    rp.raspberrypi().set_preparation("raspberrypi.local", 8, 1) # config locator for the raspberrypi  
    rp.raspberrypi().local() # set the start ip set in the line in the top  
    rp.config("main") # file name if this file (no .py)  
    rp.run_command("Hello World",True) # true is for if console ouput is print or no
    print(test())  
    print(other()) # you can get the output after

How to install the package

Do pip install raspberry-control Supported for python 3.10 and higher* *note not tested for lower version
Was tested to work on linux and window. Mac support may be limited
dependencies = [ "requests", "paramiko", "psutil" ]

Bug report

Github - Issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raspberrypi_control-2.0.6.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raspberrypi_control-2.0.6-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file raspberrypi_control-2.0.6.tar.gz.

File metadata

  • Download URL: raspberrypi_control-2.0.6.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for raspberrypi_control-2.0.6.tar.gz
Algorithm Hash digest
SHA256 d228871f33263e43642ef0a511b7be4789c87ffa3e47cc0ca6ccab4e235979ab
MD5 9017a4ae8c31debf0309e34e498368f5
BLAKE2b-256 bc2029c3c9f9e356c0d4ddaabe11e9b020b20ee413b6c1ff8c5646112be27f18

See more details on using hashes here.

File details

Details for the file raspberrypi_control-2.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for raspberrypi_control-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0886f2ed65c4c2ec736a2b32c203a3ceab1a20998ef14d3d96cd5539ffc3b483
MD5 ef3a215d9e48b65c47f3997ba8fc7e35
BLAKE2b-256 c65363cbaf57eb8f34491b05987ff6042747da7ed5a5fa02c0535a82af5d8a50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page