You are missing the crucial part when replacing the images of the OrangePI. The firmware bin file for the STM chip.
The STM chip has a specific set of algorithms pre-coded into the firmware code. You cannot get around it.
You will have to get the running bin file from a Giant B or X10's STM chip and place it in the "/media/boot/" folder and call it, "G*.bin"
When the miner reboots on the new image of the miner it will compare versions and replace the existing flashed image by entering DFU Mode.
Once updated, it will reenable the hash boards and being mining.
It's doable.
The reason behind that is that the file location and name is here, update_fw.py. Located in the \usr\bin folder.
#!/usr/bin/env python
import subprocess
import os
import sys
from subprocess import Popen, PIPE
import fcntl
import time
import glob
tmpfile = '/home/baikal/tmp.bin'
path = '/media/boot/G*.bin'
fwfile = glob.glob(path)
if not fwfile:
print 'No firmware'
sys.exit()
USBDEVFS_RESET= 21780
# enter dfu mode
def enter_dfumode():
subprocess.call('echo 0 > /sys/class/gpio_sw/PA18/data', shell=True)
subprocess.call('echo 0 > /sys/class/gpio_sw/PA10/data', shell=True)
subprocess.call('echo 1 > /sys/class/gpio_sw/PA10/data', shell=True)
def exit_dfumode():
subprocess.call('echo 1 > /sys/class/gpio_sw/PA18/data', shell=True)
subprocess.call('echo 0 > /sys/class/gpio_sw/PA10/data', shell=True)
subprocess.call('echo 1 > /sys/class/gpio_sw/PA10/data', shell=True)
def reset_usb(driver):
try:
lsusb_out = Popen("lsusb | grep -i %s"%driver, shell=True, bufsize=64, stdin=PIPE, stdout=PIPE, close_fds=True).stdout.read().strip().split()
bus = lsusb_out[1]
device = lsusb_out[3][:-1]
f = open("/dev/bus/usb/%s/%s"%(bus, device), 'w', os.O_WRONLY)
fcntl.ioctl(f, USBDEVFS_RESET, 0)
except Exception, msg:
print ""
def update_firmware():
enter_dfumode()
reset_usb("DFU")
print 'Downloading... ' + fwfile[0]
cmd = 'sudo dfu-util -a 0 -d 0483:df11 -s 0x08000000:leave -D ' + fwfile[0]
subprocess.call(cmd, shell=True)
cmd = 'sudo rm -rf ' + path
subprocess.call(cmd, shell=True)
enter_dfumode()
reset_usb("STM32F407")
reset_usb("DFU")
update_firmware()
exit_dfumode()
print "Done"