Author

Topic: I need a mining tool that can reboot my cgminer rigs. (Read 910 times)

legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Well, plink works.

On a default BAMT rig, running this command immediately reboots that rig.

Quote
plink -ssh -pw live -batch [email protected] "echo b > /proc/sysrq-trigger"

Where the ip address is your rig. Go put your own. (Obviously, change your password, or use public key SSH protocol.)

However it leaves the file waiting, so there's a work around to it, like killing its own ssh process. I have not yet tested that.


Now, it has been pointed out that a script running from a regular cron job is going to work much better.

I simply need the script to check two things:

1. Are all GPUs hashing? Are any SICK or DEAD?
2. Are the good ones hashing above 400 kh/s (or whatever number you deem the minimum)?

If not, then reboot. If okay, then nothing, just keep mining. Cron will run again after a few minutes.

Who's got something that works? python script, perl script, bash script, doesn't matter. Ideally, I don't want to install anything that isn't already on Litecoin BAMT, but if I have to then as long as it's under 2 gigs I'll do it.

Remember that BAMT is running from a USB flash drive.

I will attempt to figure this out from the cgminer / sgminer api, but hopefully someone can show me what they already have working.


I understand this looks like a band-aid solution, but here is my thinking:

1. stable system, no issues, runs all week and all month, hashes at 400 kh/s * 5 GPUs = 2 MH/s.
2. not so stable system, runs at most 2 days then has problems, but until then, hashes at 485 kh/s * 5 GPUs = 2.425 MH/s.
3. unstable, runs up to 2 or 3 hours, hashes at 510 kh/s * 5 GPUs = 2.55 MH/s.

I'll take rig number 2 or 3 over rig number 1, as long as the band-aid works. I'll only lose 1 to 2 minutes of mining every time it restarts.

My current band-aid is a timer. It unplugs the rig for 1 minute every 3 hours. That works, but I want my band-aid to be a little bit smarter, thus scripts for checking if it really needs to do that. I can then set the timer to unplug once a day for all other problems that the script is not programmed to detect.
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
I'm looking at plink now. I think it's a part of PuTTy. Just in case I answered my own question, here is the link:

the.earth.li/~sgtatham/putty/0.63/htmldoc/Chapter7.html
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
As far as I am aware, it is Debian. Litecoin BAMT is a fork of the original BAMT. It is semi-actively being updated and developed.

I use version 1.3, which includes sgminer 4.0.0. Since then, 1.4 came out, and 1.5 also, but the only major difference are the Catalyst drivers, and sgminer 4.1.

For whatever reason, version 1.5 hashes my exact same GPUs with the exact same settings, slower than version 1.3. They also seem to crash or get sick or dead at about the same rate.

A software reset works. Sometimes coldreboot works. Sometimes "mine restart" works. So far, that "echo b > /proc/sysrq-trigger" always works.

I figure a real physical hardware reset will always work. But according to everything I've read, the sysrg-trigger magic is equivalent.


What I really need is something that logs on the rig, via SSH or TELNET, either as root or sudo, and send that sysrq-trigger command. I wonder if I can program PuTTy to do that or something. I'd of course, prefer SSH, but since the rig will not accept remote logins, TELNET would do.
newbie
Activity: 52
Merit: 0
The only reason I log on as root, is that's how it works with BAMT. There are two accounts on a BAMT system, root and user. I will have to experiment with the user account. You logon as user, then use SUDO, so you're root anyway. The rig doesn't do anything but mine, it uses a flash drive instead of a hard drive, so no one can store porn or mp3s on it.
The Sudo program gives a user root privileges, it doesn't make them root. The reason I say this is because you can specify which commands to allow. But I understand what you are saying.

I haven't had time to tweak my settings, or getting the correct drivers, but this particular version gets me the best hash rates for about anywhere between 12 to 48 hours straight, but sometimes less.
That is weird, do you get any hardware errors? Have you ran cgminer -n? Is this just with cgminer, or sgminer as well? sgminer 4.1 or from the latest git version?

So I put the whole thing on a timer. Every 2 hours, it unplugs. Power off. After 1 minute, it turns on. BAMT boots, 20 seconds later it starts GPU 0, then GPU 1, then GPU 2, then GPU 3 ... then it starts mining, looking for work from my list of 10 pools. The first is the main pool, the rest are backup.
If it doesn't freeze, you don't need to do any hard reset magic with the motherboard. A simple reboot would work. With sgminer set in you init scripts

I will have to look into Xubuntu, ... after all, BAMT is just linux, cgminer/sgminer, and AMD drivers stuffed into a flash drive image, ready to write.
I've never looked into BAMT. It may be Linux, but that's pretty broad, so is Android. What is it's underlying system (Debian, CentOS, Arch, Slackware, etc.). Or is it completely custom?
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
I'm not good at programming, but someone could take my concept and run with it. I have some friends who are and I'm planning on getting the following setup.

I think a raspberry pi could be programmed to ping each rig's IP address every XX minutes. If no reply, it would close a relay connected to the motherboard power switch and cause a hard shut down.

Thoughts?

I like that idea. The rig's reply should include hash rate and GPU status, so the pi (or computer) should be smart enough to decide. I mean, IF THEN, IF THEN ELSE, etc.

