bobdobs / claymore-ethereum-log-genereator

Generate log files from Claymores Dual Ethereum Miner. Easy-to-work-with format
MIT License
20 stars 9 forks source link

Windows PHP 7.2 - error #2

Open rmalenko opened 6 years ago

rmalenko commented 6 years ago

Thank you for the script.

I have error output under Windows 10, PHP 7.2.2

PHP Notice: Undefined index: temp in claymore-log-generator.php on line 217 PHP Notice: Undefined index: fan in claymore-log-generator.php on line 218

                        $temp_total += $gpu['temp'];
                        $fan_total  += $gpu['fan'];

It is because of Win or PHP7?

Regards

rmalenko commented 6 years ago

Hmm, it looks claymore does not provide fan and temp info...

davidpkatz commented 6 years ago

Thank you also for this script and for the great dashboard. I too get a similar error and unfortunately my PHP is not good enough to debug it:

C:\claymore-ethereum-log-genereator>c:\php\php.exe C:\claymore-ethereum-log-genereator\eth_log_gen.php PHP Notice: Undefined index: eth_shares in C:\claymore-ethereum-log-genereator\eth_log_gen.php on line 226

Line 226 is the end of this if block:

if ($arr_totals_info['eth_total_shares'] > 0) {
                            $arr_gpu_info[$k_gpu]['eth_shares_pct'] = round(100 * ($gpu['eth_shares'] / $arr_totals_info['eth_total_shares']), 2);
                            if (count($arr_gpu_info) === 1) {
                                // Fix: If there is only one card in rig
                                $arr_gpu_info[$k_gpu]['eth_shares_pct'] = 100;
                            }
davidpkatz commented 6 years ago

The below change fixes this issue @rmalenko. I will create a PR

                        $temp_total += $gpu['temp'] ?? 0;
                        $fan_total  += $gpu['fan'] ?? 0;

                        if ($arr_totals_info['eth_total_shares'] > 0) {
                            $arr_gpu_info[$k_gpu]['eth_shares_pct'] = round(100 * ($gpu['eth_shares'] ?? 0 / $arr_totals_info['eth_total_shares']), 2);
                            if (count($arr_gpu_info) === 1) {
                                // Fix: If there is only one card in rig
                                $arr_gpu_info[$k_gpu]['eth_shares_pct'] = 100;
                            }
davidpkatz commented 6 years ago

PR created: https://github.com/bobdobs/claymore-ethereum-log-genereator/pull/3 @bobdobs

rmalenko commented 6 years ago

Thank you a lot.

rmalenko commented 6 years ago

@davidpkatz Unfortunately, I have error message A non well formed numeric value encountered in claymore-log-generator.php on line 221

line 221 :$fan_total += $gpu['fan'] ?? 0;

Help us, please :)

davidpkatz commented 6 years ago

@rmalenko which version of Claymore are you running? I don't get this error using Claymore 10. Do you see the output of the GPU temp and fan % in the console while it runs?

kgara commented 6 years ago

Might be similar issue:

PHP Notice:  Undefined index: dcr_shares in /opt/mbin/eth_log_gen.php on line 143
PHP Notice:  Undefined index: eth_shares in /opt/mbin/eth_log_gen.php on line 222

Environment:

$ php -v
PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=sylvia
DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"
$ uname -a
Linux mxhome2 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Claymore version: 11.5 (eth+dcr mode)

kgara commented 6 years ago

Seems like it does not influence much. I still see those eth_shares and dct_shares in Influxdb and in logs. Yet supervisor fails to maintain the script running (had no experience with it before, if not fix it quick will switch to good old cron).

Apr 07 11:58:49 mxhome2 supervisord[3481]: 2018-04-07 11:58:49,043 INFO spawned: 'eth_log_gen' with pid 3487
Apr 07 11:58:49 mxhome2 supervisord[3481]: 2018-04-07 11:58:49,105 INFO exited: eth_log_gen (exit status 0; not expected)
Apr 07 11:58:50 mxhome2 supervisord[3481]: 2018-04-07 11:58:50,109 INFO spawned: 'eth_log_gen' with pid 3499
Apr 07 11:58:50 mxhome2 supervisord[3481]: 2018-04-07 11:58:50,172 INFO exited: eth_log_gen (exit status 0; not expected)
Apr 07 11:58:52 mxhome2 supervisord[3481]: 2018-04-07 11:58:52,176 INFO spawned: 'eth_log_gen' with pid 3503
Apr 07 11:58:52 mxhome2 supervisord[3481]: 2018-04-07 11:58:52,238 INFO exited: eth_log_gen (exit status 0; not expected)
Apr 07 11:58:55 mxhome2 supervisord[3481]: 2018-04-07 11:58:55,243 INFO spawned: 'eth_log_gen' with pid 3511
Apr 07 11:58:55 mxhome2 supervisord[3481]: 2018-04-07 11:58:55,306 INFO exited: eth_log_gen (exit status 0; not expected)
Apr 07 11:58:56 mxhome2 supervisord[3481]: 2018-04-07 11:58:56,307 INFO gave up: eth_log_gen entered FATAL state, too many start retries too quickly
kgara commented 6 years ago

Ok. Setting startsecs = 0 seems to help with restart. Link: https://github.com/Supervisor/supervisor/issues/212#issuecomment-47933372 Still interesting what is that notice all about.

kgara commented 6 years ago

This fix is included in the example config in my pull request according this issue https://github.com/bobdobs/claymore-ethereum-log-genereator/issues/4