Author

Topic: API for CGMiner (Read 13346 times)

full member
Activity: 155
Merit: 100
July 22, 2013, 03:06:04 PM
#6
Deffo BT Home Hub Problems, Still cant get the bloody port open! Gutted! Sad
full member
Activity: 155
Merit: 100
July 22, 2013, 02:47:16 PM
#5
If you're trying to host that page on a web server (that isn't the computer cgminer is running on), you'll need to

1.) Enable the API in cgminer and set it to allow connections from your web server's IP address.

2.) If you're mining computer is connected to a router, forward the port cgminer's API is using (default is 4028) to your mining computer. http://portforward.com has a lot of helpful information on how to do this and a free utility to check if the port is forwarded correctly.

3.) Set your mining computer's public IP address in that monitor page's PHP. I don't use that monitor but I'd imagine the IP is either hard-coded or is displayed in a textbox.

That page on your web server is what is connecting to cgminer, so you have to make sure it can connect to your mining computer and to cgminer. If your mining computer's public IP address changes, you'll need to update the PHP with the new IP address.



I think it may be my ports, all IP's seem to be setup okay

BT Home Hubs...
sr. member
Activity: 434
Merit: 251
CGWatcher & CGRemote
July 22, 2013, 02:41:27 PM
#4
If you're trying to host that page on a web server (that isn't the computer cgminer is running on), you'll need to

1.) Enable the API in cgminer and set it to allow connections from your web server's IP address.

2.) If you're mining computer is connected to a router, forward the port cgminer's API is using (default is 4028) to your mining computer. http://portforward.com has a lot of helpful information on how to do this and a free utility to check if the port is forwarded correctly.

3.) Set your mining computer's public IP address in that monitor page's PHP. I don't use that monitor but I'd imagine the IP is either hard-coded or is displayed in a textbox.

That page on your web server is what is connecting to cgminer, so you have to make sure it can connect to your mining computer and to cgminer. If your mining computer's public IP address changes, you'll need to update the PHP with the new IP address.

full member
Activity: 155
Merit: 100
July 22, 2013, 02:27:35 PM
#3
Assuming you're trying to access the miner from the same computer and want full API privileges, the command line arguments would be:

Code:
--api-listen --api-allow W:127.0.0.1

If using a config file, add these two lines:

Code:
"api-listen" : true,
"api-allow" : "W:127.0.0.1"

You may need to add a comma at the end depending on where in your config file you place it.

If you're trying to access the miner from a different computer, give more info and I'll try to help.

Please see:   https://bitcointalksearch.org/topic/simple-cgminer-remote-monitoring-script-now-with-email-alerts-222632
sr. member
Activity: 434
Merit: 251
CGWatcher & CGRemote
July 22, 2013, 02:24:46 PM
#2
Assuming you're trying to access the miner from the same computer and want full API privileges, the command line arguments would be:

Code:
--api-listen --api-allow W:127.0.0.1

If using a config file, add these two lines:

Code:
"api-listen" : true,
"api-allow" : "W:127.0.0.1"

You may need to add a comma at the end depending on where in your config file you place it.

If you're trying to access the miner from a different computer, give more info and I'll try to help.
full member
Activity: 155
Merit: 100
July 22, 2013, 02:07:29 PM
#1
Struggling to get it to work, anyone got an example .bat file or .conf file with API enabled? Cry
Jump to: