Author

Topic: [GUIDE] Running cgminer/bfgminer on Synology NAS (Read 18117 times)

newbie
Activity: 51
Merit: 0
I want to connect my old blades to them - but I sold em today Cheesy
At least i got more then I paid .. ebay is wonderful :p
newbie
Activity: 54
Merit: 0
Hi,

maybe this is a bit off topic but did anyone get the stratum proxy running on any synology device ?
This would really help me further in safing electricity Wink

and for the bfgminer meanwhile there is a package for synology devices: https://bitbucket.org/polandj/synominer/

No, but why would you use that?
bfgminer already supports stratum, but maby you need it for something entirely different?
newbie
Activity: 51
Merit: 0
Hi,

maybe this is a bit off topic but did anyone get the stratum proxy running on any synology device ?
This would really help me further in safing electricity Wink

and for the bfgminer meanwhile there is a package for synology devices: https://bitbucket.org/polandj/synominer/
newbie
Activity: 54
Merit: 0
OK - in case others are trying to run a miner on a synology nas: go for bfgminer. It is far easier to build on the (ARMv5 based) synology.

Once you have your toolchain set up as described above, it is quite straight forward to build first its dependencies and then bfgminer itself, following the instructions given in its README.

To actually run it you will need kernelmodules usbserial and ftdi_sio. They are not installed by default, but you can build them as described here:
http://hallard.me/how-to-install-kernel-modules-on-synology-ds1010/ (change ARCH to match your system).
Then activate these modules with
Code:
insmod usbserial.ko
insmod ftdi_sio.ko vendor=0x0403 product=0x6014
403/6014 is for BFL devices - if you have something else you can find its vendor and product ids using lsusb (or google).
hero member
Activity: 774
Merit: 500
Lazy Lurker Reads Alot
I think the thread is kinda dead
Since the fail to get it working on my 411j, i have stopped trying to get it to work
Also because i sold all small miners
newbie
Activity: 54
Merit: 0
OK, I got to this part:

Step 4. Compiling cgminer/bfgminer[TODO]

To be continued in a moment...

So I tried to build it as described in the CGMiner README (version 3.6.4),
but when doing ./configure I get this errormessage:

configure: error: Missing required libudev dev

Is there any way to build it without udev?
Or to get udev on the NAS (mine is a DS411slim with DSM 4.3)?
hero member
Activity: 810
Merit: 1000
SO now the bugs are out can we get a bug free step by step guide for non-native linux people...pls

Also, would this set up work for a DNS-320?
sr. member
Activity: 267
Merit: 250
Learn to go against your mind
once version libcurl 7.32 is complied, how do I make the Synology see it? When I check the version I get:
DiskStation> curl-config --version
libcurl 7.24.0
hero member
Activity: 774
Merit: 500
Lazy Lurker Reads Alot
Ok the first i got and worked well

wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libidn_1.25-1_arm.ipk

but the second did error again out

DiskStation> ipkg install -verbose_wget wget-ssl
Installing wget-ssl (1.12-2) to root...
Nothing to be done
An error ocurred, return value: 1.
Collected errors:
ERROR: The following packages conflict with wget-ssl:
         wget

So i just installed the succesfull received package which now ended succesfull
I see clearly that somehow for wget it message nothing to be done but for the wget-ssl it fails.
newbie
Activity: 23
Merit: 0
No no lol your missing the point

crosstools package totally not exits from the packages

goto the link provided as in my post and browse through the packages it is not there

the second error is because it can not find the needed crosstools

hence it error out

http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/ try to find the crosstools

No no no-- because you can't run "ipkg update" without ipkg-- and from the message you sent:

Quote
DiskStation> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/P
ackages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.

That means you got "ipkg" already.  There's nothing there in "/opt/lib/ipkg/lists/cross",   but there is something in "/opt/lib/ipkg/lists" which is the cross file (that contains packages that you can download).

EDIT: ah-- I see what you mean on the error.  Ignore this:

