Advertisement
JMilone

CGWatcher ReadMe

Mar 26th, 2013
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.29 KB | None | 0 0
  1.  
  2. CGWatcher
  3. version 1.0
  4. © 2013 Justin Milone
  5. Milone99k@gmail.com
  6. http://manotechnology.blogspot.com/2013/03/cgwatcher.html
  7. Donate: 19msnBddmcaHnbTTQgFgzPDuy6PqfBgFJh
  8.  
  9.  
  10.  
  11. PURPOSE:
  12. CGWatcher is a GUI/monitor for CGMiner, the bitcoin mining program. It provides a graphical user interface, along with control and monitoring options to help ensure mining runs consistently. CGMiner is capable of detecting and recovering from many problems that can interrupt mining, but there are cases where it is not and having a small utility to keep an eye on it and give it a push when necessary has allowed me to setup 24/7 mining computers without having to constantly monitor them.
  13.  
  14.  
  15. HOW IT WORKS:
  16. CGMiner has an API allowing other applications to communicate with it for purposes like this. Specifically, it uses RPC to allow communication between the two applications. CGWatcher sends a command to CGMiner, and CGMiner returns a reply message. These commands can be simple requests for information (such as asking what the current hash rate is or what devices it is using) along with commands that tell CGMiner to do something (change pools, disable a device, or restart, etc.) This allows a GUI to be written with a more user-friendly interface without affecting CGMiner's performance and hash rate. CGMiner gets to stay lightweight and fast as possible, and the more resource-intensive GUI program only sends requests when necessary. This communication is not enough to have a noticable effect on CGMiner's performance.
  17.  
  18.  
  19. USING CGWATCHER:
  20. To keep the interface as small as possible, features are separated into tabs. Upon starting for the first time, you should go to the Settings tab and specify the path to CGMiner's executable (cgminer.exe), CGMiner arguments, and the IP Address:Port for CGMiner's RPC server. Below is a list of the tabs and information on the features each tab contains:
  21.  
  22.  
  23. STATS
  24. The Stats tab provides general information such as hash rate (current and average), accepted and rejected shares, etc. Moving the mouse over a text box will provide you with more information about the data being shown in it. This tab also features a line graph showing the current hash rate for the last eight times information was polled from CGMiner.
  25.  
  26. At any time, you can refresh the information in CGWatcher by clicking the Refresh button. If monitoring is enabled, this will be done automatically at the interval you specify. However, if you wish to update it instantly without changing the interval, you can use this button any time.
  27.  
  28. The Stats tab also includes a large Pause/Un-Pause button. If CGMiner is currently mining, the button will be labeled "Pause Mining". Clicking it will shutdown CGMiner. Once CGMiner is not mining, the button turns into a "Start Mining" button. Clicking it will launch CGMiner and begin mining. The idea behind this button is to have a very easy way to "pause" mining if you wish to do something on the computer (like watch a video, for example) where you will need more performance from your GPU than you can get while mining, since mining usually maxes out your GPU. Depending on the intensity setting for your GPU, you may not need to pause CGMiner to do something like watch a video, but the option is there nonetheless.
  29.  
  30. On the bottom of the window underneath all of the tabs, you will see a status display on the left (which only appears when CGWatcher is doing something.)
  31. On the right is a CGMiner status display that says whether CGMiner is running or not. Monitoring has to be turned on for this to work, as it will not get updated if monitoring is turned off. Even if you open or close CGMiner outside of CGWatcher, it will still detect that CGMiner is running and update the display accordingly.
  32.  
  33.  
  34. MONITOR
  35. The Monitor tab provides options for monitoring CGMiner and watching for problems and correcting them.
  36.  
  37. "Enable monitoring, polling CGMiner every xx seconds" - This turns on the monitoring feature which will request mining information from CGMiner at the interval you specified. This option has to be turned on in order to enable the other monitoring and recovery options below, because with it disabled it will not continuously check CGMiner's status. The default value of 10 seconds means every 10 seconds CGWatcher will request data from CGMiner and update its display. When this option is turned on, you will see "[Monitoring]" added to the text in the CGWatcher title bar.
  38.  
  39. "Auto restart sick or dead GPUs" - On several occasions I have seen CGMiner detect sick or dead GPUs, but unable to restart them and continue mining. If you have the above option ("Enable monitoring...") enabled and set to 10 seconds, CGWatcher will also check for sick or dead GPUs when it requests status data from CGMiner. If it detects a sick or dead GPU, it sends a command to CGMiner telling it to restart that GPU (Restart in terms of CGMiner. Restarting a GPU will not affect other programs.)
  40.  
  41. "Restart if total (5s) hashrate falls below xx Mh/s" - On occasion I have seen the hashrate fall to virtually nothing for some unknown reasons. To correct this, you can enable this option and set it to a low value such as 10% of your current hashrate. For example, if your current hashrate is 500Mh/s, you may want to set this at 50 (or below). A number this low will avoid restarting due to fluctuations in mining hashrates that can occur. In this example with this option enabled, every time CGWatcher refreshes mining information it will check to see if the current hashrate is below 50Mh/s, as this may indicate there is a problem. If the hashrate is below 50, it sends a "restart" command to CGMiner telling it to restart mining. This restart happens quickly (5-10 seconds), so will not have a large affect on mining.
  42.  
  43. "Restart CGMiner every xx hours" - As a sort of last resort, you can specify a number of hours of continuous mining before CGMiner is restarted. For example, the default value of 24 means CGMiner will be restarted after it runs for 24 continuous hours of mining. If CGMiner is restarted for any other reason the timer will be reset, so it will only restart CGMiner after 24 hours of "continuous", non-stop mining. My reason for this feature was to ensure that if all of the other monitoring options failed to detect a problem, the worst that would happen is losing one day of mining (with it set to 24). Likewise, setting it to 2 would mean that if there was ever a problem that wasn't caught by one of the other checks, mining would only be down for 2 hours before CGWatcher restarted it.
  44.  
  45. Monitoring Statistics
  46. This box contains information I added quickly and plan on adding more to in future versions. At the top is mining duration, along with per minute (or per second) averages of accepted and rejected shares, stale and discarded work. This was to help me figure out which configurations were providing the best results.
  47. At the bottom is network information retrieved from CGMiner.
  48.  
  49.  
  50. DEVICES
  51. This tab shows mining device information, but currently only supports GPU devices. At the top is the number of GPUs found and a drop-down box for selecting a GPU. Once you select one, you can see information specific to that GPU (hashrate, clock, temperature, etc.) Some of these text boxes are editable, meaning you can change a value and click "Apply Changes" to change those settings even while mining. This makes it easier to test and adjust different settings without having to edit the CGMiner config file and restart CGMiner, or use CGMiner's command-driven interface.
  52. Towards the bottom is a large text box containing more information for the selected GPU. Underneath is the selected GPU's status (ACTIVE, DISABLED, etc.) and buttons to enable/disable or restart the GPU. (Note that enable/disable and restart are just in terms of mining and will not affect other programs.)
  53.  
  54.  
  55. POOLS
  56. This tab is similar to the devices tab, except that it shows pool information. You can select a pool from the drop-down list at the top to see information specific to that pool. This tab is not finished and eventually it will retrieve information from the CGMiner config file and allow you to add pools. As of this version, you can enable/disable a pool, change the pool's priority (which will adjust other pools' priorities accordingly), and switch to a specific pool (which will enable the pool (if it is disabled) and set its priority to 0).
  57.  
  58. The large text box shows more information specific to the selected pool.
  59.  
  60.  
  61. SETTINGS
  62. This tab is for CGWatcher settings. You should ensure these are set correctly the first time you use CGWatcher. Remember to click "Save Settings" to save the settings to CGWatcher's INI file. If you later change a setting without saving and want to go back to the last saved settings, click the "Cancel" button. The settings include:
  63.  
  64. CGMiner Address (IP:port) - This is the IP Address and port of CGMiner's RPC server. This is required for CGWatcher to work, because it communicates with CGMiner via RPC. The default values are 127.0.0.1:4028 and are the values you'd use if CGWatcher and CGMiner are running on the same computer. If you are running CGWatcher and CGMiner on different computers on the same network, you would need to change these values to point to the computer that CGMiner is running on.
  65.  
  66. Path to CGMiner.exe - Path the CGMiner's executable. This allows CGWatcher to launch CGMiner. The "..." button allows you to browse your computer for CGMiner's executable (called cgminer.exe).
  67.  
  68. CGMiner Arguments - These are the arguments used when launching CGMiner. There are a lot of arguments you can set here, more information on them is available at the official CGMiner thread located at https://bitcointalk.org/index.php?topic=28402.0 or in the CGMiner documentation. However, there are a few arguments you will need to include in order for CGWatcher to work. They are:
  69.  
  70. --api-listen Tells CGMiner to enable API access and listen for API requests. *This is required for CGMiner to work.
  71.  
  72. --api-network Allow API access (if enabled) to listen on/for any address. By default the API only listens for 127.0.0.1 (requests from the same computer).
  73.  
  74. --api-allow Allow API access (if enabled) only to the given list of [W:]IP[/Prefix] address[/subnets]. This overrides --api-network and you must specify 127.0.0.1 if you want to allow local access.
  75.  
  76. W: in front of the IP address gives that address privileged access to all API commands. *This is required for give CGWatcher full functionality.
  77.  
  78. --api-description Description placed in the API status header (default is the CGMiner version). This is useful for accessing multiple CGMiner instances with the same program, however CGWatcher does not currently support this (right now CGWatcher works only with one instance of CGMiner on one computer.)
  79.  
  80. --api-port Port number of CGMiner API (default is 4028).
  81.  
  82. --api-groups API one letter groups G:cmd:cmd[,P:cmd:*...]. See API-README in CGMiner documentation for usage.
  83.  
  84. You can click the Help link under this text box for this information.
  85.  
  86. The large "Open CGMiner Config File" opens cgminer.conf in Notepad. You must have specified the valid "Path to CGMiner.exe" setting in order for this to work, otherwise it will not know where the file is located.
  87.  
  88. Next are control buttons for starting, stopping, and restarting CGMiner. You must have specified the valid "Path to CGMiner.exe" setting in order for the Start button to work. Also note that the Stop button will send a "quit" command to CGMiner, which will cause the CGMiner window to close. This is the expected behavior. To start it again, click the Start button and CGMiner will be re-opened and started.
  89.  
  90. "Run when Windows starts" adds a startup entry for CGWatcher. This means it will launch automatically when Windows starts. This is useful in the case of system restarts to ensure mining resumes automatically (after a system crash, for example). However, if your computer requires you to login to Windows, you would obviously have to login first before mining could be resumed after a system crash and automatic restart.
  91.  
  92. "Run CGMiner when started" will launch CGMiner and start mining when you run CGWatcher (if CGMiner is not already running). For continuous mining after a system crash in the above example, you would also want to enable this feature.
  93.  
  94. The idea is, in case of a system crash (BSOD, "Blue screen of death"), the computer is automatically restarted. The order to resume mining would be:
  95.  
  96. Computer restarts -> [Windows login?] -> Launch CGWatcher automatically -> Launch CGMiner automatically = mining resumed
  97.  
  98.  
  99. LOG
  100. This displays the CGWatcher log for the current session (since CGWatcher was started). If you need to view older log events, open the cgwatcher.log file located in the same directory as CGWatcher.
  101.  
  102.  
  103. TESTS
  104. This tab allows you to send commands to CGMiner and see what kind of reply messages it sends back. This can be useful for requesting information that I haven't yet implemented into the program. The reply messages are comma-delimited, but checking the "Convert comma-separated results into line-separated results" will do what it says, making the results easier to read. Unchecking it reverts back to the comma-delimited message.
  105.  
  106. If you wish to send multiple commands in one click, enter the commands in the Diagnostic text box (separate them by commas). Then click Run. The reply messages for all of the commands will be displayed in the large Result message text box.
  107.  
  108.  
  109. ABOUT
  110. Displays information about CGWatcher.
  111.  
  112.  
  113.  
  114. CHANGELOG:
  115. N/A
  116.  
  117.  
  118.  
  119. THINGS TO DO:
  120. - Implement mining scheduling to set the computer to mine during certain times of the day or night.
  121. - Pool information will be pulled from and saved to CGMiner config file.
  122. - Additional CGMiner config file support.
  123. - More statistics, information, and reports.
  124. - Maybe include a web interface in the future.
  125. - FPGA and ASIC support if requested.
  126. - Setting Text Size in Windows to Medium (125%) or Large (150%) causes problems with interface (makes text labels too large).
  127. - Feature suggestions can be sent to Milone99k@gmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement