Post
Topic
Board Mining (Altcoins)
Re: Official FutureBit Moonlander 2 Driver and Support Thread
by
Bill48105
on 21/02/2019, 19:00:53 UTC
EDIT: See next post for the updated "smart" method that bases the kill on speed vs just blindly timed
I've tested these moonlanders on multiple systems, multiple hubs, default & custom settings, original release & newer beta, and for some reason they each show 0 for speed eventually.  It's not an ideal solution but so far the cleanest I've found is on my raspberry pi running latest raspbian is to restart bfgminer every hour. I didn't see an option in bfgminer itself so I went a more brute force way which while maybe not pretty, so far seems to do the trick. (Surely there are cleaner ways to go about this but I worked with what I know how to do the fastest since I've wasted too much time on this already)

I start a screen session manually, then start bfgminer in a looping script that's in my home directory with a delay after it to have time to stop with ctrl-c it if needed:
(Be sure to set the correct path to your bfgminer, your own POOL, PORT & USERNAME etc. Set your own command line options like speed as needed)

nano run.sh
Code:
#!/bin/sh
while true
do
  cd /home/pi/moonlander2/bfgminer_5.4.2-futurebit2_linux_armv6/
  ./bfgminer --scrypt -o stratum+tcp://POOL:PORT -u USERNAME -p x -S ALL
  echo "Sleeping 5 seconds.. Press Ctrl-C to stop bfgminer restart."
  sleep 5s
done

Make it executable:
sudo chmod +x run.sh

Then I use the root crontab to tell bfgminer to shutdown every 60 minutes using pkill:

sudo crontab -e
Code:
*/60 * * * * /usr/bin/pkill -f bfgminer
NOTE: Be sure to use sudo crontab -e otherwise if you don't use sudo pkill won't have permissions to work under normal user's crontab

Once setup & running I can watch the screen session cleanly restart hourly. (Use more or less time to balance work lost restarting with how long you're willing to accept 1 or more miners hung)

No doubt this solution isn't ideal & has drawbacks (such as while pskill tells bfgminer to shutdown the same as if you hit Q, it does not help if the issue is USB or hardware related.  Plus unless set on command line, the difficulty has to be negotiated again.  It's possible to lose out on work being done but not as much work is being lost having moonlander's hung up at 0 mhs.