Bitcoin Forum
May 08, 2024, 10:26:15 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: Crypto Miners In Tray - a lightweight front-end for unattended mining  (Read 25750 times)
dwolfman
Full Member
***
Offline Offline

Activity: 224
Merit: 100



View Profile WWW
April 29, 2013, 02:08:07 AM
 #21

I like this one!  Was using BitMoose, where with some external scripting I was able to stop/start the service according to whether another program was running (could stop the miner while playing a game for example).  This makes it SO much easier to deal with that.  :-)

Wanna send coins my way? 1BY2rZduB9j8Exa4158QXPFJoJ2NWU1NGf or just scan the QR code in my avatar.  :-)
1715163975
Hero Member
*
Offline Offline

Posts: 1715163975

View Profile Personal Message (Offline)

Ignore
1715163975
Reply with quote  #2

1715163975
Report to moderator
1715163975
Hero Member
*
Offline Offline

Posts: 1715163975

View Profile Personal Message (Offline)

Ignore
1715163975
Reply with quote  #2

1715163975
Report to moderator
BitcoinCleanup.com: Learn why Bitcoin isn't bad for the environment
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715163975
Hero Member
*
Offline Offline

Posts: 1715163975

View Profile Personal Message (Offline)

Ignore
1715163975
Reply with quote  #2

1715163975
Report to moderator
1715163975
Hero Member
*
Offline Offline

Posts: 1715163975

View Profile Personal Message (Offline)

Ignore
1715163975
Reply with quote  #2

1715163975
Report to moderator
1715163975
Hero Member
*
Offline Offline

Posts: 1715163975

View Profile Personal Message (Offline)

Ignore
1715163975
Reply with quote  #2

1715163975
Report to moderator
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
April 29, 2013, 02:46:58 PM
 #22

Thanks for the pointers, WebMaka. I wrote the program in C#. .Net has a class for handling process interaction, including redirects. On the downside, it does not peek. If I were to fix it, I'd basically need to rewrite the whole Process class. The currecnt code looks something like this:

