Grafana and Influx – Infrastructure Engineers Language

No Comments

If you want to understand what Infra engineer speaks and use a tool provided by them you need to have some exposure to the tool itself, you don’t have to be an expert.

 

Monitoring systems that I see nowadays are mostly centric around Prometheus while the Database used for storing any time-series events is InfluxDB. How do you actually map beautifully, its via Grafana

Grafana – https://grafana.com/

Influxdb – https://www.influxdata.com/

Prometheus – https://prometheus.io/

Now the problem here is that many tools are programmed on a daily basis, from a Network Engineer point of view I understood a few things. 

Not everything you need to know the end to end like an Expert for that tool and some choices is purely based on Cost than anything else. 

How would you really understand this? I set up a BME680 sensor in my home and will precisely use Grafana and Influx to map the recordings

Tools Used 

https://learn.adafruit.com/adafruit-bme680-humidity-temperature-barometic-pressure-voc-gas

Raspberry Pi 3

Docker Images – Grafana and Influx

Sample Influx Script – https://github.com/yukthr/auts/blob/master/random_programs/influx-test.py

And finally Beautiful Grafana

All of this is open source and are not hard after the invent of Docker. Give it a try so that we ultimately understand networks in a better way.

 

-Rakesh

 

 

Alexa , AWS Lambda & AWS IOT MQTT and you can interact with anything

No Comments

I hear a lot on IOT but don’t have a clue on underlying protocols. My interest is only to understand how it might help a business or more than that my personal interests. So continuing the server power on/off series I wanted to do it with Amazon echo voice command. Now, this is not a smart power switch where you can power-on with a command on Echo but you actually have to send a message to IDRAC, we already covered this in a previous post.

Well, the main goal isn’t to power-on a server that can be done manually as it sits beside me, the main goal is to extend this to any business / personal ideas which might get the benefit.

Summary – Develop a small interactive model to understand Alexa voice service / AWS lambda and MQTT so that we can get a feel of what can be achieved with this.

I will not go much into any tech explanations or bore you with English, I will put here two screenshots and code to git, hopefully, you should be able to give it a try.

 

Its illustrated in 6 steps

  1. Voice command to echo (I have made developer skill on developer Alexa portal – Its free and its easy. Lot of blueprints)
  2. Alexa portal interacts with AWS Lambda (serverless)
  3. AWS Lambda communicates the message in JSON format to AWS IOT
  4. Raspberry PI listens to a particular MQTT channel for the type of message
  5. Depending on the incoming message JSON, Raspberry pi Matches the string and invokes the further script.

 

 

 

Code to Git link

https://github.com/yukthr/auts/tree/master/random_programs/alexa

-Rakesh

Docker and Netdata – Awesome for Monitoring our home servers !

No Comments

I don’t belong to any DevOps space but I keep hearing things like Docker / kubernetes and what not. I Quickly wanted to see what these are capable of and if I can use them to my advantage so that later I can see the use case for networking.

Docker so far seems to be far more capable and am enjoying it. Thanks to one of my friends who suggested this wonderful Repo, monitoring my server has been more granular.

I will have a detailed post on Juniper MX image via docker but for now, I have used it for something out of networking space to serve a small purpose.

https://github.com/netdata/netdata

This what Netdata UI looks like while monitoring my server, this is really wonderful as for the long time  I was trying to implement many Monitoring systems and most of them required some dedicated hardware or at least a Vmware spin-off instance, which is fine for me I suppose but I wanted something small and yet effective.

Netdata operates on port 19999 of localhost and should be reachable via any web-browser.

I made a small cronjob which starts this instance on every reboot.

Installation is pretty straight forward, you have to install docker and follow the below guide

https://github.com/netdata/netdata/tree/master/packaging/docker#install-netdata-with-docker

Note: For some reason, I was not able to install netdata using default installation process and Irony is that it only worked through docker which I wanted to explore.

 

