Orangepi/Raspberrypi 板的一些有用脚本
项目描述
目录
概述
单板计算机的控制功能
在Lubuntu上测试
| 开放集线器 | |
| PyPI 计数器 | |
| Github 明星 |
| 分支 | 掌握 | 开发者 |
| 特拉维斯 |
| 代码质量 |
作者:Moduland Co
安装
源代码
- 下载版本 0.50或最新源
pip3 install -r requirements.txt或pip install -r requirements.txt(需要 root 访问权限)python3 setup.py install或者python setup.py install
派皮
- 检查Python 打包用户指南
pip3 install orangetool==0.50或pip install orangetool==0.50(需要 root 访问权限)
康达
- 检查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
支付(伊朗公民):
执照
变更日志
此项目的所有显着更改都将记录在此文件中。
格式基于Keep a Changelog 并且该项目遵循Semantic Versioning。
未发布
0.50 - 2021-01-01
添加
network_control,network_enable和network_disable函数
改变了
sync添加到wakeup函数的参数debug添加到internet函数的参数
0.45 - 2020-12-26
添加
__main__.py__version__多变的hibernate功能usb_control,usb_on和usb_off函数
改变了
dev-requirements.txt修改的- 测试系统修改
DEBUG参数重命名为debug- 所有参数移至
orangetool_params.py - 部分功能移至
orangetool_utils.py ADDRESS参数重命名为addressZone参数重命名为zoneuptime和idletime功能更新- 文档字符串已更新
README.md修改的
0.35 - 2019-06-01
添加
version_check.pyCODE_OF_CONDUCT.mdISSUE_TEMPLATE.mdPULL_REQUEST_TEMPLATE.mdCONTRIBUTING.mdtest.shautopep8.batdev-requirements.txtCHANGELOG.mdMANIFEST.in
改变了
README.md修改的- 测试系统修改
restart,halt和sleep修改的功能hdmi_on和hdmi_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
查看哈希)
内置分布
orangetool-0.50-py2.py3-none-any.whl
(15.4 kB
查看哈希)
关
orangetool -0.50.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | acbb5c72a263216444e182c9ccf8400fc11e12791ff1db45335c8a0743826ad1 |
|
| MD5 | 988357325273c2445b990d01b9f90bc1 |
|
| 布莱克2-256 | f0d7726423dd2c5106c853475cf0580b01f91c87fe4b975bb6d0a91ee9b6bf13 |
关
orangetool -0.50-py2.py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 83e2e2697962fbbdffd941d2c59cf5838012c88ecd7b66a838c6d4ea068af875 |
|
| MD5 | f6e4c5df444863f075ee50d91d621d87 |
|
| 布莱克2-256 | 26ba410f127fe56bb640490a919d7c8804ec611842abb2ccd8622bffc14e895c |