Some useful script for Orangepi/Raspberrypi boards
Project description
Table of contents
- Overview
- Installation
- Usage
- Issues & Bug Reports
- Supported Device List
- Dependencies
- Contribution
- Cite
- Authors
- License
- Donate
- Changelog
- Code of Conduct
Overview
Control functions for Single-Board computers
Tested on Lubuntu
Open Hub | |
PyPI Counter | |
Github Stars |
Branch | master | dev |
Travis |
Code Quality |
By Moduland Co
Installation
Source Code
- Download Version 0.50 or Latest Source
pip3 install -r requirements.txt
orpip install -r requirements.txt
(Need root access)python3 setup.py install
orpython setup.py install
PyPI
- Check Python Packaging User Guide
pip3 install orangetool==0.50
orpip install orangetool==0.50
(Need root access)
Conda
- Check Conda Managing Package
conda install -c sepandhaghighi orangetool
(Need root access)
Easy install
- Run
easy_install --upgrade orangetool
(Need root access)
Usage
IP Functions
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
RAM Functions
#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
Storage Functions
#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
Display Functions
#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
System Functions
#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
- All of the functions in error state return
Error
String local_ip
andglobal_ip
originally are available in ipz package Link- RAM functions in this version need psutil package
- Running
set_ip
function remotely will freeze your terminal so it's better to setrestart
parameter to True - Running
halt
,restart
,hibernate
&sleep
functions remotely will freeze your terminal - Some of funtions need root access so it's better to run
sudo -s
before use this tool
Issues & Bug Reports
Just fill an issue and describe it. We'll check it ASAP! or send an email to info@orangetool.ir.
Dependencies
master | dev |
Cite
If you use orangetool in your research , please cite this ;-)
Sepand Haghighi. 2017. Moduland/Orangetool: Version 0.23. (July 2017). DOI:http://dx.doi.org/10.5281/zenodo.829797
Donate to our project
If you feel like our project is important can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do.
Bitcoin :
1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA
Payping (For Iranian citizens) :
License
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
0.50 - 2021-01-01
Added
network_control
,network_enable
andnetwork_disable
functions
Changed
sync
parameter added towakeup
functiondebug
parameter added tointernet
function
0.45 - 2020-12-26
Added
__main__.py
__version__
variablehibernate
functionusb_control
,usb_on
andusb_off
functions
Changed
dev-requirements.txt
modified- Test system modified
DEBUG
parameter renamed todebug
- All parameters moved to
orangetool_params.py
- Some functions moved to
orangetool_utils.py
ADDRESS
parameter renamed toaddress
Zone
parameter renamed tozone
uptime
andidletime
functions updated- Docstrings updated
README.md
modified
0.35 - 2019-06-01
Added
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
Changed
README.md
modified- Test system modified
restart
,halt
andsleep
functions modifiedhdmi_on
andhdmi_off
functions modifiedversion
function modifiedrequirements.txt
modifiedDEVICE
parameter renamed todevice
inset_ip
functionrestart
parameter added toset_ip
function
0.25 - 2017-09-14
Changed
- Minor bug in PyPi dependencies fixed
0.24 - 2017-07-21
Changed
- Minor bugs fixed
0.23 - 2017-07-15
Added
Check_update
function
Changed
- Minor bugs fixed
0.22 - 2017-03-30
Added
Version
functionSupported_Device_List.md
Changed
- Minor bugs fixed
0.2 - 2017-03-06
Added
idletime
functionmount
,unmount
functions
Changed
- Some bugs fixed
0.1 - 2017-02-15
Added
- Some useful scripts for Orangepi/Raspberrypi boards
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
Built Distribution
File details
Details for the file orangetool-0.50.tar.gz
.
File metadata
- Download URL: orangetool-0.50.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acbb5c72a263216444e182c9ccf8400fc11e12791ff1db45335c8a0743826ad1 |
|
MD5 | 988357325273c2445b990d01b9f90bc1 |
|
BLAKE2b-256 | f0d7726423dd2c5106c853475cf0580b01f91c87fe4b975bb6d0a91ee9b6bf13 |
File details
Details for the file orangetool-0.50-py2.py3-none-any.whl
.
File metadata
- Download URL: orangetool-0.50-py2.py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e2e2697962fbbdffd941d2c59cf5838012c88ecd7b66a838c6d4ea068af875 |
|
MD5 | f6e4c5df444863f075ee50d91d621d87 |
|
BLAKE2b-256 | 26ba410f127fe56bb640490a919d7c8804ec611842abb2ccd8622bffc14e895c |