work with this code:
RESET RIG
#!/bin/bash
# RESET RIG
GPIO_RESET=23
gpio -g mode $GPIO_RESET out
sleep 2
# Resetea el equipo
gpio -g write $GPIO_RESET 0 ----> HERE IS THE CHANGE
sleep 1 # Lo mantengo pulsado 1 segundo
gpio -g write $GPIO_RESET 1 ----> HERE IS THE CHANGE
exit
POWER ON/OFF RIG
#!/bin/bash
GPIO_POWER=24
gpio -g mode $GPIO_POWER out
sleep 2
# Enciende o apaga el equipo segun su estado previo
gpio -g write $GPIO_POWER 0 ----> HERE IS THE CHANGE
sleep 1 # Lo mantengo activado 1 segundo
gpio -g write $GPIO_POWER 1 ----> HERE IS THE CHANGE
exit
And this one wich looks pretty the same
works with this code:
RESET RIG
#!/bin/bash
GPIO_RESET=23
gpio -g mode $GPIO_RESET out
sleep 2
# Resetea el equipo
gpio -g write $GPIO_RESET 1 ----> HERE IS THE CHANGE
sleep 1 # Lo mantengo pulsado 1 segundo
gpio -g write $GPIO_RESET 0 ----> HERE IS THE CHANGE
exit
POWER ON/OFF RIG
#!/bin/bash
GPIO_POWER=24
gpio -g mode $GPIO_POWER out
sleep 2
# Enciende o apaga el equipo segun su estado previo
gpio -g write $GPIO_POWER 1 ----> HERE IS THE CHANGE
sleep 1 # Lo mantengo activado 1 segundo
gpio -g write $GPIO_POWER 0 ----> HERE IS THE CHANGE
exit
Hope it helps.
2.check hashrate from pool, if hashrate is low, it is freezenn.
3.run nvidia-smi via ssh, if it exits with error code, the rig is unhealthy, reset it.
Hi! I sat up Raspberry Pi and relay, but I can only manually power on/off my rigs. The program from here: https://bitcointalksearch.org/topic/diy-auto-hard-reset-mining-rigs-with-raspberry-pi-1933467 works, but sometimes when miner hangs, rig accepts ping and RPi doesn't reset it. Can you share your program here? And can RPi and nvOC be sat up to work together like SRR?
SRR_SERIAL="000055"
__SRR_SLOT="1"
Sorry I wasn't clear enough, your code is exactly what I mean to reset "manually", I'm using it. But we need code to work automatically and together with nvOC and it's scripts, like SRR
Ok, I got it, I think.
The thing is the raspi must accept commands to reset/power on/off from Nvoc. If that is right then:
1. A variable is needed to hold the raspi's ip (in 1bash?)
2. Guess a variable is needed to choose raspi or srr (in 1bash?)
3. Send command from nvoc to fire up the reset script in raspi (same conditions as in srr)
Example to send commands from a local linux box to a remote one (executing in the remote one):
ssh -o LogLevel=quiet -p $PORT root@$REMOTE_IP 'if [[ -f /tmp/file.csv ]]; then /bin/rm --interactive=never /tmp/file.csv \
&& echo "OK: /tmp/file.csv has been deleted in remote system"; else echo "OK: /tmp/files.csv missing in remote system";fi' | tee -a $LOG_FILE
This is a very good option but a certificate id needed, so I don't think is the best solution from the user is point of view becouse it needs to install the certificate manually in the raspi.
Other option is use sshpass: https://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script
I don't use any of the mechanisms that Nvoc has for restart the system etc. Only use Maxximus007_AUTO_TEMPERATURE_CONTROL
we can add the RPi's ssh public key to every rigs, so the RPi can exec command against rigs via ssh. nvOC doesn't need to know RPi. RPi check hashrate from pool, if it finds a rig with low hashrate on pool, reset the rig.
I have runable codes in github, but the code quality is low, only supports few pools, and there is no setup descriptions, I'm going to improve it and maybe release it next month:)
Great. It's a lot more direct aproach. If the rig is not in danger of "burning" I would try first a reboot. Not system likes a hard reset!!.