Configure Auto-start

Author Gravatar Image C. CUNNINGHAM
Now that you've tested and confirmed your miner is working, we can set it to begin mining automatically on startup. To do so, we'll need to edit a file named rc.local.

Open rc.local in the nano editor by entering the following command:
Copy Code
sudo nano /etc/rc.local
We'll need to add our custom startup commands above the last line which reads "exit 0"

The block of code shown below will start PiMiner & cgminer using two USB Block Erupters and is similar to what we used to start mining manually.

Simply replace the last line with the command you used to start cgminer earlier, but remove the leading "sudo"
Copy Code
cd /home/pi/PiMiner
python PiMiner.py &
cd ..
nohup ./cgminer-3.1.1/cgminer --config /home/pi/cgminer.conf -S /dev/ttyUSB0 -S /dev/ttyUSB1 >/dev/null 2>&1&
Paste the updated code into the nano editor above "exit 0" so that it looks like the following:
Once you've finished updating the file, do the following:

  1. press ctl+x to begin exiting the file
  2. press y to confirm changes
  3. press return to save the file
Now when the Pi boots up, it will automatically start cgminer & the PiMiner scripts.
Note: the mining startup process can take a minute or two, during which you may notice your mining devices start, go idle, and then start again.
Last updated on 2014-04-22 at 09.00.16 AM Published on 2013-06-20 at 02.45.08 PM