Hi Kano, just got a quick question. With rpi and BE, does 3.4.0 works great on it? Or should go with an earlier version? And with the latest updates, should I go with arch or raspbian? As I saw the LCD module in adafruit with raspbian seems nice
3.4.0 works great on RPi and BE, and arch is a better choice.
Thanks, I will try to set it up. I did have a look already in Kano website. How do I add an auto start cgminer when power up the rpi and load a config?
1. Install screen and pgrep
2. Create "cgminer" user (assume /home/cgminer is home directory for new cgminer user). On debian-based systems you probably need to add cgminer to the plugdev group ("adduser cgminer plugdev").
3. Login as cgminer user (possibly via "sudo su cgminer" etc)
4. Setup /home/cgminer/.cgminer/cgminer.conf
5. Test that running cgminer with no command line options does what you expect.
5. Create /home/cgminer/daemon.sh
#!/bin/bash
log () {
logger -p local0.notice -t $1/daemon.sh "$*"
}
export HOME=$(dirname $(readlink -e $0))
cd $HOME
if ! pgrep -u cgminer cgminer >/dev/null; then
log cgminer is dead
screen -dmS cgminer $HOME/bin/cgminer
else
log cgminer lives
fi
daemon.sh checks if the "cgminer" user is running a program called "cgminer". If so, then nothing happens. Otherwise it starts a new detached screen session running cgminer. You may have to adjust $HOME/bin/cgminer to your machine. (I use ./configure --prefix=/home/cgminer and make install so my cgminer binaries end up in /home/cgminer/bin/cgminer)
6. chmod +x /home/cgminer/daemon.sh
7. Add the following line to the crontab to run /home/cgminer/daemon.sh every minute (run "crontab -e" as cgminer to edit crontab)
* * * * * /home/cgminer/daemon.sh
In the future I'd like to add use of a chroot, but I haven't had time to work on that yet.