hm, no, I never worked with json, i just copy pasted your work into my system and it did work out of the box. thx btw.
i did try to find anything that would lead me to how to do that. in the end i did go back to linux cli.
echo -n "stats" | nc IP_OF_MINER_GOES_HERE 4028
and
echo -n "pools" | nc IP_OF_MINER_GOES_HERE 4028
gave me a good starting point.
copied the output to file, opened in notepad ++ and find and replace the ,
by ,\n
and you get a nice long list of all the data the bitmain API makes available.
regarding loosing money on mining. well currently one needs real cheap electricity, or being able to sell the waste heat but thas goes only if you need to convert the btc to pay the electricity in fiat
Im actively mining now for more than a decade, in a nutshell I use my solar power to run those miners and then I use the waste heat to heat my house and pool with it… Back in the old days it was a PITA, but now with Braiins, its kind of easy if you got the right hardware, but then, you only really need one unit to be PWM controllable, the rest is just on and off and you get a 5-160% scale able heater. Now what to do during summer you may ask. Well in the summer i use a heat siphon powered by the waste heat to cool my house and dump that combined heat into hot water making and the pool. Indeed, instead I could use a heat pump for all that, but then if I feed my solar power to the grid they wont pay zilch for it, and a heat-pump is an expensive thing to replace and only lasts that many operational hours and its efficiency (even with the new R32 stuff) really takes a dive to the bottom of the Mariana trench when the temp. difference is high, no matter cooling or heating.
list of data available under stats:
STATUS=S,
When=1675526691,
Code=70,
Msg=CGMiner stats,
Description=cgminer 1.0.0|BMMiner=1.0.0,
Miner=uart_trans.1.3,
CompileTime=Wed Apr 27 15:19:27 CST 2022,
Type=Antminer S19|,
STATS=0,
ID=BTM_SOC0,
Elapsed=8892913,
Calls=0,
Wait=0,
Max=0,
Min=99999999,
GHS 5s=90973.59,
GHS av=91530.48,
rate_30m=91402.71,
Mode=2,
miner_count=3,
frequency=675,
fan_num=4,
fan1=4800,
fan2=4770,
fan3=4770,
fan4=4950,
temp_num=3,
temp1=65,
temp2_1=70,
temp2=64,
temp2_2=69,
temp3=64,
temp2_3=69,
temp_pcb1=50-49-65-64,
temp_pcb2=52-48-64-63,
temp_pcb3=51-48-64-64,
temp_pcb4=0-0-0-0,
temp_chip1=55-54-70-69,
temp_chip2=57-53-69-68,
temp_chip3=56-53-69-69,
temp_chip4=0-0-0-0,
temp_pic1=40-39-55-54,
temp_pic2=42-38-54-53,
temp_pic3=41-38-54-54,
temp_pic4=0-0-0-0,
total_rateideal=90000.00,
rate_unit=GH,
total_freqavg=675,
total_acn=264,
total rate=91530.48,
temp_max=0,
no_matching_work=787,
chain_acn1=88,
chain_acn2=88,
chain_acn3=88,
chain_acn4=0,
chain_acs1= oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo,
chain_acs2= oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo,
chain_acs3= oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo oo,
chain_acs4=,
chain_hw1=198,
chain_hw2=195,
chain_hw3=394,
chain_hw4=0,
chain_rate1=29840.75,
chain_rate2=31138.17,
chain_rate3=29994.68,
chain_rate4=,
freq1=675,
freq2=675,
freq3=675,
freq4=0,
miner_version=uart_trans.1.3,
miner_id=no miner id
and under pools (of course i did take my credentials out )
STATUS=S,
When=1675531620,
Code=7,
Msg=3 Pool(s),
Description=cgminer 1.0.0|POOL=0,
URL=stratum+tcp://url,
Status=Deed,
Priority=0,
Quota=1,
Long Poll=N,
Getworks=0,
Accepted=0,
Rejected=0,
Discarded=0,
Stale=0,
Get Failures=0,
Remote Failures=0,
User=,
Last Share Time=0,
Diff=,
Diff1 Shares=0,
Proxy Type=,
Proxy=,
Difficulty Accepted=0.00,
Difficulty Rejected=0.00,
Difficulty Stale=0.00,
Last Share Difficulty=0.00,
Has Stratum=true,
Stratum Active=false,
Stratum URL=,
Has GBT=false,
Best Share=0.00,
Pool Rejected%=0.00,
Pool Stale%%=0.00|,
POOL=1,
URL=stratum+tcp://url,
Status=Deed,
Priority=1,
Quota=1,
Long Poll=N,
Getworks=0,
Accepted=0,
Rejected=0,
Discarded=0,
Stale=0,
Get Failures=0,
Remote Failures=0,
User=,
Last Share Time=0,
Diff=,
Diff1 Shares=0,
Proxy Type=,
Proxy=,
Difficulty Accepted=0.00,
Difficulty Rejected=0.00,
Difficulty Stale=0.00,
Last Share Difficulty=0.00,
Has Stratum=true,
Stratum Active=false,
Stratum URL=,
Has GBT=false,
Best Share=0.00,
Pool Rejected%=0.00,
Pool Stale%%=0.00|,
POOL=2,
URL=stratum+tcp://url,
Status=Alive,
Priority=2,
Quota=1,
Long Poll=N,
Getworks=473464,
Accepted=1108464,
Rejected=18,
Discarded=4931003,
Stale=3,
Get Failures=4,
Remote Failures=8,
User=,
Last Share Time=0:00:07,
Diff=524K,
Diff1 Shares=0,
Proxy Type=,
Proxy=,
Difficulty Accepted=188766192032.00,
Difficulty Rejected=328369762.00,
Difficulty Stale=0.00,
Last Share Difficulty=524288.00,
Has Stratum=true,
Stratum Active=true,
Stratum URL=url,
Has GBT=false,
Best Share=4637945584303.00,
Pool Rejected%=0.00,
Pool Stale%%=0.00