Pages:
Author

Topic: GekkoScience 2Pac/Compac BM1384 Stickminer Official Support Thread - page 23. (Read 177410 times)

newbie
Activity: 114
Merit: 0
when i woke up this morning the pi had not crashed. so adding slub_debug=FP has definitely improved things. but.... out of the three sticks i left in last night one of them was reporting OFF when i woke up.

as yet i can seem to get it restarted. ive tried using the miner options like, E enable, R reset etc etc

Hello Zac123, Glad to hear that you got it mostly wrking.

You can test to see if it is a faulty usb port or a finicky stick by swapping the order of the sticks. Powered usb hubs vary a lot in quality and you may feel excess heat from the hub itself. If it happens to be the same stick that keeps turning off, some people would say to increase the voltage by turning the pot. @200 MHz you should be under your max current draw, but that depends if you were already messing around with the pot to begin with. The counterintuitive thing would be to actually lower the voltage in case you have a slightly power hungry stick that was drawing too much current through the usb port, and caused it to lose communication to the Raspberry pi.

Restarting the pi should put it back to working order, from an off state, for a while if you didn't address anything written above. And that could be automated using your crontab schedule. *at least mine does. In conjunction, although not ideal, I have my hub plugged into a smart plug that i can control from anywhere, and set up a schedule on that. But this is mainly used in case the pi loses its wifi signal, (yet again not ideal), or the pi locks up. I set my crontab schedule to safely shut down the pi slightly before the smart plug shuts it all down and starts everything back up once a week.

thanks MG. good point about the voltage pot. currently they are all set to the 3 o'clock position. i'll tweek the ones that are going to "off" when i get home.

i'm interested in "safely shut down". i'm using the crontab to restart but i did wonder whether this was a little servere. does it initiate a proper shutdown sequence or just kill it immediately....

anyway... some more research tonight..... 
newbie
Activity: 3
Merit: 0
when i woke up this morning the pi had not crashed. so adding slub_debug=FP has definitely improved things. but.... out of the three sticks i left in last night one of them was reporting OFF when i woke up.

as yet i can seem to get it restarted. ive tried using the miner options like, E enable, R reset etc etc

Hello Zac123, Glad to hear that you got it mostly wrking.

You can test to see if it is a faulty usb port or a finicky stick by swapping the order of the sticks. Powered usb hubs vary a lot in quality and you may feel excess heat from the hub itself. If it happens to be the same stick that keeps turning off, some people would say to increase the voltage by turning the pot. @200 MHz you should be under your max current draw, but that depends if you were already messing around with the pot to begin with. The counterintuitive thing would be to actually lower the voltage in case you have a slightly power hungry stick that was drawing too much current through the usb port, and caused it to lose communication to the Raspberry pi.

Restarting the pi should put it back to working order, from an off state, for a while if you didn't address anything written above. And that could be automated using your crontab schedule. *at least mine does. In conjunction, although not ideal, I have my hub plugged into a smart plug that i can control from anywhere, and set up a schedule on that. But this is mainly used in case the pi loses its wifi signal, (yet again not ideal), or the pi locks up. I set my crontab schedule to safely shut down the pi slightly before the smart plug shuts it all down and starts everything back up once a week.
newbie
Activity: 114
Merit: 0
ok, some good news, some not.....

when i woke up this morning the pi had not crashed. so adding slub_debug=FP has definitely improved things. but.... out of the three sticks i left in last night one of them was reporting OFF when i woke up.

as yet i can seem to get it restarted. ive tried using the miner options like, E enable, R reset etc etc

there are no HW errors at all.

anyone else had this?

edit.... i should add i'm keeping them very cool with fans pointing directly on them.
newbie
Activity: 114
Merit: 0
Did you do the slub thing?

Quote
Try to add slub_debug=FP to /boot/cmdline.txt and reboot

That fixed some serious lockup issues I was having with the Pis on the Terminus testing table.

ahh ok, no i havent tried this. having troubling editing that file and the permissions wont let me change them. one sec


did it via terminal. rebooting now...
legendary
Activity: 3374
Merit: 1859
Curmudgeonly hardware guy
Did you do the slub thing?

Quote
Try to add slub_debug=FP to /boot/cmdline.txt and reboot