Code:
                MinerProcess = new Process();
                try
                {
                    MinerProcess.StartInfo.WorkingDirectory = WorkingDir;
                    MinerProcess.StartInfo.FileName = Path.Combine(WorkingDir, Application);
                    MinerProcess.StartInfo.Arguments = Arguments;
                    MinerProcess.StartInfo.CreateNoWindow = true;
                    MinerProcess.StartInfo.UseShellExecute = false;

                    MinerProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;

                    MinerProcess.StartInfo.RedirectStandardError = true;
                    MinerProcess.StartInfo.RedirectStandardOutput = true;
                    MinerProcess.StartInfo.RedirectStandardInput = true;

                    MinerProcess.OutputDataReceived += (origin, args) => IntermediateStandardWriter(args.Data);
                    MinerProcess.ErrorDataReceived += (origin, args) => IntermediateErrorWriter(args.Data);

                    MinerProcess.Start();

                    MinerProcess.BeginOutputReadLine();
                    MinerProcess.BeginErrorReadLine();

As you can see, C# takes care of reading from pipes and redirecting Data to a programmer-defined delegate method. No peeking is allowed. Cheesy

Your explanation actually casts light on why I needed to add "-l 1" to cgminer - the output comes within the first second, so there's something to read from the pipe. With higher values, the pipe remains empty for longer, so reading from it gets blocked.

Can't promise anything, but if I get time, I'll try to resolve the issue, following your lead.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
WebMaka
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
April 29, 2013, 11:57:43 PM
 #23

Yeah, I saw that - you're probably going to have to roll a custom pipe peek-and-read, which shouldn't be too difficult with C# given that it does provide enough abstraction to get at what you'd need to get at.

BTW, your code steered me in the right direction on how to properly send a SIGINT or SIGBREAK to a running console application, so apparently we're helping each other, hahaha... (The key turned out to be to do an AttachConsole to hook my app to the miner, disable signal handling in my app, send the signal, then unhook from it.)
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
May 14, 2013, 03:06:16 PM
 #24

A short update: I am working on version 6.00, which incorporates WebMaka's suggestion, as well as several improvements and fixes.

If you find this program useful and use it on a daily basis, please consider donating for a good cause that I am supporting: Durrell Wildlife Conservation Trust

The donation address is 1DodoExzsNPvVRXFrgkKw6E259VjfUW8Kh (or scan the QR code in my profile).

As of version 6.00, the donation request address and QR in the program will also point to the fund-raising drive wallet.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
May 22, 2013, 01:56:20 PM
Last edit: May 23, 2013, 12:35:35 PM by Nemo1024
 #25

Version 6.00 has been released:

– Complete rewrite of the Process launching code, encapsulating the .Net Process class, so as to be able to peek on the stdout/stderr output pipe from the miners, solving the problem with some miners (pooler’s cpuminer) not showing any output until they exit. (Thanks to WebMaka for a lead.)
– All speeds in the balloon tooltip are now shown in the “dot” decimal notation, culture independent
– Added Speed column to the GUI list of miners.
– Added milliseconds to the log timestamp.
– Made config file path in the status bar into a clickable link, which would open Explorer at that path.
– Added restartEvery attribute to the miner node, allowing miners to be force restarted at certain hour intervals.
– Added readSpeedFrom attribute, allowing the user where the hashing speed is parsed from: stdout or stderr.
– Possibility to specify how the miner reports its speed in the list and the tooltip – K, M or G – through the new displaySpeedIn attribute. The total in the tooltip and GUI is always in M.
– Fixed a bug in hashrate-based keepAlive threshold calculation, which resulted in frequent false positives.
– Fixed a problem with disabled auto-scroll. Windows interop EM_GETSCROLLPOS returns scaled down 16-bit values even though it has a 32-bit Point structure at its disposal, resulting in erronous behaviour when the size of the RichTextBox content height exceeds 65535 pixels. A work-around has been applied, which alliviated the problem, though the text would not stay completely still.
– Fixed an off-by-one error in average speed calculation.
– The donation hint now points to Durrell Wildlife Conservation Trust fund-raising: 1DodoExzsNPvVRXFrgkKw6E259VjfUW8Kh

EDIT: An update on compatibility:
A note about Pooler’s cpuminer for Litecoins – Bitcoin Miners in Tray can run and control it, but due to two quirks, the output from cpuminer is displayed in bursts. Cpuminer directs all of its output to stderr, which BMT handles well. However, it does not finish output of a line when a line is written to stderr, thus all lines are dumped on the pipe as cpuminer’s internal buffer is filled up. There is nothing I can do about it, as this needs to be fixed by Pooler.

CGMiner must be started with --text-only or -T parameter to disable ncurses.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
WebMaka
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
May 24, 2013, 02:55:06 PM
 #26

Quote
– Complete rewrite of the Process launching code, encapsulating the .Net Process class, so as to be able to peek on the stdout/stderr output pipe from the miners, solving the problem with some miners (pooler’s cpuminer) not showing any output until they exit. (Thanks to WebMaka for a lead.)

Yay, you got it to work in .NET! Cheesy
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
May 25, 2013, 09:45:50 AM
Last edit: May 28, 2013, 02:36:47 PM by Nemo1024
 #27

Aye, that I have, though there were a few hindrances on the way, particularly the fact that the buffer would often be dumped ending in only a partial line (again, specific to cpuminer). It was also very instructive reading the source for the .Net's Process class and figuring out how to do a partial encapsulation of it, so that all of its functionality that I use still remains available.

Looking back at version 1 here (https://bitcointalk.org/index.php?topic=147122.msg1561607), the program has come a long way over the period of only a few months...  Cheesy A big round of applause to such concepts as TDD and rapid deployment cycle. Smiley

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
May 25, 2013, 09:07:59 PM
 #28

Version 6.01 has been released:

- Fixed a bug where keepAlive with threshold would stop working if a miner’s hashing speed would drop to 0 right after a successful keepAlive check.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
June 23, 2013, 06:10:40 PM
 #29

Last month was the ultimate test for my application: managing 4 machines for 3 weeks, completely unattended. All went well (mostly) one machine had OS-related failure after 2 weeks, which BitcoinMiners in Tray would not have been able to handle anyway. The other three machines finished the 3-week period with 100% uptime and 70 to 90 KeepAlive hits each. Without the program, mining would have stopped after a few days.

Next version will see profitability grouping, allowing folk to group several configured mines, working against the same card, but targeting different coins. The coin with the best profitability from a group (as reported by http://www.coinchoose.com/) will be mined. I see this as a new requirement to keep GPU and CPU mining alive in these ASIC-riddled times.

And last, but not least, from the number of hits for this topic and comments here and on my blog, I can surmise that there are a few people finding this program useful and actively using it. However, not a single donation was forthcoming. All proceeds will go to the Durrell Wildlife Conservation Trust, and this is the best incentive for me to keep developing. If you think that you don't need to donate because someone else will, think again: if everyone thinks like that, no one will donate in the end...

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
July 08, 2013, 12:57:28 PM
Last edit: July 08, 2013, 07:02:57 PM by Nemo1024
 #30

Version 7.00 has been released:

– Implemented “miner profitability grouping”, where the program would choose one of the miners in a group, targeting the same card/hardware for the most profitable coin, using the information from CoinChoose.com. At most one miner in a group can run at any given time. A group is treated as one miner: Hitting “Start” on any miner in a group would start the most profitable miner. Hitting “Stop” on any miner in a group would stop the running miner in that group.
– GUI changes, moving all buttons to the toolbar.
– GUI change, allowing resize of the program window and of the relative proportion between miner list and output text box.
– GUI window size and splitter position between miner list and the log window are saved in the registry and restored upon next program launch.
– Fixed a bug, where custom-selected config file would not be loaded when the program is launched with Windows.
– The program’s name has been changed to “Crypto Miners in Tray” to denote that miners targeting different cryptocoins can be managed from the application. The executable’s name remains the same for backward compatibility.

If anyone would like to fetch profitability data from another provider other than CoinChoose, let me know here. A potential data provider must present it through some form of API (preferably JSON) as I am not going to scrub web pages for data.


NB! If you get a crash "Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0" when launching Crypto Miners in Tray, it means that you do not have Microsoft .NET Framework 4 installed. Download and install it from Microsoft site: http://www.microsoft.com/en-us/download/details.aspx?id=17718

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
xyzwarrior
Newbie
*
Offline Offline

Activity: 58
Merit: 0


View Profile
July 09, 2013, 09:04:57 AM
 #31

can this be used with cgminer ?
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
July 09, 2013, 09:22:17 AM
 #32

can this be used with cgminer ?

Yes. Make sure you pass it --text-only or -T argument.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
July 09, 2013, 04:22:56 PM
 #33

Version 7.10 has been released:

– Made it possible to define global variables in the configuration file. These variables can then be referenced in any node or attribute, making it easier to update multiple places at once. (on request by Maxocoin)
– Fixed a bug, where the initial state of “Run with Windows” was always checked contrary to the actual state of affairs.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
July 18, 2013, 07:34:55 PM
 #34

Pooler's CpuMiner now (as of version 2.3.2) reports the speed continuously and not in large blocks as it did before.

I have tested CudaMiner and it is fully compatible with the GUI.

Remember to specify readSpeedFrom=”stderr” attribute in the configuration file for both.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
July 23, 2013, 11:12:19 AM
 #35

Version 7.20 has been released:

– Added Execute action to watchers. External command can be launched once watcher condition either becomes positive, negative or in both cases.
– Added possibility to continuously append the output log to file. Log files are rotated with a timestamp on log window clearing. Logging to file is disable by default.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
July 25, 2013, 02:06:26 PM
Last edit: July 26, 2013, 08:57:55 AM by Nemo1024
 #36

Version 7.21 has been released:

– Fixed a bug, introduced in 7.20, where “Start with Windows” would write incorrect application executable name to registry.
– Fixed logging to file so that the text is auto-flushed, allowing to view the log file while it is being written to.
– Refactored registry accessing methods to facilitate testing.
– Keep using old/stale data from CoinChoose if the site’s API temporarily stops supplying data for a coin.
– Improved error handling in log to file code.

If you had "Run with Windows" enabled, please re-enable it after launching this version manually. A bug in 7.20 resulted in incorrect value being written to the registry, preventing the program from starting with Windows.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
August 04, 2013, 03:38:51 PM
 #37

For those interested in mining multiple coins, based on profitability, here is a minimalistic example configuration file. Just fill in your values in the variables.

Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- Enter your miner's location here (example agruments below assume cgminer) -->
  <var name="path" value="c:\miners\cgminer\" />
  <var name="executable" value="cgminer.exe" />

  <!-- Enter your tuned arguments for scrypt mining here -->
  <var name="AMDScryptArgs" value="-T -l 2 --scrypt -I 13 --thread-concurrency 8192 -w 256 --gpu-engine 1150 --gpu-memclock 1375 --gpu-fan 84" />

  <!-- Enter your tuned arguments for SHA-256 mining here -->
  <var name="AMDSha256Args" value="-T -l 2 -I 9 --gpu-engine 1150 --gpu-memclock 1375 --gpu-fan 84" />

  <!-- Enter your tuned arguments for ASIC BlockErupter SHA-256 mining here -->
  <var name="BlockErupterArgs" value="" />

  <!-- Enter you connect strings here -->
  <var name="BtcConnect" value="-o http://pool.50btc.com:3333 -u user_worker -p pass" />
  <var name="LtcConnect" value="-o stratum+tcp://stratum.give-me-ltc.com:3333 -u user.worker -p pass -o coinotron.com:3334 -u user.workerLTC -p pass" />
  <var name="FtcConnect" value="-o stratum+tcp://coinotron.com:3337 -u user.workerFTC -p pass" />
  <var name="PpcConnect" value="-o coinotron.com:8322 -u user.workerPPC -p pass" />
 
  <profitabilityGroup autoStart="true">
    <miner ref="HD7970 LTC" />
    <miner ref="HD7970 FTC" />
    <miner ref="HD7970 BTC" />
    <miner ref="HD7970 PPC" />
  </profitabilityGroup>

  <profitabilityGroup autoStart="true">
    <miner ref="BE BTC" />
    <miner ref="BE PPC" />
  </profitabilityGroup>

  <miners>
    <miner id="HD7970 LTC" autoStart="false" coin="LTC">
      <workingDir>${path}</workingDir>
      <application>${executable}</application>
      <arguments>${AmdScryptArgs} ${LtcConnect}</arguments>
    </miner>

    <miner id="HD7970 FTC" autoStart="false" coin="FTC">
      <workingDir>${path}</workingDir>
      <application>${executable}</application>
      <arguments>${AmdScryptArgs} ${FtcConnect}</arguments>
    </miner>

    <miner id="HD7970 BTC" autoStart="false" coin="BTC">
      <workingDir>${path}</workingDir>
      <application>${executable}</application>
      <arguments>${AmdSha256Args} ${BtcConnect}</arguments>
    </miner>

    <miner id="HD7970 PPC" autoStart="false" coin="PPC">
      <workingDir>${path}</workingDir>
      <application>${executable}</application>
      <arguments>${AmdSha256Args} ${PpcConnect}</arguments>
    </miner>

    <miner id="BE BTC" autoStart="false" coin="BTC">
      <workingDir>${path}</workingDir>
      <application>${executable}</application>
      <arguments>${BlockErupterArgs} ${BtcConnect}</arguments>
    </miner>

    <miner id="BE PPC" autoStart="false" coin="PPC">
      <workingDir>${path}</workingDir>
      <application>${executable}</application>
      <arguments>${BlockErupterArgs} ${PpcConnect}</arguments>
    </miner>
  </miners>
</configuration>

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
galtbit
Full Member
***
Offline Offline

Activity: 231
Merit: 100


View Profile
August 04, 2013, 09:33:03 PM
 #38

Hello Nemo:  Thanks but I do not know how to use that script.  Im a bit of noob.  Where would I begin?
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
August 05, 2013, 09:04:41 AM
 #39

It is not a script, but an example of a configuration XML for my front-end, presented in this thread. Follow the link in the OP to my blog and download the latest version from there. In the archive you fill find a file BtMinersInTray.xml.example.txt which explains all the available settings. Use that information to adapt the skeleton configuration above to your needs.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Nemo1024 (OP)
Legendary
*
Offline Offline

Activity: 1680
Merit: 1014



View Profile WWW
August 24, 2013, 08:23:10 PM
 #40

Version 7.30 has been released:

– Implement backup argument set rotation for KeepAlive function. This is handy for those miners that do not support specification of backup pools, such as cpuminer, poclbm and cudaminer.
– Fix an issue, where log file would be rotated twice when configuration file is reloaded.
– Fix a bug, where a miner in a profitability group would not get stopped if profitability changes while the miner is in a suspended by watcher state.

“Dark times lie ahead of us and there will be a time when we must choose between what is easy and what is right.”
“We are only as strong as we are united, as weak as we are divided.”
“It is important to fight and fight again, and keep fighting, for only then can evil be kept at bay, though never quite eradicated.”
Pages: « 1 [2] 3 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!