BOSMiner-py
Python client to retrieve data from any miner running Braiins OS+ GRPC and Socket API
Install
pip install bosminer
GRPC API Client Usage
from bos.bosplusapi.client import BosPlusAPI
host = 'moe.s5p8'
miner = BosPlusAPI(f'{host}:50051')
print(miner.CoolingService.GetCoolingState())
{
"fans": [
{"position": 0, "rpm": 3708, "target_speed_ratio": 0.38},
{"position": 1, "rpm": 3708, "target_speed_ratio": 0.38},
{"position": 2, "rpm": 3708, "target_speed_ratio": 0.38},
{"position": 3, "rpm": 3678, "target_speed_ratio": 0.38}
],
"highest_temperature": {
"location": "SENSOR_LOCATION_CHIP",
"temperature": {
"degree_c": 59.5
}
}
}
Implemented Services
All available services are implemented. Check BOS Plus API docs.
Thanks to server reflection and the amazing grpcrequest library, you can easily explore the API and its methods.
In [7]: miner.service_names
Out[7]:
('braiins.bos.ApiVersionService',
'braiins.bos.v1.ActionsService',
'braiins.bos.v1.AuthenticationService',
'braiins.bos.v1.CoolingService',
'braiins.bos.v1.PoolService',
'braiins.bos.v1.TunerService',
'braiins.bos.v1.ConfigurationService',
'braiins.bos.v1.MinerService',
'grpc.reflection.v1alpha.ServerReflection')
In [8]: miner.MinerService.method_names
Out[8]: ('GetMinerDetails', 'GetMinerStats', 'GetHashboards')
In [9]: miner.MinerService.GetMinerDetails()
Out[9]:
{'uid': 'PuiPCrGshtlJZzzM',
'miner_identity': {'brand': 'MINER_BRAND_ANTMINER',
'model': 'MINER_MODEL_ANTMINER_S19J_PRO',
'name': 'Antminer S19J Pro'},
'platform': 'PLATFORM_AM3_BBB',
'bos_mode': 'BOS_MODE_SD',
'bos_version': {'current': '2023-05-29-0-1daef48b-23.03.2-plus',
'major': '2022-09-13-0-11012d53-22.08-plus',
'bos_plus': True},
'hostname': 'moe',
'mac_address': '6c:79:b8:75:25:cc',
'system_uptime': '193692'}
Socket API Client Usage
from bos.bosminer.client import BosMiner
host = 'moe.s5p8'
miner = BosMiner(host)
print(miner.fans())
{
"STATUS": [
{
"STATUS": "S",
"When": 1684941022,
"Code": 202,
"Msg": "4 Fan(s)",
"Description": "BOSer boser-buildroot 0.1.0-0ce150e9"
}
],
"FANS": [
{
"FAN": 0,
"ID": 0,
"RPM": 3226,
"Speed": 32
},
{
"FAN": 1,
"ID": 1,
"RPM": 3315,
"Speed": 32
},
{
"FAN": 2,
"ID": 2,
"RPM": 3226,
"Speed": 32
},
{
"FAN": 3,
"ID": 3,
"RPM": 3255,
"Speed": 32
}
],
"id": 1
}
Implemented commands
All available commands are implemented. Check Bosminer API docs.
The commands switchpool, enablepool, disablepool, addpool and removepool are not fully implemented in Braiins OS. The outcome of these commands is reset after restart and they do not activate the pools. This is a known issue and is being fixed.
Metadata
Release files for bosminer 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bosminer-1.3.0.tar.gz | 3.9 kB | Without provenance | Details for bosminer-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bosminer-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for bosminer-1.3.0-py3-none-any.whl |
Total release size: 8.1 kB
Release files / bosminer-1.3.0.tar.gz
| Download URL | bosminer-1.3.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7733e179edbc161f03dfb57d0bdef6356ec30ed222759d18cf2623df69354811
|
|
BLAKE2b-256 checksum How to use checksums |
59a9f0772fca86d60b4071ffe352a26d407e5fa6d9efc4b72f9e633e1742330a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / bosminer-1.3.0-py3-none-any.whl
| Download URL | bosminer-1.3.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
807b9adf664d00c939b6f0f097e11aceb4bded3a76c59f788883150ca27d156d
|
|
BLAKE2b-256 checksum How to use checksums |
c63a1fa92c5ebb91fbeb7c25b83a179d5f05c7429160dcd25c9a8fe4bfa1131e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for bosminer 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.