Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ne1 on September 12, 2011, 05:02:31 PM



Title: Arduino to interface with bitcoind?
Post by: ne1 on September 12, 2011, 05:02:31 PM
Hi, I originally posted this awhile ago in the general discussion, but it's been derailed a bit and I reallized the development forum is probably where the brains probably hang out these days anyway.  I'm looking to find a way to get an arduino to communicate with bitcoind or maybe open source pos.  Check for payment and turn on a motor or fire a solenoid.  I can handle the hardware side of thigs.  If someone is willing to work with me on this I can build it.  I need some help with the code.  I just posted a project on freelancer.com.  Even if you don't want to help with this project maybe contribute some ideas on what would be the best way to do this.  At this point I'm thinking arduino to python as in the infinity exists link I posted or maybe wifi shield to json rpc api.  Any ideas would be much appreciated. 


Title: Re: Arduino to interface with bitcoind?
Post by: ne1 on September 12, 2011, 05:08:57 PM
or ethernet shield
http://www.sparkfun.com/products/9026


Title: Re: Arduino to interface with bitcoind?
Post by: ne1 on September 12, 2011, 06:05:36 PM
after doing a little digging.  I think the best way is to have python script listen to bitcoind for payment sent to specific address and then python script posts http to arduino via ethernet shield.

so for example - you have a soda fountain with open source pos attached and you send sprite .3 bitcoins.  Python script interperets and sends aproval for .3 btcs worth of sprite.

http://bildr.org/2011/06/arduino-ethernet-pin-control/


Title: Re: Arduino to interface with bitcoind?
Post by: Cryptoman on September 13, 2011, 06:06:44 AM
Do you want to run bitcoind locally or remotely?  If locally, then I'd just use USB to connect the Arduino to the PC running bitcoind and use a python or ruby script to do the interface, as you suggest.  If you need to talk to a remote bitcoind, I'd use a wifi or ethernet shield to obtain your connectivity, then use the json/rpc interface to bitcoind.  There are no ssl libraries for Arduino, but you could put your Arduino addresses in bitcoin.conf to obtain a little security.  You could also run a cron job on the server to forward the balance to another, more secure wallet periodically.  If you are planning to dispense something of relatively low value (less than a few bucks), I wouldn't even bother waiting for confirmations.  As soon as the transaction shows up, you could dispense the soda or whatever.  There is already a json library for Arduino, so the coding should be pretty easy.


Title: Re: Arduino to interface with bitcoind?
Post by: jtimon on September 13, 2011, 04:30:12 PM
I love the idea.
Can a lightweight client run directly on arduino?
If not, probably the cheaper solution would be an android smartphone connected through USB to an ADK board.
There's already small clients for android and (although I know the ADK just from the last google I/O videos) it seems it can talk easily to arduino.
Just an idea to remove the need of an ordinary computer. This could make the machines smaller. You could also take advantage of the touch screen for the user interface.


Title: Re: Arduino to interface with bitcoind?
Post by: ne1 on September 13, 2011, 09:53:35 PM
I posted a project on freelancer.com.  I got one bid so far and responded with this:

Hi. thanks for bidding. Are you familiar with bitcoin. If not check it out at bitcoin.org and weusebitcoins.com
I'm sure you will find it very interesting. If you have any bitcoin related questions I can probably answer. What I'm trying to do is start the open source development of bitcoin <-> arduino communication. Eventually for my purposes, I want to build a fuel pump that accepts bitcoins. So say hypothetically, I have a small gas station with 8 fuel pumps. There is another open source project to give bitcoin a point of sale system.
https://github.com/javgh/greenaddress-pos-tools
http://www.youtube.com/watch?v=o84SfChQ-S8
which could be used. Each pump would have it's own bitcoin address and when a payment is recieved to that address it would send notification to the arduion to dispense a porportianate amount of fuel. I am thinking an arduino with an ethernet shield will be the way to go.
http://bildr.org/2011/06/arduino-ethernet-pin-control/
Anyways the long term goal would be the fuel pump, but the short term is just to send arduino a notification of payment or maybe print "thank you for x btc". interested?

If he's into it, I will accept his bid.


Title: Re: Arduino to interface with bitcoind?
Post by: joeyjoe on September 22, 2011, 01:57:17 PM
Man, this is easy, have the UNO sitting next to me and im bored so I will create a digital bitcoin wallet. Post code and results here. I have the ethernet sheild, so will be using that.

- Will also demonstrate making payments with the device.


Title: Re: Arduino to interface with bitcoind?
Post by: ne1 on September 27, 2011, 03:25:06 PM
Joey Joe,
Glad to see you're into helping.  I've been in touch with Jav, who developed the open source pos.  Like I said before, I'm not much of a programmer.  I'm more of an electronics guy.  I will be sending Jav, a little arduino candybar dispenser soon so we can both play around with the same thing.  I'll keep updating.

-NE1


Title: Re: Arduino to interface with bitcoind?
Post by: joeyjoe on September 28, 2011, 08:06:54 PM
Joey Joe,
Glad to see you're into helping.  I've been in touch with Jav, who developed the open source pos.  Like I said before, I'm not much of a programmer.  I'm more of an electronics guy.  I will be sending Jav, a little arduino candybar dispenser soon so we can both play around with the same thing.  I'll keep updating.

-NE1

It would be hard to run a wallet software on the arduino, but easy enough to have it connect to a server running the software, then veiw balance, transactions etc.


Title: Re: Arduino to interface with bitcoind?
Post by: jtimon on September 29, 2011, 10:42:59 AM
It would be hard to run a wallet software on the arduino, but easy enough to have it connect to a server running the software, then veiw balance, transactions etc.

I'm new to arduino, but I still think that the cheapest solution would be running the wallet in a smartphone connected to the board.
Not sure if google ADK and android can help with this though.

http://developer.android.com/guide/topics/usb/adk.html
http://www.arduino.cc/en/Main/ArduinoBoardADK

Is there a problem with this solution I don't know?
It could be a really cheap POS system.



Title: Re: Arduino to interface with bitcoind?
Post by: jtimon on October 01, 2011, 09:05:06 AM
This could be another alternative to run the wallet in a smartphone instead of a pc:

http://www.mokardu.com/