Bitcoin Forum

Bitcoin => Hardware => Topic started by: matthewh3 on June 01, 2012, 12:19:36 PM



Title: Spartan6's on P2Pool using a RaspberryPi?
Post by: matthewh3 on June 01, 2012, 12:19:36 PM
Anyone tried mining Spartan6's on P2Pool using a RaspberryPi yet?


Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: norulezapply on June 01, 2012, 01:25:23 PM
I'm working on it at the moment.

I'll let you know when I receive my FPGAs.

Hopefully it's powerful enough to run P2Pool.


Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 04, 2012, 01:42:03 AM
Got cgminer compiled and ready to go... just waiting on my icarus boards!


Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: Garr255 on June 04, 2012, 01:49:29 AM
Got cgminer compiled and ready to go... just waiting on my icarus boards!

I'm the opposite, waiting for my pi!


Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 04, 2012, 02:10:41 AM
I used the Debian preinstall image from raspberrypi.org then

apt-get install git build-essential autoconf pkg-config libcurl4-openssl-dev libncurses5-dev

got the latest from github and built it. Binaries seem to be GTG!

Just make sure your micro usb charger is at least 1 amp or it will act squirrely. I'm using an HP 2 amp designed for their no defunct webos tablet (you can pick one up for about 5 bucks).



Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: punin on June 04, 2012, 06:34:31 PM
I used the Debian preinstall image from raspberrypi.org then

apt-get install git build-essential autoconf pkg-config libcurl4-openssl-dev libncurses5-dev

got the latest from github and built it. Binaries seem to be GTG!

Just make sure your micro usb charger is at least 1 amp or it will act squirrely. I'm using an HP 2 amp designed for their no defunct webos tablet (you can pick one up for about 5 bucks).

I tried this, run autogen.sh then tried CFLAGS="-O2 -Wall -march=native" ./configure --enable-ztex but I get:
Code:
checking whether the C compiler works... no
configure: error: in `/home/pi/git/cgminer':
configure: error: C compiler cannot create executables
See `config.log' for more details


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: wogaut on June 04, 2012, 06:37:55 PM
Check out the post I have made here:
https://bitcointalk.org/index.php?topic=69183.msg919685#msg919685

It's BFL, but the cgminer install is very similar, just activate the proper FPGA type for ./configure



Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: punin on June 04, 2012, 07:35:11 PM
Check out the post I have made here:
https://bitcointalk.org/index.php?topic=69183.msg919685#msg919685

It's BFL, but the cgminer install is very similar, just activate the proper FPGA type for ./configure



Cheers!


Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: wogaut on June 04, 2012, 09:44:03 PM
I used the Debian preinstall image from raspberrypi.org then

apt-get install git build-essential autoconf pkg-config libcurl4-openssl-dev libncurses5-dev

got the latest from github and built it. Binaries seem to be GTG!

Just make sure your micro usb charger is at least 1 amp or it will act squirrely. I'm using an HP 2 amp designed for their no defunct webos tablet (you can pick one up for about 5 bucks).

I tried this, run autogen.sh then tried CFLAGS="-O2 -Wall -march=native" ./configure --enable-ztex but I get:
Code:
checking whether the C compiler works... no
configure: error: in `/home/pi/git/cgminer':
configure: error: C compiler cannot create executables
See `config.log' for more details

I really don't think you need to use the CFLAGS="-O2 -Wall -march=native" directive.

