I'm running TomatoUSB (a Linux-based firmware) on a Broadcom-based home router. Connected to the router's USB port is a 7-port D-Link hub and a number of Asicminer USB Block Erupters.

Am finding some curious behaviors using this cgminer 3.3.1 binary as so:

./cgminer -o pool:port -u username.worker -p password

A single cgminer instantiation will crunch at the advertised 333 MH/s rate if one USB device is connected. But that number drops off precipitously when additional devices are added.

Interestingly, adding the "--usb :1" flag (which restricts the process to using one hotplug device) and then firing n processes this way gives me 333*n as hoped.

(I think) I need a worker for each process (not a huge issue I suppose). However on a headless system as this is, running these separately can get unwieldy very quickly. Currently I'm running one SSH client window for each process and firing each from the command line.

Is there a convenient way to script a number of these to be fired at once, each using one hotplug device, and hopefully redirecting the numerous console outputs somewhere useful? Maybe somehow share a configuration file among many processes?

1 Answer 1


That's an interesting approach. It's probably cheaper than a Raspberry Pi.

  1. Put your startup script in a file:

    ./cgminer -o pool:port -u username.worker -p password --usb :$1

    Save to start_single.sh, then

    $ chmod u+x start_single.sh
  2. Make the final script:

    NUM_MINERS = 7
    cd "$(dirname "$0")"
    parallel -j $NUM_MINERS -- ./start_single.sh $(seq 1 $NUM_MINERS)

    Save as start_all.sh, then

    $ chmod u+x start_all.sh
  3. Run ./start_all.sh to mine.

If you want to start the script on startup, google 'TomatoUSB start program on startup'

  • Script works well and I have a number of Block Erupters connected, each feeding one process. Though I am getting a higher-than-expected error rate. For example, for every 1000 accepted blocks I'm getting only one or two rejected blocks but anywhere between 25 and 50 "HW" (hardware I suppose?) errors. According to my pool I am still producing at the advertised rate. I may try to turn up debugging in cgminer to see what's happening.
    – Ryan
    Jul 26, 2013 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.