getminera / minera

Minera is a web interface to monitor and manage mining devices
http://getminera.com
Other
374 stars 156 forks source link

Dashboard loading indefinitely (cpuminer-multi) #219

Closed cltsang closed 6 years ago

cltsang commented 6 years ago

Greetings.

I'm trying to setup mining on raspberry 3 without extra hardware. I've compiled cpuminer-multi locally, and put the binary in /var/www/minera/minera-bin/custom. The custom miner could start without problem.

With the parameter --api-bind=127.0.0.1:4028, Minera could see the miner is running, but the dashboard just keeps loading forever. Even the system temperature shows only the busy indicator. Real time log shows nothing too.

I'm wondering if it's api compatibility problem between Minera and cpuminer-multi? Thanks

michelem09 commented 6 years ago

Is it the latest Minera image with PHP7.0?

cltsang commented 6 years ago

Yes it is the latest image i.e. minera-0.9.0.img. When I run the miner directly from ssh with the same parameters, at least there are some output showing hash rate, ~500kH/s per CPU

michelem09 commented 6 years ago

That's weird could you try to add also --api-remote and please tell me the exact command used to run it.

cltsang commented 6 years ago

Thanks for the quick response. I don't have a raspberry pi with me now though. Will try tomorrow

cltsang commented 6 years ago

The exact command was ./cpuminer-multi -o stratum+tcp://sg.stratum.slushpool.com:3333 -u cltsang.worker1 -p x -a sha256d --api-bind 127.0.0.1:4028 It's the same after adding --api-remote; everything on the dashboard just stays busy.

cltsang commented 6 years ago

from http://pi.ip/minera/index.php/app/stats `

A PHP Error was encountered

Severity: Warning

Message: Creating default object from empty value

Filename: models/util_model.php

Line Number: 149

{"error":true,"msg":"There are no stats to be displayed.","network_miners":[],"minera_id":"mnhndjkndymz","miner":"cpuminer-multi","algo":"SHA-256","sysload":[3.45,2.09,2.32],"cron":null,"sysuptime":"2663","temp":{"value":"62.84","scale":"c"},"btc_rates":{"high_eur":7535.23,"last_eur":6365.17,"high":"9345.94000000","last":"7894.72","timestamp":"1521083469","bid_eur":6363.26,"vwap_eur":6828.11,"bid":"7892.35","vwap":"8468.91","volume":"23062.88337352","low_eur":6251.17,"ask_eur":6376.04,"low":"7753.32000000","ask":"7908.20","eur_usd":1.2403},"altcoins_rates":{"error":"true"},"avg":{"1min":[{"timestamp":1521014761,"pool_hashrate":0,"hashrate":0,"avg_freq":0,"accepted":0,"errors":0,"rejected":0,"shares":0,"last_share":1521014701},{"timestamp":1521014702,"pool_hashrate":0,"hashrate":0,"avg_freq":0,"accepted":0,"errors":0,"rejected":0,"shares":0,"last_share":1521014651}],"5min":[false,{"timestamp":1521014761,"seconds":300,"pool_hashrate":0,"hashrate":0,"frequency":0,"accepted":0,"errors":0,"rejected":0,"shares":0}],"1hour":[false,{"timestamp":1521014705,"seconds":3600,"pool_hashrate":0,"hashrate":0,"frequency":0,"accepted":0,"errors":0,"rejected":0,"shares":0}],"1day":[]},"profits":[{"symbol":"btc","coin":"bitcoin","algo":"sha256","reward":12.5,"difficulty":3290605988755,"blocks":513576,"networkhashps":"22358037484975550000","btcValue":1,"price":1,"coin_profitability":7.6416652739795e-11,"btc_profitability":7.6416652739795e-11,"timestamp":1521083467,"hashrate":1000000},{"symbol":"bch","coin":"bitcoin cash","algo":"sha256","reward":12.5,"difficulty":39496342.067405,"blocks":558612,"networkhashps":1.2739656869715e+14,"btcValue":0.11207999,"price":0.11207999,"coin_profitability":6.3665919926721e-6,"btc_profitability":7.1356756687277e-7,"timestamp":1521083467,"hashrate":1000000},{"symbol":"ltc","coin":"litecoin","algo":"scrypt","reward":25,"difficulty":5671972.4863423,"blocks":1385396,"networkhashps":1.7193183360616e+14,"btcValue":0.01966073,"price":0.01966073,"coin_profitability":8.8666542636329e-5,"btc_profitability":1.7432489548064e-6,"timestamp":1521083467,"hashrate":1000000}],"livestat":true,"timestamp":1521083491}`

michelem09 commented 6 years ago

Thanks for feedback, so I just fixed the bug that shows the PHP warning, you can update the code with:

cd /var/www/minera
sudo git fetch --all && sudo git reset --hard origin/master

But unfortunately it seems that cpuminer-multi has a different kind of API output that Minera can't read correctly and I'm currently abroad without the ability to put my hands on it.

I will keep this open so I could look at it as soon as I will come back home, but I don't think it will be before 1 month or so.

cltsang commented 6 years ago

Thank you. It maybe a bit off-topic, but I'm only trying out cpuminer-multi just because the default miners could not seem to start without a dedicated ASIC. I've tried the upstream cpuminer too, but it seems the api is also incompatible. If I'm willing to try writing a custom model for a software miner that is the closest to working on raspberry pi with minera, do you have any advice on which software miner I should target?

michelem09 commented 6 years ago

You are right, no one of the actual built-in miners are working with CPU, they are for ASIC only. The https://github.com/tpruvot/cpuminer-multi could be a good starting point if you need it.