Have you tried following my guide I linked in the above post? Do it in the suggested order, and I don't think you should get the C compiler issue, that doesn't sound like a ztex issue at all. Given that you downloaded the Debian squeeze for your Raspberry and if you follow my instructions like a cooking recipe (and don't forget the apt-get update at the beginning, or the aclocal before autogen.sh, ...) I don't really see the issue (unless cgminer changed since release ckolivas-cgminer-v2.4.1-9-gb69d735.zip).  

Probably add the 'sudo apt-get install' commands for libudev and libusb in the first section too, just to make sure.


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 06, 2012, 07:08:27 PM
I was able to get the Icarus attached to a Dlink usb hub. It seems there is a problem with either the kernel or the raspberrypi. I have three icarus connected and they show up as /dev/ttyUSB0, 1, and 2. However, cgminer and RG7Miner clients cannot open more than 2 at a time. The last port opened gives an error that the port does not exist, even though it is clearly listed in /dev. It appears to be random of which of the 3 is not available. When I use my regular ubuntu pc everything works as expected (even using the dlink usb hub).

Anyone have similar info? solutions?

Thanks,
J


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: wogaut on June 06, 2012, 07:27:24 PM
I was able to get the Icarus attached to a Dlink usb hub. It seems there is a problem with either the kernel or the raspberrypi. I have three icarus connected and they show up as /dev/ttyUSB0, 1, and 2. However, cgminer and RG7Miner clients cannot open more than 2 at a time. The last port opened gives an error that the port does not exist, even though it is clearly listed in /dev. It appears to be random of which of the 3 is not available. When I use my regular ubuntu pc everything works as expected (even using the dlink usb hub).

Anyone have similar info? solutions?

Thanks,
J

Are those two showing up always ttyUSB0 and ttyUSB1? I.e. Does the problem specifically occur when a ttyUSB higher than 0 or 1 is needed?
How is it when you open two FPGA devices manually in cgminer (instead of the -S auto option), one of them being attached to ttyUSB2?
What I'm trying to get at is, is this specific to the used ttyUSB port (like only ttyUSB0 and ttyUSB1 work), which would point to an issue with the USB kernel model then. 

Please keep us updated, that is very concerning indeed. 



Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 07, 2012, 12:17:01 AM
lsusb shows the following:
ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

The following posts indicate others might be having issues with the Prolific usb to serial adapter:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=6218
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=6629&p=90223

I'm using a Dlink DUB-H7 7-port USB hub to connect the RasPi to the Icarus boards. I'm NOT powering RasPi from hub, I'm using a 2A HP TouchPad micro usb adapter.

Still gathering data at this point...


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 07, 2012, 12:19:05 AM

Are those two showing up always ttyUSB0 and ttyUSB1? I.e. Does the problem specifically occur when a ttyUSB higher than 0 or 1 is needed?
How is it when you open two FPGA devices manually in cgminer (instead of the -S auto option), one of them being attached to ttyUSB2?
What I'm trying to get at is, is this specific to the used ttyUSB port (like only ttyUSB0 and ttyUSB1 work), which would point to an issue with the USB kernel model then. 

Please keep us updated, that is very concerning indeed. 


FWIW: It doesn't happen just on higher enumerations, It will also happen on /dev/ttyUSB0


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: P_Shep on June 07, 2012, 07:05:45 PM
Have a look in /dev/usb/tts/ when your devices are plugged in
anything there?


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 08, 2012, 12:59:22 AM
There is no directory /dev/usb

I've found out a couple of things...

First, the hub I'm using is listed as a problem hub here: http://elinux.org/RPi_VerifiedPeripherals#Problem_USB_Hubs

On a whim I modified a USB cable to cut the +5V power wire between the RasPi and the hub. According to some forums even powered hubs can draw too much current from the RasPi. When I did that, the hub was no longer recognized by debian. I stopped testing at that point.

From the same verified hw website it looks like the LogiLink UA0096 10 port USB hub works. After a brief search it appears that this brand/hub is only available in the EU. After another search I found one that looks just like at at Meritline: http://www.meritline.com/10-ports-usb-hub---p-40830.aspx so I bought one. When it comes I'll update this thread. Until then I'll mine with my PC as the host.



Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: punin on June 10, 2012, 07:40:05 PM
There is no directory /dev/usb

I've found out a couple of things...

First, the hub I'm using is listed as a problem hub here: http://elinux.org/RPi_VerifiedPeripherals#Problem_USB_Hubs

On a whim I modified a USB cable to cut the +5V power wire between the RasPi and the hub. According to some forums even powered hubs can draw too much current from the RasPi. When I did that, the hub was no longer recognized by debian. I stopped testing at that point.

From the same verified hw website it looks like the LogiLink UA0096 10 port USB hub works. After a brief search it appears that this brand/hub is only available in the EU. After a brief search I found one that looks just like at at Meritline: http://www.meritline.com/10-ports-usb-hub---p-40830.aspx so I bought one. When it comes I'll update this thread. Until then I'll mine with my PC as the host.



I can report http://www.dealextreme.com/p/high-speed-usb2-0-1-1-10-port-usb-hub-pink-39715 works fine with additional 5V power running 10 Ztex 1.15x's. Without the power I had 4 ports underpowered. I'm feeding my pi through Nokia N9 power supply. I'm mining with cgminer 2.4.2 on EclipseMC.


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 10, 2012, 09:01:21 PM
I can report http://www.dealextreme.com/p/high-speed-usb2-0-1-1-10-port-usb-hub-pink-39715 works fine with additional 5V power running 10 Ztex 1.15x's. Without the power I had 4 ports underpowered. I'm feeding my pi through Nokia N9 power supply. I'm mining with cgminer 2.4.2 on EclipseMC.

Nice color choice!


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: punin on June 11, 2012, 04:54:30 AM
I can report http://www.dealextreme.com/p/high-speed-usb2-0-1-1-10-port-usb-hub-pink-39715 works fine with additional 5V power running 10 Ztex 1.15x's. Without the power I had 4 ports underpowered. I'm feeding my pi through Nokia N9 power supply. I'm mining with cgminer 2.4.2 on EclipseMC.

Nice color choice!

It's sexy and it was the cheapest :) Btw, system had crashed during night's test run. When I disconnected the power from Pi, all the LEDs kept shining, thus indicating power from USB port being drawn into the Pi(?!). I'll keep investigating..


Title: Re: Sparten6's on P2Pool using a RaspberryPi?
Post by: makomk on June 11, 2012, 01:06:21 PM
Hopefully it's powerful enough to run P2Pool.
Doubt it. P2Pool's quite RAM-hungry and it requires running a full Bitcoin daemon which is fairly IO-heavy. Remember that by default the Raspberry Pi only has 128 MB of RAM available to the CPU, which can be increased to a maximum of 224 MB if you're willing to essentially disable GPU acceleration (presumably you're not using that anyway).


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 14, 2012, 05:38:46 PM
I spent some time getting bitcoind to build on RaspberryPi. Here are my steps...

I'm using a Transcend 8GB SDHC Card (Class 10)

First I started with the Debian Wheezy test image from: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=8071
On first boot it will run raspi-config. Here you will increase the size of your root partition, set the maximum RAM to the CPU, and enable SSH server.

Get build tools and deps:
sudo apt-get install build-essential autoconf pkg-config git libcurl4-openssl-dev libncurses5-dev libssl-dev libdb5.1++-dev libboost-all-dev

Adjust virtual memory:
sudo vi /etc/dphys-swapfile
Change:
CONF_SWAPSIZE=100
to:
CONF_SWAPSIZE=400
(I was getting an "g++: internal compiler error: Killed (program cc1plus)" with the default size)

sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Get source and build bitcoind:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin/
git branch -r
git checkout origin/0.6.2

cd src/
make -f makefile.unix

Go to dinner... :)

bitcoind seems to run fine on the RasPi.


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: wogaut on June 14, 2012, 05:55:21 PM
I spent some time getting bitcoind to build on RaspberryPi. Here are my steps...

I'm using a Transcend 8GB SDHC Card (Class 10)

First I started with the Debian Wheezy test image from: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=8071
On first boot it will run raspi-config. Here you will increase the size of your root partition, set the maximum RAM to the CPU, and enable SSH server.

Get build tools and deps:
sudo apt-get install build-essential autoconf pkg-config git libcurl4-openssl-dev libncurses5-dev libssl-dev libdb5.1++-dev libboost-all-dev

Adjust virtual memory:
sudo vi /etc/dphys-swapfile
Change:
CONF_SWAPSIZE=100
to:
CONF_SWAPSIZE=400
(I was getting an "g++: internal compiler error: Killed (program cc1plus)" with the default size)

sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Get source and build bitcoind:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin/
git branch -r
git checkout origin/0.6.2

cd src/
make -f makefile.unix

Go to dinner... :)