I saw someone set up a reed switch to do this. He can remote reboot his rigs.

You don't need to logon as root if the script is on the system, even if it isn't you should not login as root. Your script just has to run as a privileged user. You can use a simple python script ran via cronjobs to read cgminer's JSON response and act accordingly.

Are you having issues with freezing or dead GPU's? To be honest you shouldn't have to reboot at all, I would look into the issue at hand rather than putting a bandaid on it by constantly rebooting. But than I've never used BAMT, I just modified Xubuntu and it runs for weeks without issues.

The only reason I log on as root, is that's how it works with BAMT. There are two accounts on a BAMT system, root and user. I will have to experiment with the user account. You logon as user, then use SUDO, so you're root anyway. The rig doesn't do anything but mine, it uses a flash drive instead of a hard drive, so no one can store porn or mp3s on it.

I haven't had time to tweak my settings, or getting the correct drivers, but this particular version gets me the best hash rates for about anywhere between 12 to 48 hours straight, but sometimes less.

So I put the whole thing on a timer. Every 2 hours, it unplugs. Power off. After 1 minute, it turns on. BAMT boots, 20 seconds later it starts GPU 0, then GPU 1, then GPU 2, then GPU 3 ... then it starts mining, looking for work from my list of 10 pools. The first is the main pool, the rest are backup.

It didn't cost me anything to sign up or register with all those pools, and the last 3 or 4 don't even need registration (they are those so called profit switching pools.)

So my only real problem is a true power outtage, or a disconnected internet service.

When I have the few hours or days to trouble shoot and experiment with the rig and the settings (engine speed, memory clock, intensity, etc.) then I can find out what exactly is wrong.

In the mean time, it hashes at a good speed, no hardware errors, very little rejects, for about 12 hours, to about 48 hours, then suddenly one GPU goes SICK or DEAD or hashes at half the speed.

The timer or in this case, the custom software will detect this, then reboot the system.

Then it starts mining again, at top speed.

On my timer, with no admin or remote control, it just reboots, even if has no reason to do so, except that time is up, reboot.

I will have to look into Xubuntu, ... after all, BAMT is just linux, cgminer/sgminer, and AMD drivers stuffed into a flash drive image, ready to write.
newbie
Activity: 52
Merit: 0
You don't need to logon as root if the script is on the system, even if it isn't you should not login as root. Your script just has to run as a privileged user. You can use a simple python script ran via cronjobs to read cgminer's JSON response and act accordingly.

Are you having issues with freezing or dead GPU's? To be honest you shouldn't have to reboot at all, I would look into the issue at hand rather than putting a bandaid on it by constantly rebooting. But than I've never used BAMT, I just modified Xubuntu and it runs for weeks without issues.
full member
Activity: 126
Merit: 100
I'm not good at programming, but someone could take my concept and run with it. I have some friends who are and I'm planning on getting the following setup.

I think a raspberry pi could be programmed to ping each rig's IP address every XX minutes. If no reply, it would close a relay connected to the motherboard power switch and cause a hard shut down.

Thoughts?
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
I looked at that already. It may work. Even the CGRemote one. But it's a Windows dot NET app. It's too big for what I want to do, and it needs to be installed on the rig itself. My rigs are headless and have no hard drive, running Litecoin BAMT 1.3 (or 1.5).

If there is a linux version of that, I could use it.

I can still do it manually the way I do it, and I can probably come up with some hacked up VB or PB or other software for my monitoring machine to control the others (the rigs). But I'm a little concerned when my farm eventually grows large. I'm optimistic I'm going to add a lot of rigs. Smiley Dreaming maybe.
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Hi,

I've looked at a bunch of different scripts, programs, stuff that you have to install on your rigs, stuff that you install on the monitoring machine, etc.

What I really need is something that is very very simple. Here is the logic I want it to follow:

1. check cgminer / sgminer if running okay.
2. check if GPUs are running okay, are not sick or dead.
3. check hash speed of GPUs, and see if they are above or below a certain number.
4. reboot that rig if any of the above is detected.
5. don't check the new rig for 2 or 3 minutes (wait for it to reboot and start mining.)
6. check each rig every minute or two.

That's it. Very simple. It's either on the rig itself, OR it can be a remote master of the rigs.

The rigs I build and use are running Litecoin BAMT. They are headless, thus I set them up using SSH, edit the confs, tweak settings, add the pools and backup pools, and let it mine.

Currently, I manage the rig manually, by either monitoring the ip address on a browser, or SSH into the ip of the rig and look at the cgminer screen. I log in to the rig as root, using PuTTy.

Some times, running this command works:
Quote
/etc/init.d/mine restart

But for all other cases, running this command always works:
Quote
echo b > /proc/sysrq-trigger

It's as if someone hit the reset button physically on the machine. I want my automatic script to run the second command.


Okay, is there an easy way to do this? Or has someone already made such a thing? I can probably make some sort of program that uses the cgminer api to get the info I need, but I need something else to log on the machine as root and reboot it.

This remote manager does not run on any of the rigs, it is on its own, so it can actually even be an Android device (like a tablet or phone) that is simply on the same local network as the rigs.

The alternative is a script or cron job or something that runs on the rig itself and does all that, and can reboot itself using the same command above.
Jump to: