Bitcoin Forum
May 08, 2024, 05:43:56 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 ... 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 [92] 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 »
  Print  
Author Topic: GekkoScience 2Pac/Compac BM1384 Stickminer Official Support Thread  (Read 177091 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic. (1 post by 1+ user deleted.)
vh (OP)
Hero Member
*****
Offline Offline

Activity: 699
Merit: 666


View Profile
April 16, 2018, 09:07:49 PM
 #1821

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"

Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715147036
Hero Member
*
Offline Offline

Posts: 1715147036

View Profile Personal Message (Offline)

Ignore
1715147036
Reply with quote  #2

1715147036
Report to moderator
1715147036
Hero Member
*
Offline Offline

Posts: 1715147036

View Profile Personal Message (Offline)

Ignore
1715147036
Reply with quote  #2

1715147036
Report to moderator
1715147036
Hero Member
*
Offline Offline

Posts: 1715147036

View Profile Personal Message (Offline)

Ignore
1715147036
Reply with quote  #2

1715147036
Report to moderator
Tzxuan
Newbie
*
Offline Offline

Activity: 21
Merit: 1


View Profile
April 17, 2018, 08:45:54 AM
 #1822

I still do not understand Sad
jogger1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
April 17, 2018, 11:53:54 AM
 #1823

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.
flippintwit
Member
**
Offline Offline

Activity: 62
Merit: 10


View Profile
April 17, 2018, 12:06:44 PM
 #1824

...
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.
vh (OP)
Hero Member
*****
Offline Offline

Activity: 699
Merit: 666


View Profile
April 17, 2018, 03:16:01 PM
 #1825


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


jogger1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
April 17, 2018, 11:04:38 PM
 #1826


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 (OP)
Hero Member
*****
Offline Offline

Activity: 699
Merit: 666


View Profile
April 18, 2018, 12:47:23 AM
 #1827

Don’t attach to the screen.
Run your main script file inside it.

jogger1
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
April 18, 2018, 04:29:41 PM
Last edit: April 18, 2018, 05:21:45 PM by jogger1
 #1828

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!
dogshu
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 20, 2018, 06:00:19 AM
 #1829

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
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
April 29, 2018, 03:20:26 PM
Last edit: April 29, 2018, 03:48:00 PM by zac123
 #1830

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
sidehack
Legendary
*
Offline Offline

Activity: 3318
Merit: 1848

Curmudgeonly hardware guy


View Profile
April 29, 2018, 04:26:23 PM
 #1831

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.

Cool, quiet and up to 1TH pod miner, on sale now!
Currently in development - 200+GH USB stick; 6TH volt-adjustable S1/3/5 upgrade kit
Server PSU interface boards and cables. USB and small-scale miners. Hardware hosting, advice and odd-jobs. Supporting the home miner community since 2013 - http://www.gekkoscience.com
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
April 29, 2018, 04:36:27 PM
 #1832

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.
MGchild
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 29, 2018, 07:14:16 PM
 #1833

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.

zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
April 29, 2018, 07:26:32 PM
 #1834



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!
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
April 29, 2018, 07:41:56 PM
 #1835


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
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
April 29, 2018, 07:57:39 PM
 #1836



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

:-)
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
May 02, 2018, 07:51:54 PM
 #1837

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
sidehack
Legendary
*
Offline Offline

Activity: 3318
Merit: 1848

Curmudgeonly hardware guy


View Profile
May 02, 2018, 08:25:19 PM
 #1838

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.

Cool, quiet and up to 1TH pod miner, on sale now!
Currently in development - 200+GH USB stick; 6TH volt-adjustable S1/3/5 upgrade kit
Server PSU interface boards and cables. USB and small-scale miners. Hardware hosting, advice and odd-jobs. Supporting the home miner community since 2013 - http://www.gekkoscience.com
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
May 02, 2018, 08:38:08 PM
 #1839

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...
zac123
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile
May 03, 2018, 06:17:52 AM
 #1840

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.
Pages: « 1 ... 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 [92] 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!