prdatur / phpminer

PHPMiner is a web interface for cgminer on linux machines
Other
34 stars 15 forks source link

Site is stuck on modal "Setup" dialog #29

Closed rokka-n closed 10 years ago

rokka-n commented 10 years ago

I've upgraded to new version, which is brand new from app perspective (didn't overwrite, just changed symlink).

First bug that it required explicit path in phpminer-1.3.1/includes/Db.class.php, if (file_exists('/path_to_phpminer/miner/config/config.php')) { / include $SITEPATH . '/config/config.php'; / include '//path_to_phpminer/miner/config/config.php'; }

After fixing this cron job stopped complaining and run quietly. But the web-page is stuck with model "Setup" dialog, which is irritating. Keeps showing "Could not connect to PHPMiner RPC, please check IP and port settings for PHPMiner RPC".

Was it indented to have it this way, when no options available till it "configures" miner?

prdatur commented 10 years ago

Yes this is currently the way. when no rig's are configured it will ask you for the first one directly. The config file check i have fixed. Please check if my fix works for you.

rokka-n commented 10 years ago

Config is ok now, thanks.

In which part of the code is it trying to connect? Remote port 11111 is open and still it can't connect.

Also, can you add an option that cancels this dialog?

prdatur commented 10 years ago

When you don't have a rig there, it makes no sense to use it in any case. Did you started rpc client?

rokka-n commented 10 years ago

Yes, rpc is up (port is listening). Front-end should be working independently from connectivity to clients. Modal dialog at the beginning is quite irritating.

Christian said the following, on 09-03-14, 10:28 AM:

When you don't have a rig there, it makes no sense to use it in any case. Did you started rpc client?

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37128101.

prdatur commented 10 years ago

Which message comes? "Connection refused" ? if so, please start mining. RPC client currently checks the connection to the cgminer api when adding rigs

rokka-n commented 10 years ago

"Could not connect to PHPMiner RPC, please check IP and port settings for PHPMiner RPC" There are some tcp packages from interface to miner on rpc port, so connectivity is there. And miner is mining, yes :)

Christian said the following, on 09-03-14, 10:57 AM:

Which message comes? "Connection refused" ? if so, please start mining. RPC client currently checks the connection to the cgminer api when adding rigs

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37128701.

prdatur commented 10 years ago

Can you go to the miner and type as the user on which rpc client is running: sudo /etc/init.d/phpminer_rpcclient stop; php -f /path/to/rpcclient/index.php

then it should print out that it listens now. Then, try connect again and check if there are some test_connection lines and so.

Maybe you can also just test a different port.

rokka-n commented 10 years ago

Here it is:

miner@miner:~$ php -f /home/miner/phpminer_rpcclient/index.php 09.03.2014 15:21:20: Starting RPC Server at 10.8.0.130 on port 11111

09.03.2014 15:21:33: Incoming data request: test_connection 09.03.2014 15:21:36: Incoming data request: test_connection

Christian said the following, on 09-03-14, 11:17 AM:

Can you go to the miner and type as the user on which rpc client is running: sudo /etc/init.d/phpminer_rpcclient stop; php -f /path/to/rpcclient/index.php

then it should print out that it listens now. Then, try connect again and check if there are some test_connection lines and so.

Maybe you can also just test a different port.

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37129201.

prdatur commented 10 years ago

That's correct, so this is working. Can we do a teamviewer session so i can look at it?

rokka-n commented 10 years ago

Sorry, I can't use teamviewer for security reasons.

prdatur commented 10 years ago

problem is i can't really debug the process from outside.

rokka-n commented 10 years ago

Can you add debug code into function that creates connection?

Christian said the following, on 09-03-14, 1:01 PM:

problem is i can't really debug the process from outside.

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37131819.

prdatur commented 10 years ago

i will not commit debug code's maybe this is not the place where the error occures and i have to check every position and put debug code, this will be much time intensive.

rokka-n commented 10 years ago

I see, but debug code can be useful for future problems.

Christian said the following, on 09-03-14, 1:05 PM:

i will not commit debug code's maybe this is not the place where the error occures and i have to check every position and put debug code, this will be much time intensive.

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37131911.

rokka-n commented 10 years ago

On the client side, print_r($advanced_api) in test_connection function.

php -f /home/miner/phpminer_rpcclient/index.php 10.03.2014 01:15:03: Starting RPC Server at 0.0.0.0 on port 8055 10.03.2014 01:15:06: Incoming data request: test_connection CGMinerAPI Object ( [remote_ip:CGMinerAPI:private] => 127.0.0.1 [remote_port:CGMinerAPI:private] => 4028 [socket:CGMinerAPI:private] => [has_advanced_api:CGMinerAPI:private] => [timeout:CGMinerAPI:private] => 10 ) PHP Notice: Uninitialized string offset: 0 in /home/miner/phpminer_rpcclient/includes/CGMinerAPI.class.php on line 103 PHP Fatal error: Cannot use string offset as an array in /home/miner/phpminer_rpcclient/includes/CGMinerAPI.class.php on line 10

Christian said the following, on 09-03-14, 1:05 PM:

i will not commit debug code's maybe this is not the place where the error occures and i have to check every position and put debug code, this will be much time intensive.

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37131911.

prdatur commented 10 years ago

Which version of phpminer do you use?

rokka-n commented 10 years ago

Latest

prdatur commented 10 years ago

Which is latest? Latest from git or latest archive?

rokka-n commented 10 years ago

‎Not from git checkout directly for sure, from zip archive.‎It should be mentioned in log from console I posted. From: ChristianSent: Monday, March 10, 2014 12:37 PMTo: prdatur/phpminerReply To: prdatur/phpminerCc: Roman NaumenkoSubject: Re: [phpminer] Site is stuck on modal "Setup" dialog (#29)Which is latest? Latest from git or latest archive?

—Reply to this email directly or view it on GitHub.

prdatur commented 10 years ago

Ok the problem I have i have different line numbers as you posted the error. did you recopied all files from rpc client to the rig?

rokka-n commented 10 years ago

I double checked version, maybe that was older.

Here is the new error:

"phpminer_rpcclient/includes/CGMinerAPI.class.php" 949L, 24321C written miner@miner15:~$ php -f /home/miner/phpminer_rpcclient/index.php 14.03.2014 02:45:10: Starting RPC Server at 10.8.0.130 on port 8085 14.03.2014 02:45:14: Incoming data request: test_connection PHP Notice: Uninitialized string offset: 0 in /home/miner/phpminer_rpcclient/includes/CGMinerAPI.class.php on line 100 PHP Fatal error: Cannot use string offset as an array in /home/miner/phpminer_rpcclient/includes/CGMinerAPI.class.php on line 100

Christian said the following, on 10-03-14, 12:54 PM:

Ok the problem I have i have different line numbers as you posted the error. did you recopied all files from rpc client to the rig?

— Reply to this email directly or view it on GitHub https://github.com/prdatur/phpminer/issues/29#issuecomment-37205419.