After I completed the python-version of LED notification which mimic the LED notification script of SteemPi, I started to work on the eSteem-style notification for Raspbian. That's what I just completed and put on Github.
It makes use of the Piston-Steem python library for capturing of Steemit events. The module will check if the events were related to the user. If yes, extract event information, check if it is an upvote or a comment. Should it be either of them, display the information on the event on the 20x4 LCD.
Currently, I am using the RPLCD python library to drive LCD. It supports both Python2 and Python3. This is important as the Piston-Steem library requires Python3, Therefore, support of python3 in RPLCD makes life much easier.
Tutorial on how to install required libraries csn be found here: A Guide to Setup Raspberry Pi based Steemit Notification Module
How the module works
Basically, it monitors the STEEM Blockchain, when there is any activities on the user's account, it will grab it, check if it is an upvote or a comment. If yes, it will blink the LED as well as display upvote or comment information on the 20x4 LCD. Like this:
Here is the notification module on Github. Feel free to down it and play with it. Anyway suggestion and comments are welcomed!
from piston.steem import Steem
from piston.account import Account
from RPLCD.i2c import CharLCD
import time
import RPi.GPIO as GPIO
import sys
# initialize Steem
account_name = 'guyverckw'
account = Account(account_name)
steem = Steem()
# initialize LCD
lcd = CharLCD('PCF8574', 0x3f)
# Clear LCD
print('Clear LCD')
# Prepare LED indicator
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT, initial=GPIO.LOW)
# Set user account, no. of history retrieve everytime, transaction ID buffer array of 10
first = 9999999999limit = 5
History = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
History_ID = 1.0
message = ' '
# keep checking transactions
while True:
index = 0
print (History, History_ID)
# Get last 5 history, put ID into buffer array
for his in account.rawhistory(first, limit):
if History_ID == his[0]:
break
print('History ID: %d10.0' % History_ID)
print(his[1]['op'])
if his[1]['op'][0] == 'comment':
message = 'There is a comment from @' + his[1]['op'][1]['author']
elif his[1]['op'][0] == 'vote':
if his[1]['op'][1]['author'] == account_name:
message = 'There is a vote from @' + his[1]['op'][1]['voter'] + ' of ' + str(his[1]['op'][1]['weight']/100) +'%'
else:
History[index] = his[0]
index += 1
continue
History[index] = his[0]
index += 1
print (message)
GPIO.output(11, GPIO.HIGH) lcd.clear()
lcd.write_string(message) time.sleep(1)
GPIO.output(11, GPIO.LOW)
History_ID = History[0]
Roadmap
I am going to expand the devices supported to a few more LCD and LED devices. This would allow users to use it on different hardware application (with different form factor HW designs).
I will in parallel to work on an integration of the module with SteemPi.
Stay tuned!
Posted on Utopian.io - Rewarding Open Source Contributors
Wow amazing. I gonna need to get me one of those rasberry pi's. This is just to nice!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey that's cool. I was just thinking the other day of starting that "Magic Mirror" project for the pi. Implementing this would be a cool feature!
On that note! I've had a couple beers at this point, and am new to the platform. Is there a way to bookmark or favorite posts so I can come back to this?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
magic mirror project sound cool too.
I don't know a very good "Bookmark" feature, I just put on comments so that I can search my comment to get back to that post.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Ah good call! I guess it's pretty easy to scan through a comment history.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
couple of typo:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Githut >>> Github
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Vying for spellchecker championship. :-)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You have to give me credit for trying! 😉
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
We all must try😎
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Corrected, thanks a lot.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You're welcome
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have a raspberry pi laying around, now I know what to do with it. My python's a bit rusty but I'll give it a shot!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
some days start my new language python, The invention of LED lights is very good. Now I will try. thanks for sharing
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
wow that's going to be cool never missing an update again :D
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great work ...adding alot to steemit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the contribution. It has been approved. That's a great work, bdw I checked the code and find out there is no error handling done. So are you planning to handle the error because if the error happens it will stop, you need to start all over again.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for reminding, will add error handling in later.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
wow amazing post really..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
it will be such an amazing project! all the best..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow a nice steem post.....
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @guyverckw I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This is awesome. I'm interested in raspberry pi and I want to make a bot like this. My idea is different with this. But this will be a good guide for me. Thanks. :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
haha I don't get everything you say but still I like the project!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
interesting this is but i have not much how to implement it lolzzz
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
that's cool....nice steem post.....
very helpful
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice steem post......
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice article
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
good post..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I always upvote and resteem your post please give me your huge part of vote
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
really like your post...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @guyverckw! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
You published a post every day of the week
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great works and good update
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit