Advertisement
JMilone

CGWatcher 1.1 ReadMe

Mar 30th, 2013
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.35 KB | None | 0 0
  1.  
  2. CGWatcher
  3. version 1.1
  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. REQUIREMENTS:
  20. The .NET Framework 2.0, 4.0 is required, along with CGMiner. CGMiner must be ran with parameters giving CGWatcher full API privilege for full functionality.
  21.  
  22.  
  23. USING CGWATCHER:
  24. 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:
  25.  
  26.  
  27. STATUS
  28.  
  29. The Status 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.
  30.  
  31. 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.
  32.  
  33. The Status 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.
  34.  
  35. 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.)
  36. 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.
  37.  
  38.  
  39. MONITOR
  40.  
  41. The Monitor tab provides options for monitoring CGMiner and watching for problems and correcting them. Changes to the settings on this tab are applied instantly and do not need to be "Saved."
  42.  
  43. "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.
  44.  
  45. "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.)
  46.  
  47. "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.
  48.  
  49. "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.
  50.  
  51.  
  52. SCHEDULE
  53.  
  54. "Start mining on selected days at this time: (if not already running)" - Specify a time to start mining on the days you select. If mining is already running, CGMiner will be restarted to correct any problems that may not have been corrected by other checks. The actual time mining is started may vary up to the monitoring interval you've set. For example, if you've set the monitoring interval to 10 seconds and the schedule start time to 5:00:00, the actual start time may be anywhere between 5:00:00 and 5:00:10.
  55.  
  56. "Stop mining after: X hour(s)" - When you use the scheduling option, you can specify a number of hours for it to stop mining after. This would allow you to, for example, run CGMiner while you sleep by setting it to start at night and stop after 8 hours. CGMiner will only be stopped if it was started by the scheduler. If you use the Start, Stop, or Restart buttons on the Settings tab, the scheduled stop will be aborted. You can, however, use the Pause Mining/Start Mining button on the Status tab to pause or un-pause scheduled mining without aborting the scheduled stop time.
  57.  
  58.  
  59.  
  60. DEVICES
  61.  
  62. 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 read-only (gray text) and some are editable (black text), 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.
  63. 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.)
  64.  
  65. Changing GPU settings to values outside of their operating ranges can cause system crashes and possibly damage components! Please make sure you know what you are doing before you change these. These settings can all be changed in the CGMiner config file as well, but neither program is responsible should you push your hardware outside of its operating range and break something.
  66.  
  67.  
  68. POOLS
  69.  
  70. 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).
  71.  
  72. The large text box shows more information specific to the selected pool.
  73.  
  74.  
  75. REPORTS
  76.  
  77. This tab will be dedicated to reporting statistics. Currently, 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.
  78. At the bottom is network information retrieved from CGMiner.
  79. More information may be added in the future.
  80.  
  81.  
  82.  
  83. SETTINGS
  84.  
  85. 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:
  86.  
  87. 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.
  88.  
  89. 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).
  90.  
  91. 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:
  92.  
  93. --api-listen Tells CGMiner to enable API access and listen for API requests. *This is required for CGMiner to work.
  94.  
  95. --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).
  96.  
  97. --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.
  98.  
  99. W: in front of the IP address gives that address privileged access to all API commands. *This is required for give CGWatcher full functionality.
  100.  
  101. --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.)
  102.  
  103. --api-port Port number of CGMiner API (default is 4028).
  104.  
  105. --api-groups API one letter groups G:cmd:cmd[,P:cmd:*...]. See API-README in CGMiner documentation for usage.
  106.  
  107. You can click the Help link under this text box for this information.
  108.  
  109. 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.
  110.  
  111. "Start", "Stop", "Restart" - 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.
  112.  
  113. "CGMiner window mode" - For those who don't like seeing CGMiner, you can select to have it ran hidden or minimized. Minimized will still show its icon in the taskbar, which you can click on to restore the CGMiner window. Hidden will cause CGMiner to not appear on the screen or in the taskbar. The only way you can tell it is working is by checking CGWatcher. You will need to use the buttons in CGWatcher to start/stop/restart CGMiner. Alternatively, you could kill the CGMiner process in Task Manager.
  114.  
  115. "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.
  116.  
  117. "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.
  118.  
  119. 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:
  120.  
  121. Computer restarts -> [Windows login?] -> Launch CGWatcher automatically -> Launch CGMiner automatically = mining resumed
  122.  
  123. "Minimize to system tray" will minimize CGWatcher to the system tray when it is minimized (remove it from the taskbar.) To re-show it, double-click on the CGWatcher icon in the system tray.
  124.  
  125.  
  126.  
  127. LOG
  128.  
  129. 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.
  130.  
  131. "Clear Log File" deletes all data from the log file.
  132.  
  133. "Open in Notepad" opens the log file in Notepad, allowing you to see all log data (even from previous CGWatcher sessions.)
  134.  
  135.  
  136. TESTS
  137.  
  138. 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.
  139.  
  140. 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.
  141.  
  142.  
  143. ABOUT
  144.  
  145. Displays information about CGWatcher.
  146.  
  147.  
  148.  
  149. CHANGELOG:
  150. - Form size increased to make room for more options
  151. - Simple scheduling option added
  152. - Minimize to system tray option added
  153. - Select CGMiner window mode (normal, minimized, hidden) option added
  154. - Editable options now marked in black text, read-only in gray text (in most cases)
  155. - Closing CGWatcher while CGMiner is running will prompt the user to confirm closing
  156.  
  157.  
  158.  
  159. THINGS TO DO:
  160. - Support for pool problems
  161. - Pool information will be pulled from and saved to CGMiner config file.
  162. - Additional CGMiner config file support.
  163. - More statistics, information, and reports.
  164. - Maybe include a web interface in the future.
  165. - FPGA and ASIC support if requested.
  166. - Setting Text Size in Windows to Medium (125%) or Large (150%) causes problems with interface (makes text labels too large).
  167. - Feature suggestions can be sent to Milone99k@gmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement