Skip to main content

Orangepi/Raspberrypi 板的一些有用脚本

项目描述


DOI

目录

概述

单板计算机的控制功能

在Lubuntu上测试

开放集线器
PyPI 计数器
Github 明星
分支 掌握 开发者
特拉维斯
代码质量 代码节拍徽章 代码因子

作者:Moduland Co

安装

源代码

  • 下载版本 0.50最新源
  • pip3 install -r requirements.txtpip install -r requirements.txt(需要 root 访问权限)
  • python3 setup.py install或者python setup.py install

派皮

康达

  • 检查Conda 管理包
  • conda install -c sepandhaghighi orangetool(需要root权限)

易于安装

  • 运行easy_install --upgrade orangetool(需要root权限)

用法

知识产权功能

import orangetool

#1- local_ip

local_ip=orangetool.local_ip() # this function return local ip of board as string

#2- global_ip

global_ip=orangetool.global_ip() # this function return global ip of board as string

#3- internet 

status=orangetool.internet() #this function check internet connection and return True if internet connection is stable

#4- ping

ip_status=orangetool.ping(ip_address) #this function check ip and return True if this ip is available in network and False otherwise

#5- set_ip

orangetool.set_ip("192.168.1.46","eth0")  #this function set static ip for system

#6- mac

mac_dic=orangetool.mac() # return dict of all system net devices mac addresses

#7- network_enable

status=network_enable("eth0") # enable network device

#8- network_disable

status=network_disable("eth0") # disable network device

内存功能

 
#1- total ram

ram=orangetool.ram_total() #this function return total ram of the board

#2- free ram

ram=orangetool.ram_free() # this function return how much ram is available in the board

#3- ram percentage

ram=orangetool.ram_percent() # this function return used ram percentage

#4- used percentage

ram=orangetool.ram_used() # this function return used ram 

#5- freeup

orangetool.freeup() # To free pagecache, dentries and inodes and return freeuped amount

存储功能

#1- mount_status

mount_details=orangetool.mount_status("sda1") # This function return mount addresses of input device

#2- storage_status

mount_details=orangetool.storage_status() # This function return all of the inserted storage and their status

#3- unmount

orangetool.unmount("/mnt/usb1") # This function unmount input device

#4- unmount_all


orangetool.unmount_all() #This function unmount all of the mounted devices

#5- mount

orangetool.mount("sda1","/mnt/usb1") # This function mount input device in input addresses

#6- usb_on

orangetool.usb_on() # This function enable USB

#7- usb_off

orangetool.usb_off() # This function disable USB

显示功能

#1- hdmi_on

orangetool.hdmi_on() # turn on hdmi port

#2- hdmi_off

orangetool.hdmi_off() # turn off hdmi port

#3- hdmi_size

orangetool.hdmi_size(1280,720) # this function change hdmi display resolution

系统功能

#1- sleep

orangetool.sleep() # put system in sleep mode

#2- hibernate

orangetool.hibernate() # put system in hibernate mode

#3- halt

orangetool.halt() # poweroff system

#4- restart

orangetool.restart() # restart system

#5- wakeup

orangetool.wakeup(day=1,hour=0,minute=1,sync=True) # set rtc wakeuptime

#6- get_temp

temp=orangetool.get_temp() # this function return cpu temperature as string

#7- uptime

time=orangetool.uptime() # this function return uptime of system

#8- idletime

time=orangetool.idletime() # this function return idle of system ( all cores)


#9- version

orangetool.version() # return orangetool version for test

#10- check_update

orangetool.check_update() # Return True if new version is available
  • 所有处于错误状态的函数都返回Error字符串
  • local_ip并且global_ip最初在 ipz 包链接中可用
  • 此版本的 RAM 功能需要 psutil 包
  • 远程运行set_ip函数将冻结您的终端,因此最好将restart参数设置为 True
  • 远程运行halt, restart, hibernate&sleep函数将冻结您的终端
  • 有些功能需要root权限,所以最好sudo -s在使用这个工具之前运行

问题和错误报告

只需填写一个问题并描述它。我们会尽快检查!或发送电子邮件至info@orangetool.ir

依赖项

掌握 开发者

引用

如果您在研究中使用 orangetool,请引用此 ;-)

Sepand Haghighi。2017. Moduland/Orangetool:版本 0.23。(2017 年 7 月)。DOI:http://dx.doi.org/10.5281/zenodo.829797

捐赠给我们的项目

如果你觉得我们的项目很重要,你能支持我们吗?我们的项目不是也永远不会为盈利而工作。我们需要钱,这样我们才能继续做我们所做的事情。

比特币:

1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA

支付(伊朗公民):

执照


Moduland 网站

变更日志

此项目的所有显着更改都将记录在此文件中。

格式基于Keep a Changelog 并且该项目遵循Semantic Versioning

未发布

0.50 - 2021-01-01

添加

  • network_control,network_enablenetwork_disable函数

改变了

  • sync添加到wakeup函数的参数
  • debug添加到internet函数的参数

0.45 - 2020-12-26

添加

  • __main__.py
  • __version__多变的
  • hibernate功能
  • usb_control,usb_onusb_off函数

改变了

  • dev-requirements.txt修改的
  • 测试系统修改
  • DEBUG参数重命名为debug
  • 所有参数移至orangetool_params.py
  • 部分功能移至orangetool_utils.py
  • ADDRESS参数重命名为address
  • Zone参数重命名为zone
  • uptimeidletime功能更新
  • 文档字符串已更新
  • README.md修改的

0.35 - 2019-06-01

添加

  • version_check.py
  • CODE_OF_CONDUCT.md
  • ISSUE_TEMPLATE.md
  • PULL_REQUEST_TEMPLATE.md
  • CONTRIBUTING.md
  • test.sh
  • autopep8.bat
  • dev-requirements.txt
  • CHANGELOG.md
  • MANIFEST.in

改变了

  • README.md修改的
  • 测试系统修改
  • restart,haltsleep修改的功能
  • hdmi_onhdmi_off功能修改
  • version功能修改
  • requirements.txt修改的
  • DEVICE参数重命名为device函数set_ip
  • restart添加到set_ip函数的参数

0.25 - 2017-09-14

改变了

  • 修复了 PyPi 依赖项中的小错误

0.24 - 2017-07-21

改变了

  • 小错误已修复

0.23 - 2017-07-15

添加

  • Check_update功能

改变了

  • 小错误已修复

0.22 - 2017-03-30

添加

  • Version功能
  • Supported_Device_List.md

改变了

  • 小错误已修复

0.2 - 2017-03-06

添加

  • idletime功能
  • mount,unmount函数

改变了

  • 修复了一些错误

0.1 - 2017-02-15

添加

  • Orangepi/Raspberrypi 板的一些有用脚本

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

orangetool-0.50.tar.gz (18.2 kB 查看哈希

已上传 source

内置分布

orangetool-0.50-py2.py3-none-any.whl (15.4 kB 查看哈希

已上传 py2 py3