bitcoind seems to run fine on the RasPi.

Very cool, thank you!


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 17, 2012, 02:58:22 PM
Just a quick update... initially it seemed that bitcoind was running great on the raspberry pi, however as the blockchain grew in length it appears to be slowing down. I tried copying the blockchain from my desktop but kept getting errors when launching. So I decided I'd had to get the blockchain from scratch. I'm running this way:

sudo dphys-swapfile swapoff
./bitcoind -listen=0 -checkblocks=10 -checklevel=0 &

I turned swap off to keep from thrashing the SD card. The system uses all but about 12 MB of ram! Everything is stable, just slow to load the blockchain and by slow I mean about 10000 blocks per day! It spends more time in mmcqd (the flash memory driver) for disk reads/writes than it does in bitcoind. There is some room for improvement in bitcoind.

My thoughts are once it finally catches up with the blockchain it should be able to keep up fine with the network and should be able to run with P2Pool...

I'll keep you posted.






Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 19, 2012, 01:58:53 AM
Ok got new meritline 10 port hub. Still cannot get more than two icarus modules to work. I've found out that there may be a problem with the driver that broadcom is using for the usb subsystem. Details here:

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6929&p=99103
http://lists.infradead.org/pipermail/linux-rpi-kernel/2012-June/000033.html

It seems like it is polling too fast and my dmesg reports things like:

Code:
INFO:: periodic_channel_available: Total channels: 8, Periodic: 5, Non-periodic: 3
INFO:: schedule_periodic: No host channel available for periodic transfer.
ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008
pl2303 ttyUSB3: pl2303_open - failed submitting interrupt urb, error -4008
INFO:: periodic_channel_available: Total channels: 8, Periodic: 6, Non-periodic: 2
INFO:: schedule_periodic: No host channel available for periodic transfer.
ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008
pl2303 ttyUSB2: pl2303_open - failed submitting interrupt urb, error -4008


So we may be SOL until the USB kernel folks reverse engineer or find a replacement USB driver.

FWIW the new hub identifies itself as:
TERMINUS TECHNOLOGY INC.


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: CoinDiner on June 20, 2012, 02:17:54 AM
Hi

Im not sure where your based but amazon.co.uk do these ones..
LogiLink USB 2.0 Hub 10-Port - Hub - 10 x Hi-Speed    and they are quiet cheap

would a RPi be capable of running a quad FPGA?


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: jaebird on June 20, 2012, 03:35:33 AM
Hi

Im not sure where your based but amazon.co.uk do these ones..
LogiLink USB 2.0 Hub 10-Port - Hub - 10 x Hi-Speed    and they are quiet cheap

would a RPi be capable of running a quad FPGA?

I fully believe the RasPi is capable of handling multitudes of icarus' or other USB connected FPGAs. However, there is a really bad USB kernel driver in the current OS images that seems to be jacking with interrupts. Until that is fixed, the most I get is 2 icarus.


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: BR0KK on June 30, 2012, 10:35:54 PM
got cgminer it running on my pi today :D


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: iongchun on July 01, 2012, 04:10:25 AM
Anyone tried mining Spartan6's on P2Pool using a RaspberryPi yet?

I run BTCMiner on RPi to drive my ZTEX FPGA board, it works fine.
I have to compile and use the following libraries, the source is in the SDK:
libusbJava64.so
libusbJavaSh.so
libusbJavaSt.so

Running p2pool makes me worried the I/O will destory my cheap SD card,
so I leave it and bitcoind on my Mac mini :)


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: BR0KK on July 01, 2012, 08:32:20 AM
Can u explain how u got Btcminer running on your pi ?


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: iongchun on July 02, 2012, 02:12:28 PM
Can u explain how u got Btcminer running on your pi ?

Sure..
1. apt-get install openjdk-6-jre and openjdk-6-jdk
2. Download the SDK here: http://www.ztex.de/downloads/#firmware_kit (http://www.ztex.de/downloads/#firmware_kit), extract it you will get "ztex" directory
3. cd to ztex/libusbJava-src, edit Makefile and change JAVAPREFIX to /usr/lib/jvm/java-6-openjdk (i.e JAVAPREFIX=/usr/lib/jvm/java-6-openjdk)
4. type make, it should build libusbJava64.so, libusbJavaSh.so, and libusbJavaSt.so
5. Soft-link (ln -s) these 3 libraries to the directory where you will run BTCMiner in
6. Run BTCMiner regularly

But it is not stable, crashed my RPi twice in one day, I would go back to Mac before troubleshooting it :(


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: BR0KK on July 02, 2012, 07:05:33 PM
hmm cgminer isn't stable too ....


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: punin on July 07, 2012, 01:01:22 PM
If you want to run ztex on RPi, there's an ARM port available:

http://blog.villekangas.com

You will need to have java installed to run it:

sudo apt-get install openjdk-6-jdk

Then just make sure you have ZtexBTCMiner-120417-ARM.jar in the directory where you run it:

java -cp ZtexBTCMiner-120417-ARM.jar BTCMiner etc..

You might want to tip the guy, and hopefully we'll have a RPi port of eldentyrrell's bitstream aswell.

I'm running a cluster with:

root@raspberrypi:~# uptime 14:46:34 up 2 days,  1:41,  1 user,  load average: 0.37, 0.41, 0.46


Title: Re: Spartan6's on P2Pool using a RaspberryPi?
Post by: BR0KK on July 07, 2012, 10:11:17 PM
Nice ill try that, left him a tip of 0.5 BTC

It runs :D but not as good as i expected: http://www.abload.de/thumb/bildschirmfoto2012-07bnuvl.png (http://www.abload.de/image.php?img=bildschirmfoto2012-07bnuvl.png)

MH is to damn low .... May be my pool or network?  On My main Machine i get the full MH to the pool :(