-Rakesh

Working with distance sensor – solving overhead water tank problem

2 Comments

This is not a networking post.

Schematic , sensor code and spec  – https://www.linuxnorth.org/raspi-sump

My code – https://github.com/yukthr/auts/blob/master/random_programs/water_sensor.py

1x Breadboard

1x Raspberry pi zero w

1xhcsr04 ultrasonic sensor

2x1kohm resistors

 

Just as a side note i do not have any intro into resistors nor electronics, but what all i did was to follow some posts written by people who already did it, its not hard believe me, if i could do it any one should easily be able to do it as am very far away from electronics and programming, so let these things not overwhelm you.

 

Problem – Am not sure in other parts of the world, but place I live has an over head water Tank which stores water. So every day you technically turn on a water motor which sucks water from a reserve under the ground and pumps it to all the the way to a three store high building

So what’s the issue – The issue is that we have no clue what’s the current water level in the tank nor how long would it take to fill the water tank. There are two tribal ways by which we are addressing the problem

1- go to three stores high and sit beside the tank till it gets filled

2- let it overflow and we will know

The post aims to give an idea on a problem am no close to a professional in any of electronics nor coding but I can make it work for my self

Example of a water tank

 

So, using a raspberry pi zero , a ultrasonic sensor and telegram app did solve the issue, obviously this requires wooden finish and water proofing which is currently taken care by a plastic container.

Raspberry pie zero takes unbelievably low power and even during power outages single power bank could charge it for 40 odd hours

 

Final output – Sends a message directly to Telegram BOT

 

-Rakesh

Sonoff Flashing and steps towards Smart home

No Comments

This post is no way related to Networking ! 😉

It’s always my fascination to implement a specific tech towards home automation so as to have more time in hands. The first step towards this was to use a Tp-link smart switch which came with Alexa, now problem with that is that Tplink app was not properly responding to Alexa and TP-Link smart switch in itself was costly.

I wanted something low-cost, something which I can experiment yet be cost effective, After some re-search I came across Sonoff-Basic model.

https://sonoff.itead.cc/en/products/sonoff/sonoff-basic

I integrated with Amazon echo but again there were app issues (default app is ewelink), though it was working fine something was missing, I couldn’t tinker it to my wish

I found then there is a open-source version of a similar firmware called TASMOTA and we have to flash this sonoff with the new firm-ware of Tasmota, I have to tell you here there is every possibility you would brick your device and make it useless in the process.

https://github.com/arendst/Sonoff-Tasmota/wiki/Prerequisite

Everything is so well documented, there is no need to re-iterate things here, but just to show case another successful implementation.

Need-less to say you are playing with AC/DC electrical power so take all the precautions as necessary and follow the blog articles in official tasmota page, this article does no job in listing out any implementations of flashing the device

Requirements – Though not listed in scree-shots

1- basic solder guns

2-solder pins

3.Raspberry pi (you can also do it with Serial USB but i used Rasepberry pi)

 

 

  1. Open the Sonoff basic cover

2. Connect these to sonoff switch and Raspberry pi as instructed in the wiki

This is how connection would look like

Connect to Raspberry pi

Flashing Sonoff , this is the tricky part, if possible get a second pair of hands.

New firmware would take off, Sonoff would boot in an AP mode so the wireless SSID SONOFF_X will be seen in your wireless connections, connect to it and you should be able to configure the device and configure the wireless parameters

 

You can configure MQTT topic subscription or just ask sonoff to emulate Wemo switch so that it can be used with a Smart home skill like YETI in Amazon echo (alexa)

I have cut a spike cable, connected sonoff. Spike connects to entertainment system which can be programmed to switchoff after a particular time in night or invoke it with voice commands from echo.

This is some start towards affordable home automation, I will post more about PIR sensors which i have been using and other details as time permits. Hass.io is looking promising and should be a good start as well.

-Rakesh

Close Bitnami banner
Bitnami