interfect (OP)
|
|
May 26, 2011, 07:22:18 AM |
|
Hey,
Does anyone know if there is a miner available for the Arduino already? I know it probably wouldn't be cost- or power-effective to mine on an Arduino, but if nobody else has done it yet I was thinking of attempting it.
On that note, is there documentation on the mining algorithm? What do I need to do with what I get from getwork?
|
|
|
|
|
commlinx
|
|
May 26, 2011, 08:26:26 AM |
|
Sounds like a cool little project, when I read the topic I thought it was going to be someone with plans of clustering thousands of them . Maybe you could port the following CPU miner using the assembler hash above: http://forum.bitcoin.org/index.php?topic=1925.0I haven't used it but checked the code and it looks pretty clean and un-bloated. What were you planning, getting work from the PC and pumping work and results over the serial port, or using a shield to do the network comms directly from the AVR?
|
|
|
|
interfect (OP)
|
|
May 27, 2011, 04:28:58 AM |
|
Sounds like a cool little project, when I read the topic I thought it was going to be someone with plans of clustering thousands of them . Maybe you could port the following CPU miner using the assembler hash above: http://forum.bitcoin.org/index.php?topic=1925.0I haven't used it but checked the code and it looks pretty clean and un-bloated. What were you planning, getting work from the PC and pumping work and results over the serial port, or using a shield to do the network comms directly from the AVR? I don't have an Ethernet shield, so I'll probably have a program on a PC to do the JSON and feed work to the board. That link looks pretty useful; there's also a fairly clean-looking Python implementation on the same person's Github.
|
|
|
|
eturnerx
Member
Offline
Activity: 84
Merit: 10
|
|
May 27, 2011, 03:47:58 PM |
|
The Arduino microprocessors are really weak so you'll probably not get much out of them in terms of Hash/s. What might work is wiring up some custom SHA256 IC's and using the Arduino to farm work to them - of course with the PC doing the comms.
|
|
|
|
merlz
Newbie
Offline
Activity: 12
Merit: 0
|
|
May 30, 2011, 05:29:34 AM |
|
I'd be happy to play around with this/improve this if you can get some initial code running :-)
|
|
|
|
KnuttyD
Member
Offline
Activity: 109
Merit: 11
|
|
May 30, 2011, 06:24:53 AM |
|
Haha hey, I did a lot of work with the Arduino a little while ago, maybe I can help with this project. Here is an example of a little program I wrote to bit bang PWM to some RGB led's: http://www.youtube.com/watch?v=C3s8qDhUwloGood luck!
|
If I helped you in some way, and you feel obligated to do so, you can tip me some coin! 1KVadqbELY3KuJhkm9rDtcwxZknhRsfPHY
|
|
|
BombaUcigasa
Legendary
Offline
Activity: 1442
Merit: 1005
|
|
May 30, 2011, 09:27:34 AM |
|
The Arduino microprocessors are really weak so you'll probably not get much out of them in terms of Hash/s. What might work is wiring up some custom SHA256 IC's and using the Arduino to farm work to them - of course with the PC doing the comms.
Indeed, they are weak, but let's not forget once you have the right chip and board schematics, you can put them in a small "farm". As you can see above, after prototyping, the actual implementation surface could be as little as 2cm^2 per core. Also consider running a parallel algorithm on them, such that they use all cores on a board for a single hash, instead of each core doing it's own complete hashing. An USB chip and an USB connection and a PC are needed to actually validate the hashes and collect the results. It's sunny outside, plug them into a PV cell and when the sun shines you get free bitcoins straight from the source... Could someone do the math in terms of Mhash/s for them? (would it be something like 20Khash/s for a single one which needs 20 years for hardware breakeven?) From the specs: - Up to 20 MIPS throughput at 20MHz - Operating voltage: ATmega48/88/168: 0 - 10MHz @ 2.7V - 5.5V, 0 - 20MHz @ 4.5V - 5.5V - Power consumption: 250μA at 1MHz, 1.8V - Price per 1000 units: < 2.5$ How 1000 of them look like:
|
|
|
|
nallar
Newbie
Offline
Activity: 1
Merit: 0
|
|
May 30, 2011, 10:01:07 AM |
|
I'd recommend that this is not done using Arduinos - it'd be more power efficient, and better MH/$ to use PIC32MX microcontrollers. (Although it can be damn hard to get a toolchain set up on Linux because they only released the source for what they have to release... ) Assuming it takes 1984 cycles to do a single SHA256(which it should), you'd get (80MHz/(1984*2)) = (80 * 100 000 000) / 3968 = 2 016 129.03 hashes per second. (I bet I've screwed something up there, somehow ) Of course, I've only included the time for the two hashes. (which is wrong, because you can optimise away part of the last hash, if my beliefs are correct, anyway?), and none of the checking/control stuff. In this case, I still think you'd only get ~50MH/s for $200. (THIS IS NOT AT BULK PRICING THOUGH! If you were to buy say, a thousand of them, you might find it to be very different ) And that's at a maximum cost of 8$ + support components. (decoupling capacitors, PCBs, etc)(quite probably less, I can't be bothered to check ) An Arduino would take more clock cycles to do it, I don't know how many, because it's not 32Bit. And it runs more slowly too, so it's unlikely to get you as much money in return.
|
|
|
|
commlinx
|
|
May 30, 2011, 10:07:39 AM Last edit: May 30, 2011, 10:35:25 AM by commlinx |
|
Could someone do the math in terms of Mhash/s for them? (would it be something like 20Khash/s for a single one which needs 20 years for hardware breakeven?) Looking at the hash code above there's close to 1000 opcodes, and it's not entirely unrolled, if it was that would be 20k SHA hashes. That would be 10khash/s in Bitcoin terms (2 SHA per hash) but briefly looking I'd expect < 1khash/s. I can't be bothered but the free AVR Studio package has a simulator you could run it through to see the instruction cycles taken. If you were seriously contemplating it a small ARM is less than a dollar more expensive, and I'd expect would be about 8 times faster because most of the calcs are 32 bit and they run over double the clock rate. The CPU mining comparison suggests 110khash for a 528MHz ARM 11 so I suspect a low-cost ARM (50MHz odd) would only come in around 10khash. Compared to say the 5970 I use that would need about 7000 of them at $2 a pop to compete. Also to compete on power it would need to use about 4mA a chip, even most AVRs you more than that at full tilt. I think the OP had the right idea to just treat it as an interesting little project Edit - just realised above is out by an order of magintude, making it even worse.
|
|
|
|
merlz
Newbie
Offline
Activity: 12
Merit: 0
|
|
May 30, 2011, 10:37:10 AM |
|
I think it would be both interesting and useful to have a working codebase and example that could be used with microcontrollers. This project's aim isn't to produce something with a superior efficiency to current solutions, but if somebody does want to try going down that path it would be nice to have a codebase and/or ideas to work from.
I think something that could use one or more arduino's to do the calculations in an efficient manner would be a net positive for other projects as well.
|
|
|
|
BombaUcigasa
Legendary
Offline
Activity: 1442
Merit: 1005
|
|
May 30, 2011, 11:11:26 AM Last edit: May 30, 2011, 11:59:03 AM by BombaUcigasa |
|
The arduino advantage is once you have a working prototype, it costs around 2.5$ per core to build your implementation, very little costs for the surrounding parts, and can be implemented with low-tech tools like a soldering iron, some PCBs and etching solution. The proposed alternatives require more development work, more expensive parts and assemblies.
|
|
|
|
commlinx
|
|
May 30, 2011, 11:27:19 AM Last edit: May 30, 2011, 11:39:44 AM by commlinx |
|
Sure arduino is slow as hell, but it's virtually free to use in terms of electricity 0.7mAV per core? Or say you build a 100 cores board (250$), that would draw 70mW?
I use AVRs a lot but have never used an Arduino as such. But for example first one I just found was a nano using an ATmega168, you need 4.5V to get 20MHz and the datasheet lists 12mA @5V for 8MHz. It would be higher than that for 20MHz but even if it wasn't that would still be 4.5 x 12mA (current would be a little lower at 4.5V at 8MHz) = 54mW per chip. The lower currents you see in sales blurbs are normally running at 32KHz and/or using the various standy modes. The relationship to clock rate is normally "somewhat" linear, so I'd expect under 100mW a chip at 20MHz, maybe more like 70mW like you said but for each chip not 100.
|
|
|
|
BombaUcigasa
Legendary
Offline
Activity: 1442
Merit: 1005
|
|
May 30, 2011, 11:58:25 AM |
|
Sure arduino is slow as hell, but it's virtually free to use in terms of electricity 0.7mAV per core? Or say you build a 100 cores board (250$), that would draw 70mW?
I use AVRs a lot but have never used an Arduino as such. But for example first one I just found was a nano using an ATmega168, you need 4.5V to get 20MHz and the datasheet lists 12mA @5V for 8MHz. It would be higher than that for 20MHz but even if it wasn't that would still be 4.5 x 12mA (current would be a little lower at 4.5V at 8MHz) = 54mW per chip. The lower currents you see in sales blurbs are normally running at 32KHz and/or using the various standy modes. The relationship to clock rate is normally "somewhat" linear, so I'd expect under 100mW a chip at 20MHz, maybe more like 70mW like you said but for each chip not 100. I read the "active" figure for the 1Mhz@1.8V, and extrapolated to 5V. Don't know how to compensate for speed. So let's look at the document again http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdfpage 304 - Active 8Mhz@12mA (5V) page 315 - Active supply current vs. frequency (1MHz - 24MHz) chart, it seems that 24Mhz, 5.5V needs 15mA. The number we were looking for was that 20Mhz 5V needed 11mA. page 319 - Idle supply current vs. frequency (1MHz - 24MHz) chart, it seems that 24Mhz, 5.5V needs 4mA. So I stand corrected, each core requires 55mAV (or 83mAV overclocked).
|
|
|
|
commlinx
|
|
May 30, 2011, 12:12:04 PM |
|
So I stand corrected, each core requires 55mAV (or 83mAV overclocked).
Sounds about right, so if my "extremely optimistic" 10khash/s at the higher clock rate was realised it would be 8.3W per mhash/s. To match a 5970 at 700mhash/s you'd need 70,000 chips and 5810W. Must reiterate I think it's a cool project, just once anyone does it you're probably better to offer your newly developed skills in exchange for BTC rather than using it to mine with .
|
|
|
|
merlz
Newbie
Offline
Activity: 12
Merit: 0
|
|
May 30, 2011, 12:43:01 PM |
|
All the arguments about profitability aside, how would one actually go about implementing it in a sensible way? what's the compatibility list? How much memory do we actually need to calculate the hash, and how do we send/receive it efficiently?
All these questions are good ones to answer in an arduino implementation, and could have efficiency consequences for custom boards/IC's afterward.
|
|
|
|
commlinx
|
|
May 30, 2011, 01:03:15 PM |
|
All the arguments about profitability aside, how would one actually go about implementing it in a sensible way? what's the compatibility list? How much memory do we actually need to calculate the hash, and how do we send/receive it efficiently?
All these questions are good ones to answer in an arduino implementation, and could have efficiency consequences for custom boards/IC's afterward.
AVR has a GNU toolchain so you'd just need to split the code above, do the hashing on an AVR that doesn't need much RAM and pass it back to a PC say over a serial port. For the reasons above anything using an AVR would be a waste of time for a custom board, and a custom IC would be an ASIC. Apart from being very expensive starting with an AVR isn't even vaguely how you'd go about starting an ASIC design. There's a thread here about an open source FPGA design which would be more likely a starting point for an ASIC: http://forum.bitcoin.org/index.php?topic=9047.0But for an ASIC you'd want to count on dropping over $100K even if you were an expert in the area.
|
|
|
|
Littleshop
Legendary
Offline
Activity: 1386
Merit: 1004
|
|
May 30, 2011, 04:06:25 PM |
|
The arduino advantage is once you have a working prototype, it costs around 2.5$ per core to build your implementation, very little costs for the surrounding parts, and can be implemented with low-tech tools like a soldering iron, some PCBs and etching solution. The proposed alternatives require more development work, more expensive parts and assemblies.
What does a 5870 cost per core? 1600 cores/$320 (for easy calc) so maybe 5 cents a core?
|
|
|
|
BombaUcigasa
Legendary
Offline
Activity: 1442
Merit: 1005
|
|
May 30, 2011, 04:41:47 PM |
|
All the arguments about profitability aside, how would one actually go about implementing it in a sensible way? what's the compatibility list? How much memory do we actually need to calculate the hash, and how do we send/receive it efficiently?
All these questions are good ones to answer in an arduino implementation, and could have efficiency consequences for custom boards/IC's afterward.
Looking at the numbers, I don't think anyone is going to find out anytime soon The fact that the hardware breakeven is longer than the duration of life for the device, and that while interesting to get a C/lua/python/ASM implementation running in single-core or multi-core configurations, the lessons would provide too little for benefits on other platforms. My suggestion is to start with the public code in public repositories on all the miners published so far and attempt to rewrite parts of them for the arduino. Might as well start directly on those other platforms. I'm going to watch for an android implementation now, surely that's more accessible and powerful than any arduino implementation might go.
|
|
|
|
wolftaur
Member
Offline
Activity: 112
Merit: 10
|
|
May 30, 2011, 04:59:46 PM |
|
Some of the LPCs can be had for 60 cents for 1K chip count. That's a 75MHz ARM core instead of a 20MHz AVR core... So a much lower cost per core, a much higher performance per core. I'm a fan of AVRs, but still, there's such a thing as trying too hard -- which is why I laugh at everyone still trying to do "real work" on their CP/M system.
--Keith
|
"MOOOOOOOM! SOME MYTHICAL WOLFBEAST GUY IS MAKING FUN OF ME ON THE INTERNET!!!!"
|
|
|
|