Code:
Cannot find package crosstool-native.
Check the spelling or perhaps run 'ipkg update'
ERROR: The following packages conflict with wget-ssl:
         wget

and do this:
Code:
cd /volume1/@tmp
ipkg install -verbose_wget libidn

it will show you something like this (example for sysfsutils):

Code:
DiskStation> ipkg install -verbose_wget sysfsutils
Installing sysfsutils (2.1.0-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/sysfsutils_2.1.0-1_arm.ipk

take note of the url and do
Code:
wget 

do the same thing for wget-ssl:
Code:
ipkg install -verbose_wget wget-ssl
wget

then do
Code:
ipkg install filename1
ipkg install filename2
where filename1 and filename2 is the name of the .ipk file of libidn and wget-ssl.  I'll put this in the guide above.
hero member
Activity: 774
Merit: 500
Lazy Lurker Reads Alot
No no lol your missing the point

crosstools package totally not exits from the packages

goto the link provided as in my post and browse through the packages it is not there

the second error is because it can not find the needed crosstools

hence it error out

http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/ try to find the crosstools
newbie
Activity: 23
Merit: 0
As i was running the guide i got into some errors fairly quick

first error is :

Configuring tcl
Configuring zlib
An error ocurred, return value: 1.
Collected errors:
Cannot find package crosstool-native.
Check the spelling or perhaps run 'ipkg update'
ERROR: The following packages conflict with wget-ssl:
         wget
DiskStation> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/P
ackages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.

I tried again the update but it did not do anything other then after the reboot


First: which DSM version do you have?

I see you got until ipkg update, that means you can get the precompiled binaries for the toolchain.
When you try these commands nothing happens?

Code:
ipkg install gcc
ipkg install make automake autoconf libtool binutils
ipkg install crosstool-native optware-devel

type in
Quote
ipkg list_installed

and paste here the output.
hero member
Activity: 774
Merit: 500
Lazy Lurker Reads Alot
As i was running the guide i got into some errors fairly quick

first error is :

Configuring tcl
Configuring zlib
An error ocurred, return value: 1.
Collected errors:
Cannot find package crosstool-native.
Check the spelling or perhaps run 'ipkg update'
ERROR: The following packages conflict with wget-ssl:
         wget
DiskStation> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/P
ackages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cross
Successfully terminated.

I tried again the update but it did not do anything other then after the reboot

second error comes when i try :
DiskStation> pkg-config --libs libcurl
Unknown keyword 'URL' in '/opt/lib/pkgconfig/libcurl.pc'

any and all other commands went fine and worked as should i seen no other errors
so i think the crosstool-native is not found or the name is wrong
I checked the page where the file should be and its not present at all


hero member
Activity: 539
Merit: 500
watching - thanks for this!
newbie
Activity: 23
Merit: 0
Now this is the kind of shit I like to see. Are you using it with USB devices? How much power does it use? Good work!

The NAS I have (410j) consumes about 42w, but since it's always on, it's "free" electricity so to speak.
The native compiling of cgminer/bfgminer should have been straightforward, but there are just some nags that you would encounter and I merely pointed the solution to it Smiley
legendary
Activity: 952
Merit: 1000
Now this is the kind of shit I like to see. Are you using it with USB devices? How much power does it use? Good work!
newbie
Activity: 23
Merit: 0
Newbie here, but as all other newbies are thinking, better mine now or never  Roll Eyes

I plan to use my Synology NAS to mine with ASIC erupters since it's running 24/7.  This guide is using Synology DSM 4.2 (3202) as a base, with a DS410j (Marvell MV6281) NAS (I cannot guarantee that this guide will work for DSM versions lower than 4.2!)
Even if it is slow and will void warranty, I will be doing native compiling which is mostly documented here.  You can also do cross-compiling but it gives me more headache since there are a lot of library dependencies, it's much easier to do it natively (albeit there are things to be fixed in the NAS though to get cgminer/bfgminer to be compiled properly).  Since I'm waiting for my USB erupters, might as well write a guide here while waiting.

DISCLAIMER : Since this will void your warranty, I am not responsible for any result leading to corruption of your NAS.

Step 1. Setting up the bootstrap/toolchain

Login as user "root", password is the same as for admin via SSH.
Change to a directory such as "/volume1/@tmp"
Download the script for installing bootstrap for your CPU. To find out which kind of CPU your NAS have check it here.

Code:
wget 

For Intel XScale FW IXP420 BB ARM Processor http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/unstable/ds101-bootstrap_1.0-4_armeb.xsh
For Intel Atom CPU's: D410, D425, D510, D525 and D2700 Processors http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
For 8241 PPC models http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/ds101-bootstrap_1.0-4_powerpc.xsh
For Freescale PowerPC QorIQ P1022, 8533/8543 PPC models http://ipkg.nslu2-linux.org/feeds/optware/syno-e500/cross/unstable/syno-e500-bootstrap_1.2-7_powerpc.xsh
For mv5281 ARM models http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/syno-x07-bootstrap_1.2-7_arm.xsh
For Marvel Kirkwood mv6281 ARM models http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
For Marvel Kirkwood mv6282 ARM models http://wizjos.endofinternet.net/synology/archief/syno-mvkw-bootstrap_1.2-7_arm-ds111.xsh

In my case, it's
Code:
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh

Set the .xsh script to be executable and run the script:
Code:
chmod +x syno-mvkw-bootstrap_1.2-7_arm.xsh
sh syno-mvkw-bootstrap_1.2-7_arm.xsh

After the script has finished, do not reboot yet.  Do the following:

make symlink of opt:
Code:
cd /
ln -s /volume1/@optware /opt

check that /etc/profile contains:
Code:
PATH=/opt/bin:/opt/sbin:$PATH
if not, add it.

In /root/.profile comment the following lines by adding #:
Code:
#PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
#export PATH

Now you can reboot.  Reboot the NAS and login again as user "root", then

Code:
ipkg update

Now you can get the toolchain!  Run these series of commands:

Code:
ipkg install gcc
ipkg install make automake autoconf libtool binutils
ipkg install crosstool-native optware-devel

Toolchain done!  You can now start compiling natively!  (Still a long way to compile cgminer/bfgminer though... Tongue)

Step 2. Setting up the environment and dependencies

Run the following commands:

Code:
ipkg install libcurl libcurl-dev
ipkg install ncurses-dev
ipkg install sysfsutils

check libcurl if properly installed by typing:
Code:
pkg-config --libs libcurl

Fix ldconfig path

Code:
export PATH=$PATH:/volume1/@optware/share/ipkg/intercept

Fixing libpthread

the libpthread installed in optware is corrupted, so we copy the original libpthread installed.  Make a backup of libpthread:
Code:
mkdir /opt/arm-none-linux-gnueabi/lib_disabled
mv /opt/arm-none-linux-gnueabi/lib/libpthread* /opt/arm-none-linux-gnueabi/lib_disabled

Copy and link libpthread to /opt
Code:
cp /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
cd /opt/arm-none-linux-gnueabi/lib/
ln -s libpthread.so.0 libpthread.so
ln -s libpthread.so.0 libpthread-2.5.so


Step 3. Compiling dependencies

download and install jansson:

Code:
wget http://www.digip.org/jansson/releases/jansson-2.1.tar.gz
tar xvf jansson-2.1.tar.gz
cd jansson-2.1
./configure --prefix=/opt
make install

download uthash header files (located in https://github.com/troydhanson/uthash/tree/master/src) and put it in /opt/include

download and install libusb:

Code:
wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
tar xvf libusb-1.0.9.tar.bz2
cd libusb-1.0.9
./configure --prefix=/opt
make install

Step 4. Compiling cgminer/bfgminer[TODO]

To be continued in a moment...
Jump to: