Bitcoin Forum
May 09, 2024, 08:23:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Avalon 841 OpenWrt CGMiner multi-pool setup and usage  (Read 149 times)
DordOfLarkness (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
March 10, 2019, 10:00:59 PM
 #1

I'm a newbie setting up my first miner, an Avalon 841.  I'm using the OpenWrt firmware via a raspberry Pi and am trying to set up my pools

I have two pools set up.  The way OpenWrt is working, Pool 1 is always active.  Pool 2 is never active.  The web-based setup doesn't seem to have an option to activate pool 2.  I can change pool 1 to pool 2, but of course that loses all the earlier data from the CGminer Status page.  Maybe there's no other way of doing it?

I've looked at the direct commands for CGMiner, but I didn't seem to see one that would activate a pool... and I'm not even sure I can run direct commands via the shell while the unit is being controlled by the OpenWrt application.  I tried and it seemed to run another instance of CGMiner... or something... couldn't tell if it was working.  I can get around some in a Linux shell, but I'm no master by any stretch of the imagination.

On that note, as I was looking for automatic ways to go between pools, I found the "quota" settings at the official CGminer README at in http://ck.kolivas.org/apps/cgminer/README that showed promise. (90% pool.ckpool.org 10% solo.ckpool.org)  That said, the config file at etc/config/cgminer on my Pi doesn't look like the same type of config commands...  and they seem to be generated by the OpenWrt application.  

Can I still use typical CGMiner commands in the config file there?

Thanks so much.
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715286237
Hero Member
*
Offline Offline

Posts: 1715286237

View Profile Personal Message (Offline)

Ignore
1715286237
Reply with quote  #2

1715286237
Report to moderator
Artemis3
Legendary
*
Offline Offline

Activity: 2030
Merit: 1563


CLEAN non GPL infringing code made in Rust lang


View Profile WWW
March 11, 2019, 12:14:13 AM
Last edit: March 11, 2019, 02:43:47 AM by Artemis3
Merited by frodocooper (2)
 #2

Look at cgminer.conf and the pools should be defined in there. You could arrange switching pools by simple copying of the files at scheduled times (crontab).

Ie: have cgminer.pool1.conf and cgminer.pool2.conf and copy them into cgminer.conf with a script launched from crontab at the intended time.

A script like this should do, but instead of changing frequencies, what you want to change is the pool. Also adjust your crontab accordingly.

██████
███████
███████
████████
BRAIINS OS+|AUTOTUNING
MINING FIRMWARE
|
Increase hashrate on your Bitcoin ASICs,
improve efficiency as much as 25%, and
get 0% pool fees on Braiins Pool
Steamtyme
Legendary
*
Offline Offline

Activity: 1540
Merit: 2036


Betnomi.com Sportsbook, Casino and Poker


View Profile WWW
March 11, 2019, 01:52:13 AM
 #3

Not going to lie most of what your saying is over my head, so maybe I'm missing the end goal here.

The idea behind the other pools is for them to work like a backup in case you lose connection with your preferred pool. This way you continue mining happily. If your concern is losing all previous data, can't you just copy the logs prior to making the changes to switch between pools? On that note, you seem fairly proficient could you not find a way to automatically pull and save the logged data, then you don't have to worry.


░░░░░▄▄██████▄▄
░░▄████▀▀▀▀▀▀████▄
███▀░░░░░░░░░░▀█▀█
███░░░▄██████▄▄░░░██
░░░░░█████████░░░░██▌
░░░░█████████████████
░░░░█████████████████
░░░░░████████████████
███▄░░▀██████▀░░░███
█▀█▄▄░░░░░░░░░░▄███
░░▀████▄▄▄▄▄▄████▀
░░░░░▀▀██████▀▀
Ripmixer
░░░░░▄▄██████▄▄
░░▄████▀▀▀▀▀▀████▄
███▀░░░░░░░░░░▀█▀█
███░░░▄██████▄▄░░░██
░░░░░█████████░░░░██▌
░░░░█████████████████
░░░░█████████████████
░░░░░████████████████
███▄░░▀██████▀░░░███
█▀█▄▄░░░░░░░░░░▄███
░░▀████▄▄▄▄▄▄████▀
░░░░░▀▀██████▀▀
Artemis3
Legendary
*
Offline Offline

Activity: 2030
Merit: 1563


CLEAN non GPL infringing code made in Rust lang


View Profile WWW
March 11, 2019, 01:59:55 AM
 #4

Not going to lie most of what your saying is over my head, so maybe I'm missing the end goal here.

The idea behind the other pools is for them to work like a backup in case you lose connection with your preferred pool. This way you continue mining happily. If your concern is losing all previous data, can't you just copy the logs prior to making the changes to switch between pools? On that note, you seem fairly proficient could you not find a way to automatically pull and save the logged data, then you don't have to worry.

Its because of this philipma1957 comment, he wants to change the pool on schedule. But ckpool doesn't provide this, only backup pools. Hence my suggestion.

██████
███████
███████
████████
BRAIINS OS+|AUTOTUNING
MINING FIRMWARE
|
Increase hashrate on your Bitcoin ASICs,
improve efficiency as much as 25%, and
get 0% pool fees on Braiins Pool
Steamtyme
Legendary
*
Offline Offline

Activity: 1540
Merit: 2036


Betnomi.com Sportsbook, Casino and Poker


View Profile WWW
March 11, 2019, 02:08:43 AM
 #5

Okay having read that it makes more sense what the question is. I guess for me I would just make switch over day a Wednesday and do it when I got to the office, repeat on Thursday. That's again because all the command stuff goes right over my head for the most part.

OP how often are you hoping to receive some mining rewards, small or otherwise?


░░░░░▄▄██████▄▄
░░▄████▀▀▀▀▀▀████▄
███▀░░░░░░░░░░▀█▀█
███░░░▄██████▄▄░░░██
░░░░░█████████░░░░██▌
░░░░█████████████████
░░░░█████████████████
░░░░░████████████████
███▄░░▀██████▀░░░███
█▀█▄▄░░░░░░░░░░▄███
░░▀████▄▄▄▄▄▄████▀
░░░░░▀▀██████▀▀
Ripmixer
░░░░░▄▄██████▄▄
░░▄████▀▀▀▀▀▀████▄
███▀░░░░░░░░░░▀█▀█
███░░░▄██████▄▄░░░██
░░░░░█████████░░░░██▌
░░░░█████████████████
░░░░█████████████████
░░░░░████████████████
███▄░░▀██████▀░░░███
█▀█▄▄░░░░░░░░░░▄███
░░▀████▄▄▄▄▄▄████▀
░░░░░▀▀██████▀▀
Artemis3
Legendary
*
Offline Offline

Activity: 2030
Merit: 1563


CLEAN non GPL infringing code made in Rust lang


View Profile WWW
March 11, 2019, 02:47:37 AM
Last edit: March 15, 2019, 02:24:23 PM by Artemis3
Merited by frodocooper (3), Steamtyme (1)
 #6

Okay having read that it makes more sense what the question is. I guess for me I would just make switch over day a Wednesday and do it when I got to the office, repeat on Thursday. That's again because all the command stuff goes right over my head for the most part.

OP how often are you hoping to receive some mining rewards, small or otherwise?

The whole point of using command stuff is precisely to not do it by yourself all the time. That's precisely what sysadmins do: automate, automate, automate. The computers are meant to do the job for you, not the other way around...

As for his intention, he wants to mine normally every 6 days, and play lottery on the 7th. Given the chances of actually finding a block by yourself with such a low hash-rate i wouldn't personally bother, but to each their own...

Crontab is the text file most *nix like OSes use for scheduling tasks. Its rather mundane and standard. Thankfully Asic miner units tend to use Linux, such as OpenWrt in their controllers, so doing these automated tasks from within the miner itself becomes trivial.

A crontab file looks like this:

Code:
#--------------------------------------------------
# example unix/linux crontab file format:
#--------------------------------------------------
# min,hour,dayOfMonth,month,dayOfWeek command
#
# field          allowed values
# -----          --------------
# minute         0-59
# hour           0-23
# day of month   1-31
# month          1-12 (or names, see below)
# day of week    0-7 (0 or 7 is Sun, or use names)
#
#--------------------------------------------------

# run the drupal cron process every hour of every day
0 * * * * /usr/bin/wget -O - -q -t 1 http://localhost/cron.php

# run this apache kludge every minute of every day
* * * * * /var/www/devdaily.com/bin/check-apache.sh

# generate links to new blog posts twice a day
5 10,22 * * * /var/www/devdaily.com/bin/mk-new-links.php

# run the backup scripts at 4:30am
30 4 * * * /var/www/devdaily.com/bin/create-all-backups.sh

# re-generate the blog "categories" list (four times a day)
5 0,4,10,16 * * * /var/www/devdaily.com/bin/create-cat-list.sh

# reset the contact form just after midnight
5 0 * * * /var/www/devdaily.com/bin/resetContactForm.sh

# rotate the ad banners every five minutes

0,20,40  * * * * /var/www/bin/ads/freshMint.sh
5,25,45  * * * * /var/www/bin/ads/greenTaffy.sh
10,30,50 * * * * /var/www/bin/ads/raspberry.sh
15,35,55 * * * * /var/www/bin/ads/robinsEgg.sh

If you go to https://crontab.guru/ you get a realtime translation of the meaning of those "strange looking" lines. Its just what wikipedia says:

Code:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                   7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command to execute

Then there is the command you actually want to execute, in this case copy a file into another:

cp /root/cgminer.pool1.conf /etc/cgminer.conf and cp /root/cgminer.pool2.conf /etc/cgminer.conf

Similar to papampi's post.

End result should be something like:

Code:
0 0 * * 3 cp /root/cgminer.pool1.conf /etc/cgminer.conf && /etc/init.d/cgminer reload
0 0 * * 4 cp /root/cgminer.pool2.conf /etc/cgminer.conf && /etc/init.d/cgminer reload

This will overwrite cgminer.conf with the contents of cgminer.pool1.conf on Wednesdays, and the contents of cgminer.pool2.conf on Thursdays at 0:00 (12am).

If you pay attention, The Command Line Interface is easier than a Graphic User Interface, on a magnitude of scale for most tasks. Edit a text file, vs the dreaded registry, or a simple command line vs open window, click here, scroll bar, click tab, go back, unset radio button, next tab, etc...

Of course you can combine both and use the most efficient one for each task.

██████
███████
███████
████████
BRAIINS OS+|AUTOTUNING
MINING FIRMWARE
|
Increase hashrate on your Bitcoin ASICs,
improve efficiency as much as 25%, and
get 0% pool fees on Braiins Pool
DordOfLarkness (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
March 11, 2019, 03:19:27 AM
Last edit: March 11, 2019, 11:05:19 PM by frodocooper
 #7

Sorry, I didn't put enough info in my original question...I was coming from another thread and didn't frame things clearly.

Given the chances of actually finding a block by yourself with such a low hash-rate i wouldn't personally bother, but to each their own...

You're right, the chances are so low, the solo lottery is kind of pointless.  I'm doing that part as an exercise. I enjoy tinkering with the gear.  For what I'll be making in return, the whole thing is just an exercise...in many things haha

Thanks for the info on crontab.  Very helpful indeed, and very much appreciated.

End result should be something like:

Code:
0 0 * * 3 cp /root/cgminer.pool1.conf /etc/cgminer.conf && /etc/init.d/cgminer reload
0 0 * * 4 cp /root/cgminer.pool2.conf /etc/cgminer.conf && /etc/init.d/cgminer reload

This will overwrite cgminer.conf with the contents of cgminer.pool1.conf on Wednesdays, and the contents of cgminer.pool2.conf on Thursdays at 0:00 (12am).

If you pay attention, The Command Line Interface is easier than a Graphic User Interface, on a magnitude of scale for most tasks. Edit a text file, vs the dreaded registry, or a simple command line vs open window, click here, scroll bar, click tab, go back, unset radio button, next tab, etc...

Of course you can combine both and use the most efficient one for each task.

Just to reiterate, this was exactly what I needed.  I hadn't heard of crontab before, and my initial searches confused me.  This was very clear, and I really appreciate it.  I think I'm all set.  Also, that taught me the /etc/init.d/cgminer reload trick.  I could use that command direct in the shell I think.  Could be useful.

I'm certainly a fan of the CLI/Shell approach.  I have vim pretty well under my fingers, but in general I don't have a whole lot of flight hours on a Linux/Unix terminal compared to many... so again, I appreciate the helpful info. Cool
Pages: [1]
  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!