Bitaxe Monitor
Monitor and retrieve status information from Bitaxe Gamma (and compatible) Bitcoin miners via their HTTP API.
Overview
Bitaxe Gamma is an open-source Bitcoin miner based on the BM1370 ASIC. It exposes a REST API at http://<ip>/api/system/info that returns real-time statistics including:
- - Hashrate (current, 1m, 10m, 1h averages)
- Power consumption and voltage
- Temperatures (ASIC, voltage regulator)
- Fan speed and RPM
- Share statistics (accepted/rejected)
- Best difficulty found
- WiFi status and signal strength
- Pool connection info
- Uptime and version info
Usage
Use the provided script to fetch and display miner status:
CODEBLOCK0
IP Configuration
The script looks for the Bitaxe IP in this order:
- 1. Command line argument
- Config file (
~/.config/bitaxe-monitor/config.json) - INLINECODE2 environment variable
- Error (if none found)
Saving IP Configuration
Option 1: Save to config file (recommended)
python3 scripts/bitaxe_status.py --set-ip 192.168.1.100
This saves the IP to
~/.config/bitaxe-monitor/config.json.
The config file is stored in a dedicated directory and does not modify your shell profile files.
Option 2: Set environment variable
CODEBLOCK2
Option 3: Set for a single command
CODEBLOCK3
Checking Status
With IP configured:
CODEBLOCK4
Override with different IP:
CODEBLOCK5
Get raw JSON data:
CODEBLOCK6
API Endpoints
The Bitaxe API provides these main endpoints:
- -
GET /api/system/info - Complete system status (used by default) - INLINECODE5 - ASIC-specific settings
- INLINECODE6 - Historical statistics (requires data logging enabled)
- INLINECODE7 - Dashboard-formatted statistics
Key Status Fields
| Field | Description | Unit |
|---|
| INLINECODE8 | Current hashrate | GH/s |
| INLINECODE9 |
1-minute average | GH/s |
|
hashRate_10m | 10-minute average | GH/s |
|
power | Power consumption | Watts |
|
temp | ASIC temperature | °C |
|
vrTemp | Voltage regulator temp | °C |
|
fanspeed | Fan speed percentage | % |
|
fanrpm | Fan RPM | RPM |
|
sharesAccepted | Accepted shares | count |
|
sharesRejected | Rejected shares | count |
|
bestDiff | Best difficulty found | number |
|
wifiRSSI | WiFi signal strength | dBm |
|
uptimeSeconds | System uptime | seconds |
Resources
scripts/
- -
bitaxe_status.py - Main script to fetch and display Bitaxe status
- Supports both text (human-readable) and JSON output formats
- Handles connection errors gracefully
- Formats key metrics with emoji indicators
- Reads IP from config file or
BITAXE_IP environment variable
- Saves IP to config file with INLINECODE23
Configuration
Config File Location
The script stores configuration in:
CODEBLOCK7
This directory is created automatically when using --set-ip.
Environment Variables
| Variable | Description | Required |
|---|
| INLINECODE25 | IP address of your Bitaxe miner | Alternative to config file |
Error Handling
The script handles common errors:
- - Connection failures (wrong IP, device offline)
- Invalid JSON responses
- Network timeouts
- Missing IP (prompts user to configure IP)
Command Reference
| Command | Description |
|---|
| INLINECODE26 | Check status using saved configuration |
| INLINECODE27 |
Check status of specific IP (one-time) |
|
bitaxe_status.py --set-ip <IP> | Save IP to config file |
|
bitaxe_status.py --format json | Output raw JSON |
|
bitaxe_status.py --format text | Output formatted text (default) |
Examples
Quick setup (do once):
CODEBLOCK8
Daily usage:
CODEBLOCK9
Check multiple miners:
CODEBLOCK10
References
For complete API documentation, see the official Bitaxe wiki:
https://osmu.wiki/bitaxe/api/
The OpenAPI specification is available at:
https://github.com/bitaxeorg/ESP-Miner/blob/master/main/http_server/openapi.yaml
Bitaxe Monitor
通过HTTP API监控并获取Bitaxe Gamma(及兼容型号)比特币矿机的状态信息。
概述
Bitaxe Gamma是一款基于BM1370 ASIC芯片的开源比特币矿机。其REST API接口位于http:///api/system/info,可返回实时统计数据,包括:
- - 算力(当前、1分钟、10分钟、1小时平均值)
- 功耗与电压
- 温度(ASIC芯片、电压调节器)
- 风扇转速与RPM
- 份额统计(接受/拒绝)
- 最佳难度值
- WiFi状态与信号强度
- 矿池连接信息
- 运行时间与版本信息
使用方法
使用提供的脚本获取并显示矿机状态:
bash
python3 scripts/bitaxe_status.py [ip地址] [--format {json,text}] [--set-ip IP]
IP配置
脚本按以下顺序查找Bitaxe IP地址:
- 1. 命令行参数
- 配置文件(~/.config/bitaxe-monitor/config.json)
- BITAXE_IP环境变量
- 报错(若均未找到)
保存IP配置
选项1:保存至配置文件(推荐)
bash
python3 scripts/bitaxe_status.py --set-ip 192.168.1.100
此操作将IP保存至~/.config/bitaxe-monitor/config.json。
配置文件存储在专用目录中,不会修改您的shell配置文件。
选项2:设置环境变量
bash
export BITAXE_IP=192.168.1.100
python3 scripts/bitaxe_status.py
选项3:单次命令设置
bash
BITAXEIP=192.168.1.100 python3 scripts/bitaxestatus.py
检查状态
已配置IP时:
bash
python3 scripts/bitaxe_status.py
使用不同IP覆盖:
bash
python3 scripts/bitaxe_status.py 192.168.1.105
获取原始JSON数据:
bash
python3 scripts/bitaxe_status.py --format json
API端点
Bitaxe API提供以下主要端点:
- - GET /api/system/info - 完整系统状态(默认使用)
- GET /api/system/asic - ASIC专用设置
- GET /api/system/statistics - 历史统计数据(需启用数据记录)
- GET /api/system/statistics/dashboard - 仪表盘格式统计数据
关键状态字段
| 字段 | 描述 | 单位 |
|---|
| hashRate | 当前算力 | GH/s |
| hashRate_1m |
1分钟平均算力 | GH/s |
| hashRate_10m | 10分钟平均算力 | GH/s |
| power | 功耗 | 瓦特 |
| temp | ASIC温度 | °C |
| vrTemp | 电压调节器温度 | °C |
| fanspeed | 风扇转速百分比 | % |
| fanrpm | 风扇RPM | RPM |
| sharesAccepted | 接受份额 | 数量 |
| sharesRejected | 拒绝份额 | 数量 |
| bestDiff | 最佳难度值 | 数值 |
| wifiRSSI | WiFi信号强度 | dBm |
| uptimeSeconds | 系统运行时间 | 秒 |
资源
scripts/
- - bitaxe_status.py - 获取并显示Bitaxe状态的主脚本
- 支持文本(人类可读)和JSON两种输出格式
- 优雅处理连接错误
- 使用表情符号指示器格式化关键指标
- 从配置文件或BITAXE_IP环境变量读取IP
- 通过--set-ip将IP保存至配置文件
配置
配置文件位置
脚本将配置存储在:
~/.config/bitaxe-monitor/config.json
使用--set-ip时会自动创建此目录。
环境变量
| 变量 | 描述 | 是否必需 |
|---|
| BITAXE_IP | Bitaxe矿机的IP地址 | 替代配置文件 |
错误处理
脚本处理常见错误:
- - 连接失败(IP错误、设备离线)
- 无效JSON响应
- 网络超时
- 缺少IP(提示用户配置IP)
命令参考
| 命令 | 描述 |
|---|
| bitaxestatus.py | 使用已保存配置检查状态 |
| bitaxestatus.py <IP> |
检查指定IP的状态(单次) |
| bitaxe_status.py --set-ip
| 将IP保存至配置文件 |
| bitaxe_status.py --format json | 输出原始JSON |
| bitaxe_status.py --format text | 输出格式化文本(默认) |
示例
快速设置(仅需一次):
bash
python3 scripts/bitaxe_status.py --set-ip 192.168.1.100
日常使用:
bash
python3 scripts/bitaxe_status.py
检查多台矿机:
bash
python3 scripts/bitaxe_status.py 192.168.1.100
python3 scripts/bitaxe_status.py 192.168.1.101
参考
完整API文档请参阅官方Bitaxe维基:
https://osmu.wiki/bitaxe/api/
OpenAPI规范可在以下地址获取:
https://github.com/bitaxeorg/ESP-Miner/blob/master/main/http_server/openapi.yaml