DEV Community

Michael Scharl
Michael Scharl

Posted on • Edited on

I wrote my first MagicMirror² Module

I heard about MagicMirror a while ago. I always wanted to build one myself but like all of my side projects it got swallowed by everything more important than a mirror that tells me I look pretty. I then didn't think about it for a long time. But I've got some spare time lately and the idea popped back into my head. I started looking into the repo and documentation because I was curios how it evolved. And then I found the list of 3rd party modules. I scrolled through it and was blown away by the amount of different tools the community created. It's amazing to see a lot of useful, funny or even trivial modules and keeping in mind that there is at least one person using it on his or her mirror.

So I thought the best way to start this Project is to create my own first module. Since i recently had a lot of troubles with my internet connection due to the fact that my provider was bought and I was switched to the new Providers network, I decided to create a module that show the current bandwidth throughput on my router. I also find it somewhat amusing to watch those numbers while someone at home is browsing the web or watching Netflix.

At first I had to find out how to fetch those numbers from my Ubiquity EdgeRouter. It took me some time but in the end it wasn't that hard to do via the command line interface. I then started reading the MagicMirror documentation and developing the module. While I did not expect it to be difficult, it was even easier than I thought. Kudos to Michael Teeuw (creator of the MagicMirror) for creating this awesome Platform! I can only recommend checking it out yourself.

I plan on writing a little more in-depth post on how I created the module. I even created a second one while writing this post. Until then you can checkout the code itself.

GitHub logo mscharl / MMM-edgerouter-throughput

A MagicMirror² Module to show the Interface throughput of an Ubiquity EdgeRouter

EdgeRouter Throughput

A MagicMirror² Module to show the interface throughput of an Ubiquity EdgeRouter.

The Module uses SSH to connect to the router and reads the network throughput from /sbin/ifstat.

Example of the Module

Installation

  1. Clone the Repo into your MagicMirror modules folder git clone git@github.com:mscharl/MMM-edgerouter-throughput.git
  2. Install some node dependencies cd MMM-edgerouter-throughput && npm install --production
  3. Configure and enjoy

Configuration

Property Type Required Default Description
gateway string ✔︎ The IP Address of your EdgeRouter
username string ✔︎ The username of your EdgeRouter with SSH access.
password string ✔︎ The password of your EdgeRouter with SSH access.
interface string ✔︎ The interface to display on the mirror.
title string undefined An optional title to display on the mirror.
showInterfaceName boolean false Whether to show the name of the interface or not.

Compatibility

I developed this module based on my EdgeRouter X with nothing additionally installed.

I can't guarantee that it will work on other…

Top comments (0)