That fixed some serious lockup issues I was having with the Pis on the Terminus testing table.
newbie
Activity: 114
Merit: 0
ok, calling any raspberry pi users!

i have the pi running cgminer, my sticks are at 200freq with no HW errors.

i found out very quickly that the pi crashes after not very long mining so i worked out a way (as above) to restart the miner to try and keep it fresh. like so:

so on the crontab i have:
Code:
pi@raspberrypi:~ $ crontab -l
*/59 * * * * sudo reboot

on the reboot i have in the autostart file:
Code:
@lxterminal -e /home/pi/git/vthoang/cgminer/runMiner.sh

and the script that is called looks like this:
Code:
#!/bin/bash

sudo /home/pi/git/vthoang/cgminer/cgminer -o stratum+tcp://eu.stratum.slushpool.com:3333 -u zbw123.worker1 -p x --gekko-2pac-freq 200

this all works bloomin lovely, i can sit and watch it reboot and the sticks start mining just as they should, excellent.

however, as soon as i turn my back.... like when i go to bed for example the pi crashes and cannot be accessed at all. the sticks are no longer flashing and there is only one option and that is to do a hard reset.

it doesn't make any difference if i reboot every few hours or every few minutes or if i mine with one stick or seven.

the sticks sit in a powered usb which can supply up to 2.1amp per port.

other people are doing what i'm doing successfully so it must be possible. i just need to get it setup right.

as always any help muchly appreciated.
zac
newbie
Activity: 114
Merit: 0


slight problem with the above. it means i can open a separate terminal to do anything else. when i click to open another terminal window its runs the same script again and tries to start the miner. hmm

your way is better

@lxterminal -e /path/to/script.sh

:-)
newbie
Activity: 114
Merit: 0

hey MG thanks for the reply. was just about to type out my progress so far an then you posted this message.

i have just got it to work by doing the following:

show hidden files
open .bashrc
locate the very bottom and paste:

~/git/vthoang/cgminer/runMiner.sh

right click on runMiner.sh and allow anybody to run the file under permissions.

and hey presto it works.

ref: http://blog.startingelectronics.com/auto-start-a-desktop-application-on-the-rapberry-pi/

I will also try pasting the cmd after @lxterminal to confirm that as well.

now all i need to do is to have the rasp pi automatically reboot every so often and we're away!


slight problem with the above. it means i can open a separate terminal to do anything else. when i click to open another terminal window its runs the same script again and tries to start the miner. hmm
newbie
Activity: 114
Merit: 0


Hello zac123, I think you are pretty close. You need to specify the path to the runMiner.sh after the @lxterminal command; on the same line.



hey MG thanks for the reply. was just about to type out my progress so far an then you posted this message.

i have just got it to work by doing the following:

show hidden files
open .bashrc
locate the very bottom and paste:

~/git/vthoang/cgminer/runMiner.sh

right click on runMiner.sh and allow anybody to run the file under permissions.

and hey presto it works.

ref: http://blog.startingelectronics.com/auto-start-a-desktop-application-on-the-rapberry-pi/

I will also try pasting the cmd after @lxterminal to confirm that as well.

now all i need to do is to have the rasp pi automatically reboot every so often and we're away!
newbie
Activity: 3
Merit: 0
hello again everybody,

i've now decided to move my stick onto a rasp pi.

ive setup a cron job so that whenever the pi is rebooted a script called runMiner.sh is run. in my runMiner.sh file i have this:


Code:
#!/bin/bash

sudo /home/pi/git/vthoang/cgminer/cgminer -o stratum+tcp://eu.stratum.slushpool.com:3333 -u zbw123.worker1 -p x --gekko-2pac-freq 200

 i have also done this so that the terminal starts when the pi reboots


nano ~/.config/lxsession/LXDE-pi/autostart

Added this line to the end of the file:

@lxterminal

ok so i'm sure you guys are falling off your seat with laughter but basically all that happens is the terminal opens up but the miner doesnt start.

somehow i need to get the command into the terminal.

thanks for any help
zac


Hello zac123, I think you are pretty close. You need to specify the path to the runMiner.sh after the @lxterminal command; on the same line.

newbie
Activity: 114
Merit: 0
Not sure if it's exactly what you're looking for, but if you scroll up the page just a bit there's quite a bit of discussion on cron jobs and startup scripts.

