sr. member
Activity: 434
Merit: 251
CGWatcher & CGRemote
Yes, remote access does not work correctly. I can't speak for bfgminer because I haven't used it enough to say, but I realized early on that there are enough occasions where remote access alone would not ensure that the miner ran continuously, and that is my top priority. I've spent the past week improving problem handling and added two additional checking options, among other changes. There are problems that occur often (at least with my miners) that cause cgminer to return to read-only API privilege meaning CGWatcher can no longer issue commands other than receiving stats. This, and the fact that sometimes sending cgminer the "restart" command causes it to close unexpectedly means that having CGWatcher on the same machine as cgminer (and presumably bfgminer) is necessary because being on the same machine gives CGWatcher the ability to launch and kill miner processes. This is why CGWatcher is not showing a miner running when it is done remotely... because it has become dependent on access to the miner's process. When cgminer goes to read-only access, the only way to get full access back is to kill the process and re-open it. Likewise, when cgminer closes unexpectedly after the "restart" command, the program needs to be launched again. Scheduled mining also requires CGWatcher to be on the same machine so it can launch the miner.
But there is hope! In order to remotely monitor and control miners and ensure that they run continuously, there would need to be a listener program running on each computer as a miner. This program could then talk to CGWatcher and report process info and launch or kill the miner when needed. I considered writing one, but I think that CGWatcher would be the best listener program. It has the logic built-in to keep a miner on the same computer running, so I felt it would make more sense to use it as the listener program and create a new program (tentatively titled CGRemote) that will communicate with CGWatcher(s) remotely (or locally.) I've already developed the basic program and have communication between the two working, I just have to design a protocol for sending and receiving commands and data.
If that is hard to follow...
You will run CGWatcher the same computer as cgminer. If you have multiple computers mining, you'll have CGWatcher running on each of them. That way it can do its job correctly. If you want to monitor or control your miners remotely, you'll use CGRemote. It will also be small and portable, and allow you to list as many miners as you want (IP address and port). CGRemote and all of your CGWatchers will use a common passkey that you create to make sure nobody else can send commands to your CGWatchers. The passkey is stored encrypted in each program's INI file. (All this stuff is done and working already.) CGRemote will essentially give you a dashboard of your miners, only instead of communicating with cgminer, it will communicate with CGWatcher, who in turn communicates with cgminer. For example, if you tell CGRemote that you want to start mining on one computer, it will send a command to CGWatcher on that computer telling it to launch cgminer (or bfgminer). Ultimately, anything you can do with CGWatcher you'll be able to do with CGRemote. Any data you can get from CGWatcher you'll be able to get with CGRemote. It may sound more complicated than necessary, but considering the steps CGWatcher has taken to effectively keep a miner running, it makes the most sense. To make it easier to add miners to CGRemote, you'll notice in the next CGWatcher update that there is now a Remote tab that shows you your local and public IP addresses (so you'll have all the info you need to add them to CGRemote) and will allow you to set a miner name, port, and passkey for use with CGRemote. The goal is to allow you to monitor and control local and remote miners (including headless miners.)
I'm planning on releasing the next update on Monday, April 22. It has some significant improvements with how it handles miner problems, and adds two new options to detect problems with the miner. The first is to restart the miner if CGWatcher had full API access but then lost it, which is a problem I've been dealing with on one of my miners. The second is an option to restart the miner if the total shares (accepted, rejected, etc) do not increase for X minutes, as this may indicate a problem with the pool. There is also better scrypt support (automatic detection), better error handling, a 'check for updates' button, and numerous improvements and fixes. The problems I mentioned above are now handled as well. It will all be listed in the update's ReadMe. There is no ETA for CGRemote, but it is essentially working right now.
Thanks for the positive feedback, it has motivated me to put more time into this. Over 700 downloads so far, much more than I originally expected. If you had any problems, try this next update before reporting them because it has many improvements. If you use the program and want to support its future development (and motivate its developer), consider donating to an address in the ReadMe. Thank you to whoever sent a few litecoins, it honestly made me spend the entire day working on it.