Raspberry PI LED-API

Categories AWS, Docker, IoT, Raspberry Pi

I received a very fortunate gift recently a B1248 LED badge. The led badge came with support software that ran only on windows and worked fairly well. However, given my love for engineering, I began to look around for ways to program it and gain complete control over it. I stumbled upon a fantastic library. This worked almost completely out of the box on my Raspberry Pi 3. However merely implementing something someone else has developed is more of an operations task. Me being on the development side of things thought of ways to improve it and I came up with this.

Solution Architecture for the LED-Api
Solution Architecture for the LED-Api

I build a simple flask app around it and gave it a REST interface. Sample code for which can be found here. I am always open to pull requests and public contributions. However, building a REST API wasn’t enough for me so I went ahead and ‘Containerized’ the app meaning that we would have to ironically use ‘-v’ during ‘docker run’ to mount a port. This REST API can be used to transmit very useful and critical information such as the example given below.

Public Service Anouncement
Public Service Anouncement

The original idea was to monitor all my VPS’s and check for downtime. However the library I use doesn’t support multi line text, which makes it not very useful to have lots of text in a marquee. It would also be really nice if this could show the current response time for all my API’s.

Scope for improvement:

  • Figure out multi-line text.
  • Separate the 2 processes into their own microservices.
  • Implement a queueing mechanism such as Kafka or RabbitMQ to read from MySql.
  • Further Extend the API to show either weather information or trending #tags.

8 Comments

  • Jack
    November 20, 2016

    Hi would you mind sharing which blog platform you’re working with?
    I’m going to start my own blog in the near future but I’m having a difficult time choosing between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m looking for something unique.
    P.S My apologies for getting off-topic but I had to ask!

    • Agrim
      November 21, 2016

      Hi Jack,
      This blog lives inside a docker container and is running WordPress using the `Hacker` theme with a lot of useful plugins for code highlighting.

  • Kristen
    November 24, 2016

    I’ve been browsing on-line more than 3 hours today, but I never found any interesting article like yours.
    It is pretty price sufficient for me. In my opinion, if all
    website owners and bloggers made good content material as you probably did, the web
    will likely be much more helpful than ever before.

  • broderie
    September 18, 2017

    Amazing! This blog looks exactly like my
    old one! It’s on a entirely different topic
    but it has pretty much the same layout and design. Great choice of colors!

  • Iron ThundeR
    January 2, 2019

    Can I simply just say what a relief to discover somebody who actually understands what they’re talking about on the
    internet. You definitely understand how to bring an issue to light and make it important.
    More and more people should read this and understand this side of your story.
    It’s surprising you are not more popular given that you definitely
    possess the gift.

  • How to Train Your Dragon 3 123 Movies
    January 5, 2019

    Hi there this is somewhat of off topic but I was
    wondering if blogs use WYSIWYG editors or
    if you have to manually code with HTML. I’m starting a blog soon but
    have no coding knowledge so I wanted to get guidance from someone
    with experience. Any help would be enormously appreciated!

  • Eunice
    July 17, 2019

    An outstanding share! I have just forwarded this onto a colleague who was conducting a little homework on this.
    And he actually bought me breakfast simply because
    I found it for him… lol. So let me reword
    this…. Thanks for the meal!! But yeah, thanks for spending the time to discuss this subject here
    on your web site.

  • where can I buy delta 8
    June 29, 2021

    Thanks for the blog.Thanks Again. Fantastic.

Leave a Reply

Your email address will not be published. Required fields are marked *