Raspberry Pi Burstcoin Monitor



  • I wanted to check my balance and the current rate periodically. There was an old raspberry pi 1 which was covered with dust. I decided to make use of it for the Burstcoin. Here is my first burstcoin project with raspberry pi. I used python language for the programming part. 16x2 Display is connected with the I2C module for the communication between the raspberry. Power supply is 5V 0.7A supply. Update: https://bitbucket.org/sleepy1/burst/src

    1_1487784436295_2.jpg

    0_1487784436295_1.jpg



  • main code regarding the project.

    def connect(url,values):
            data = urllib.urlencode(values)
            req = urllib2.Request(url, data)
            try:
                    response = urllib2.urlopen(req)
                    the_page = response.read()
                    final_data = json.loads(the_page)
                    return final_data
            except:
                    return 0
    
    
    def main():
      lcd_init()
      lcd_string("Connecting......",LCD_LINE_1)
    
      while True:
    
            url = 'https://wallet.burst-team.us:8125/burst'
            values = {'requestType' : 'getAccount',
            'account' : 'your numeric account id'}
            data = connect(url,values)
            if(data == 0):
                    lcd_string("Error Network",LCD_LINE_1)
                    time.sleep(10)
                    continue
            balance=float(data['guaranteedBalanceNQT'])/100000000
    
            lcd_string("Bal:"+"{0:.0f}".format(balance)+" BURST",LCD_LINE_1)
    
    #========= Get Burst Rate ===================== 
    
            url = 'https://poloniex.com/public?command=returnTicker'
            values = {}
            data = connect(url,values)
            if(data == 0):
                    lcd_string("Error Network",LCD_LINE_1)
                    time.sleep(10)
                    continue
    
            rate=float(data['BTC_BURST']['highestBid'])
            lcd_string("Rate:"+"{0:.2f}".format(rate*1000000)+" uBTC",LCD_LINE_2)
    
            time.sleep(180)
    

  • admin

    @sleepy Nice work!



  • Yes your a genius



  • Looks sick! Question though what happens when you get too many burst that it doesnt fit on the screen haha? Does it scroll horizontally to then show the balance?



  • @mathew That I did consider, but for now its more than enough for my wallet. Could go upto 999,999 and rate upto 999.99 uBTC



  • @haitch I hope others would also build projects regarding bustcoin.



  • Update on my monitor ,
    Now it can monitor BTC rate and balance in USD
    Display changes every 5 seconds between Burst and USD
    Update data every 3 minutes

    0_1487863547507_11.jpg

    0_1487863556153_22.jpg



  • Here is the update on the code

    def main():
      lcd_init()
      lcd_string("Connecting......",LCD_LINE_1)
    
      while True:
    
            url = 'https://wallet.burst-team.us:8125/burst'
            values = {'requestType' : 'getAccount',
            'account' : 'your numeric account id'}
            data = connect(url,values)
            if(data == 0):
                    lcd_string("Error Network 1",LCD_LINE_1)
                    time.sleep(10)
                    continue
            balance=float(data['guaranteedBalanceNQT'])/100000000
    
    #========= Get Burst Rate ===================== 
    
            url = 'https://poloniex.com/public?command=returnTicker'
            values = {}
            data = connect(url,values)
            if(data == 0):
                    lcd_string("Error Network 2",LCD_LINE_1)
                    time.sleep(10)
                    continue
            burst_btc_rate=float(data['BTC_BURST']['highestBid'])
    
            url='https://api.coindesk.com/v1/bpi/currentprice.json'
            values = {}
            data = connect(url,values)
            if(data == 0):
                    lcd_string("Error Network 3",LCD_LINE_1)
                    time.sleep(10)
                    continue
            usd_btc_rate = float(data["bpi"]["USD"]["rate"].replace(',', ''))
            burst_usd_bal = balance * burst_btc_rate * usd_btc_rate
    
     #display on lcd 
            for x in range(0, 18):
                    lcd_string("Bal:"+"{0:.0f}".format(balance)+" BURST",LCD_LINE_1)
                    lcd_string("Rate:"+"{0:.2f}".format(burst_btc_rate*1000000)+" uBTC",LCD_LINE_2)
                    time.sleep(5)
                    lcd_string("Bal:"+"{0:.3f}".format(burst_usd_bal)+" USD",LCD_LINE_1)
                    lcd_string("BTC:"+"{0:.0f}".format(usd_btc_rate)+" USD",LCD_LINE_2)
                    time.sleep(5)
    
    


  • If someone has suggestions or ideas let me know, I'll try to make it.



  • Thanks for sharing this! I've been looking for a new project with my pi I might just have to give this a try!



  • I recommend you create a project on GitHub or BitBucket or the likes where you can gain control of source code version and share your project easily. Who knows you might see some really cool forks.

    -IceBurst



  • @IceBurst Thanks for info. I just uploaded to bitbucket , here is the link https://bitbucket.org/sleepy1/burst/src.



  • @Yottaphat you are welcome. All you need is a raspberry pi and a lcd with i2c module



  • @sleepy , how do you run the code? Do you run it into Raspbian, via terminal?

    This project is marvellous, I'll buy a Raspberry Pi just for it!



  • @Egidius actually I put is so that after boot up it automatically runs it, no need of a terminal after configuring.



  • First of all congrats on a nice project.
    Since you have asked if anyone has any other suggestions, have you thought about making a miner for the RPI?
    The RPI3 is a relatively strong machine and I think it would def be up to the job of mining burst.
    Only problem is I lack the programming skills to come up with something myself :-(
    Is there any way of porting one of the already up and running miners?



  • @machasm Someone suggested to install Android image on the RPI and mine.



  • @rnahlawi
    Thanks. Don't suppose you have a link?



  • @machasm https://rtandroid.embedded.rwth-aachen.de/downloads/raspberry-pi/
    I didn't try it at all, my Pi's are running Burst Local Wallets with Kodi and I didn't want to disturb :)


Log in to reply
 

Looks like your connection to Burst - Efficient HDD Mining was lost, please wait while we try to reconnect.