Yeah thanks I tried to follow that exactly and got myself in a bit of mess and couldn't get it to work.
legendary
Activity: 3374
Merit: 1859
Curmudgeonly hardware guy
Not sure if it's exactly what you're looking for, but if you scroll up the page just a bit there's quite a bit of discussion on cron jobs and startup scripts.
newbie
Activity: 114
Merit: 0
hello again everybody,

i've now decided to move my stick onto a rasp pi.

ive setup a cron job so that whenever the pi is rebooted a script called runMiner.sh is run. in my runMiner.sh file i have this:


Code:
#!/bin/bash

sudo /home/pi/git/vthoang/cgminer/cgminer -o stratum+tcp://eu.stratum.slushpool.com:3333 -u zbw123.worker1 -p x --gekko-2pac-freq 200

 i have also done this so that the terminal starts when the pi reboots


nano ~/.config/lxsession/LXDE-pi/autostart

Added this line to the end of the file:

@lxterminal

ok so i'm sure you guys are falling off your seat with laughter but basically all that happens is the terminal opens up but the miner doesnt start.

somehow i need to get the command into the terminal.

thanks for any help
zac
newbie
Activity: 3
Merit: 0
This is probably old news, but the latest version of cgminer that I checked out from https://github.com/vthoang/cgminer.git is a lot newer than what I checked out just a few months ago.  In particular, cgminer always starts at 100mhz then incrementally increases the clockrate to what was set on the command line, so we can figure out the max clockrate more easily.  Pretty cool!  Happy 4-20!

[2018-04-20 01:42:13.988] GSD 3: start work @ 100.00MHz
 [2018-04-20 01:42:28.416] GSD 0: setting frequency to 125.00MHz
 [2018-04-20 01:42:28.619] GSD 1: setting frequency to 125.00MHz
 [2018-04-20 01:42:28.827] GSD 2: setting frequency to 125.00MHz
 [2018-04-20 01:42:29.033] GSD 3: setting frequency to 125.00MHz
 [2018-04-20 01:42:43.616] GSD 0: setting frequency to 150.00MHz
 [2018-04-20 01:42:43.802] GSD 1: setting frequency to 150.00MHz
 [2018-04-20 01:42:44.014] GSD 2: setting frequency to 150.00MHz
 [2018-04-20 01:42:44.203] GSD 3: setting frequency to 150.00MHz
 [2018-04-20 01:42:58.638] GSD 0: setting frequency to 175.00MHz
 [2018-04-20 01:42:58.829] GSD 1: setting frequency to 175.00MHz
 [2018-04-20 01:42:59.038] GSD 2: setting frequency to 175.00MHz
 [2018-04-20 01:42:59.225] GSD 3: setting frequency to 175.00MHz
 [2018-04-20 01:43:04.273] Pool 0 difficulty changed to 1638
 [2018-04-20 01:43:04.274] Stratum from pool 0 requested work restart
 [2018-04-20 01:43:13.659] GSD 0: setting frequency to 200.00MHz
 [2018-04-20 01:43:13.945] GSD 1: setting frequency to 200.00MHz
 [2018-04-20 01:43:14.092] GSD 2: setting frequency to 200.00MHz
 [2018-04-20 01:43:14.235] GSD 3: setting frequency to 200.00MHz
 [2018-04-20 01:43:28.725] GSD 0: setting frequency to 225.00MHz
 [2018-04-20 01:43:28.974] GSD 1: setting frequency to 225.00MHz
 [2018-04-20 01:43:29.121] GSD 2: setting frequency to 225.00MHz
 [2018-04-20 01:43:29.294] GSD 3: setting frequency to 225.00MHz
newbie
Activity: 8
Merit: 0
Don’t attach to the screen.
Run your main script file inside it.
Thanks vh, i think i figured out a decent crontab with an added @reboot command. So every 4 hours i start by killall screens, rerun the miner script after 5 minutes and then reboot my machine at 1am and start everything up again. Testing it today seems to be working so far, will test it the rest of the week to see how successful my method is.

Thanks for the help!
vh
hero member
Activity: 699
Merit: 666
Don’t attach to the screen.
Run your main script file inside it.
newbie
Activity: 8
Merit: 0

Yes, ^M is interpreted by screen to send a (Cr) into the terminal.

The remaining piece:

