Summary
AntMinerV2020::pause() currently sends a partial JSON payload to /cgi-bin/set_miner_conf.cgi, but at least some older
Bitmain stock firmware versions require the browser/UI-style full config payload with Content-Type: text/ plain;charset=UTF-8.
As a result, pause() returns false or times out, and the miner does not enter sleep mode.
Current behavior
For stock Antminer firmware, Pause::pause() reads /cgi-bin/get_miner_conf.cgi, then sends one of these partial JSON
payloads:
or:
{"bitmain-work-mode":"1"}
via AntMinerWebAPI::set_miner_conf.
On the affected firmware, this does not change the mode. get_miner_conf.cgi continues to report:
Affected device / firmware
Observed on:
Antminer S19j Pro
Linux 4.9.113 #1 SMP PREEMPT Mon Dec 26 17:29:52 CST 2022
system_filesystem_version: Mon Dec 26 17:10:01 CST 2022
firmware_type: Release
Browser behavior that works
The stock web UI sends a full config payload to the same endpoint:
POST /cgi-bin/set_miner_conf.cgi
Content-Type: text/plain;charset=UTF-8
X-Requested-With: XMLHttpRequest
Accept: application/json, text/javascript, /; q=0.01
Example body:
{
"bitmain-fan-ctrl": false,
"bitmain-fan-pwm": "100",
"miner-mode": 1,
"freq-level": "100",
"pools": [
{
"url": "stratum+tcp://example:3334",
"user": "user1",
"pass": ""
},
{
"url": "stratum+tcp://example:3334",
"user": "user2",
"pass": ""
},
{
"url": "stratum+tcp://example:443",
"user": "user3",
"pass": ""
}
]
}
Notable differences from the current asic-rs request:
- Content-Type is text/plain;charset=UTF-8, not application/json
- the body is the full miner config, not only the mode key
- the UI uses miner-mode: 1 as a number
- the UI includes existing pool/fan/frequency fields
Expected behavior
AntMinerV2020::pause() should support this older stock UI payload shape, or fall back to it when the partial JSON update
does not apply.
A possible approach:
- Read get_miner_conf.cgi
- Try the current partial JSON behavior
- Re-read config and verify sleep mode
- If unchanged, send a full UI-style config payload using text/plain;charset=UTF-8
- Confirm either miner-mode == 1 or bitmain-work-mode == 1
Why this matters
Consumers of Pause::pause() expect a successful result to mean the miner is actually entering sleep mode. On this
firmware, the current call can fail or time out without changing the miner state, preventing safe workflows that need
mining stopped before installation or maintenance.
Summary
AntMinerV2020::pause()currently sends a partial JSON payload to/cgi-bin/set_miner_conf.cgi, but at least some olderBitmain stock firmware versions require the browser/UI-style full config payload with
Content-Type: text/ plain;charset=UTF-8.As a result,
pause()returnsfalseor times out, and the miner does not enter sleep mode.Current behavior
For stock Antminer firmware,
Pause::pause()reads/cgi-bin/get_miner_conf.cgi, then sends one of these partial JSONpayloads:
{"miner-mode":"1"}or:
{"bitmain-work-mode":"1"}via AntMinerWebAPI::set_miner_conf.
On the affected firmware, this does not change the mode. get_miner_conf.cgi continues to report:
Affected device / firmware
Observed on:
Antminer S19j Pro
Linux 4.9.113 #1 SMP PREEMPT Mon Dec 26 17:29:52 CST 2022
system_filesystem_version: Mon Dec 26 17:10:01 CST 2022
firmware_type: Release
Browser behavior that works
The stock web UI sends a full config payload to the same endpoint:
POST /cgi-bin/set_miner_conf.cgi
Content-Type: text/plain;charset=UTF-8
X-Requested-With: XMLHttpRequest
Accept: application/json, text/javascript, /; q=0.01
Example body:
{ "bitmain-fan-ctrl": false, "bitmain-fan-pwm": "100", "miner-mode": 1, "freq-level": "100", "pools": [ { "url": "stratum+tcp://example:3334", "user": "user1", "pass": "" }, { "url": "stratum+tcp://example:3334", "user": "user2", "pass": "" }, { "url": "stratum+tcp://example:443", "user": "user3", "pass": "" } ] }Notable differences from the current asic-rs request:
Expected behavior
AntMinerV2020::pause() should support this older stock UI payload shape, or fall back to it when the partial JSON update
does not apply.
A possible approach:
Why this matters
Consumers of Pause::pause() expect a successful result to mean the miner is actually entering sleep mode. On this
firmware, the current call can fail or time out without changing the miner state, preventing safe workflows that need
mining stopped before installation or maintenance.