forever run cgminer with a restart every 4 hours.

second terminal
Code:
while [ true ]; do
    timeout 4h /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64
    sleep 5
done

finishing it up:

runtask.sh
Code:
#!/bin/bash
screen_name=miner1

if [[ `screen -ls | grep $screen_name | wc -l` -eq 0 ]]; then
    screen -dmS $screen_name
fi

screen -S $screen_name -X stuff ^C^C^C

screen -S $screen_name -X stuff "
while [ true ]; do
    timeout 4h /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64
    sleep 5
done
"

crontab
Code:
@reboot /home/pi/git/vthoang/cgminer/runtask.sh


on reboot:
check for existing screens, and attach to confirm
Code:
screen -ls
screen -x miner1



So my script writing abilities arent that good, but im just trying to make a simple script (i mean ELI5 simple) and here is what i got so far.

Code:
#!/bin/bash
screen -dmS miner1
screen -S miner1 -X stuff "timeout 10s /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64 ^M
done"
screen -S miner1 -r

Now here is where i am stuck. (i know i have this timeout at 10s) but once the timeout is done the screen goes back to command line and the rest of my script doesnt run. Now when i type in exit on the command line then the next part of my script starts up (which is a replica of the above script). I have tried everything to get the exit command to go into the command line after the first part of the script runs, but nothing happens.

What can i do to get my screen to exit so the rest of my script can run?

Thanks and sorry for the elementary abilities. I am having fun learning on the way, it has taken me 5 days to get where i am now!

Here is where i am stuck

Code:
#!/bin/bash
{
#
#first instance
#
screen -dmS miner1
screen -S miner1 -X stuff "timeout 10s /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64 ^M
done"
screen -S miner1 -r

i need this to insert exit into the command line and go

#
#second instance
#
screen -dmS miner1
screen -S miner1 -X stuff "timeout 30s /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64 ^M
done"
screen -S miner1 -r

i need this to insert exit into the command line and go

#
#third instance
#
screen -dmS miner1
screen -S miner1 -X stuff "killall screen
exit"
screen -S miner1 -r

} 2>&1 | tee script-error.log
vh
hero member
Activity: 699
Merit: 666

Yes, ^M is interpreted by screen to send a (Cr) into the terminal.

The remaining piece:

forever run cgminer with a restart every 4 hours.

second terminal
Code:
while [ true ]; do
    timeout 4h /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64
    sleep 5
done

finishing it up:

runtask.sh
Code:
#!/bin/bash
screen_name=miner1

if [[ `screen -ls | grep $screen_name | wc -l` -eq 0 ]]; then
    screen -dmS $screen_name
fi

screen -S $screen_name -X stuff ^C^C^C

screen -S $screen_name -X stuff "
while [ true ]; do
    timeout 4h /home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64
    sleep 5
done
"

crontab
Code:
@reboot /home/pi/git/vthoang/cgminer/runtask.sh


on reboot:
check for existing screens, and attach to confirm
Code:
screen -ls
screen -x miner1

member
Activity: 62
Merit: 10
...
One question, what does the ^M do at the end of the cgminer configs command? I dont see that in the list of configs for cgminer.

The ^M is an artifact from Windows, not to be worried about. Windows uses Carrage-Return+Linefeed as the end of line codes in its text files. *NIX systems only use Carrage-Return. The artifact doesn't affect running the script.
newbie
Activity: 8
Merit: 0
You'll lose cgminer's interactive ui that way.
Practice a little bit of screen manipulation first, then revisit the script.

open two bash terminals

first terminal
Code:
screen -dmS miner1

second terminal
Code:
screen -x miner1

first terminal
Code:
screen -S miner1 -X stuff "/home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64 ^M"

first terminal
Code:
pkill cgminer

first terminal
Code:
screen -S mine -X stuff "/home/pi/git/vthoang/cgminer/cgminer --gekko-2pac-freq 180 -o stratum+tcp://bch.viabtc.com:3333 -u usaminer.2 -p 1 --suggest-diff 64 ^M"


Very cool, i see it working when i manually input the commands (it seems i had to install screen into raspbian stretch first). Now i will have to make it into a script. Thanks vh!

One question, what does the ^M do at the end of the cgminer configs command? I dont see that in the list of configs for cgminer.
Pages:
Jump to: