Home

Telnyx api/sms saves my plants! Every single time.

2 Comments

When its a holiday, I do some house-hold farming, mostly into Hydroponics which is based on water and associated nutrients and does not require soil as a medium.

Let me show an example.

As you can see, Plant drinks up water, and the one which you are seeing is lemon plant from its seed stage, Monitoring water level is extremely important and for me there are many more in home so cant be keeping track of everything.

So sensor gets the data, Raspberry Pi talks to AWS IOT securely since Microcontrollers are still a pain to handle SSL and Rpi makes it easy and after processing MQTT message AWS IOT will process based on the Rules, in our case if the treshold is below 500 then plant is drying up.

Why Not Inbuilt SES/SMS with AWS ?

SES works great but I check my emails only once in two days and there is no way to alert based on the email, SMS I wanted to used multiple number pool (thinking to expand) and Cost with Telnyx is Really Amazing to do any Communication services

I have tried other vendors and results are not great either my carrier has some integration problems or whatever SMS never reaches to my mobile while I get charged, the two reliable ones are Telnyx and Amazon depending on your cost/integration and ease of use.

Telnyx API is just 4 lines and you can pretty much integrate it with non AWS application as well. Check out this

Api is amazingly easy – https://developers.telnyx.com/docs/v1/messaging

Look at the code

https://github.com/yukthr/auts/blob/master/random_programs/sendsms.py

Overall, this has been working fine for me for some while now

If you need to know more about Telnyx and Services

Amazon components

Future idea is to integrate some AI/ML and predict. This has been a fun project and can be extended to other domains as time permits.

Ostinato – Packet Generator – Test your broadcast and mitigation strategies

Leave a comment

I used ostinato long before when it was in early stages probably, at that point I never had any real need to use a packet generator as the place I was working was already equipped with IXIA and Spirant best in Class Packet generators.

https://ostinato.org/ – is the link

Whats the use case – Well I wanted to test LSP loadbalancing and also specific scenario of BUM traffic and how well it can be contained lets say in Switching level QFX and also VPLS level

Its doing a good job, though it started as open source, author now sells it with some minimal fee to keep up with the development costs.

You could also use scapy and i wrote a small program to do this , problem is scapy sorts of waits for some of the responses and i have not yet figured out what needs to be solved there

Testing Ostinato on QFX and its really good so far. Storm control got in and stopped transmitting any packets through the interface.

At the end, this is a nice to have tool for any sort of packet crafting and limited scale testing for proof of concept scenarios.

-Rakesh

Lora – Test and results – awesome

Leave a comment

What is LORA – Best reference – https://www.thethingsnetwork.org

I will anyways attempt to define this as a newbie who just got into this technology

with the help of a specific Receiver and Transmitter and using Radio waves you can send small bits of information to long ranges without the need of repeaters or wireless IP networking gear. “

Why is this useful – I have many use cases simple one being measuring soil moisture for plants and measuring water level in an overhead tank.

I currently have a very expensive setup of a Raspberry Pi zero wireless, a Repeater to repeat my Base Ip Network and a solar panel to power the power-hungry sensor as Raspberry pi does not know how to go into Deepsleep and wakeup.

Lora Makes it simple and even in reasonable living space, wireless routers do not perform well to cover the range up till the back yard garden.

What do you need – Listed in the below article and its nicely written

Most of the Sample Code – https://randomnerdtutorials.com/ttgo-lora32-sx1276-arduino-ide/

I have tested its range till 300m without any issues at all, that’s like 4 times what my wireless router can do!

LORA Receiver
LORA Sender
3D printer printing LORA cover.
some reference notes

Project from here on will be very simple, use one AWS GreenGrass Node to publish all the values to AWS SNS system, involve Lambda to Trigger some alerts, Have a nice time series like Influxdb doing Time Series representation and Grafana to dashboarding.

I will try to do a prototype of hardware and software in coming months and I hope it helps anyone in the farming field.

-Rakesh

Dyndns and Openvpn – Remote Management

Leave a comment

Please no Team viewer or crappy neverheard-vpn discounted services ! It wont work on my headless Raspberry Pi’s and lot of clutter to manage.

I have visited my home and was doing some hobby IT setup with Raspberry Pi’s, the problem is that i had problems many times accessing my home PC in another Remote Location due to many reasons, lets say crappy ISP. I contacted my ISP and they said I need to take a static IP and also pay for opening up two non standard ports. Its like you pay to get tortured and then additional headache of Port forwarding.

To add more to the pain, the IP that i get from my upstream provider is a Private IP, wow I havent seen that for a while. Anyways, to get around this I was thinking about using OPENVPN as a solution along with Dyndns.

Now, setup is very simple

Clint-pc (Location 1) ———-AWS(OPENVPN)————Client-pc (Location 2)

Why AWS -> Accessible and Cost

Problem is changing IP, I dont have any business requirement or criticality to buy a Elastic IP , but whole point will be lost if my clients wont know what to access, worse I will never have access to location-2 if am in location-1 to change IP Addresses

I have mapped OPENVPN with dyndns script.

https://help.dyn.com/ddclient/

This really solved most of the problem, but should i be running AWS t3 instances for 24×7 which will cost me more for not using the service at all. Hence Dyndns will solve the IP-Domain name lookup without needing an Elastic IP.

Rest of the configuration from client side is

There is a little knob which will enable communication between the VPN hosts, which you have to enable

The final problem is that what if i stop the server and when i start how do i ensure Clients connect back automatically

Two instances

  • When Client Reboots – A Reboot cron to automatically connect to the DNS url
  • When Server stops / starts / reboots – A retry from Client endlessly to connect to VPN.

-Rakesh

Editing Files in a Docker Container

Leave a comment

This is the quick and easy way I learned to edit some files within a Docker container. Professional DevOps engineers might be doing it in a different way, this is the network engineers way of doing things 😉

 

 

-Rakesh

Pomodoro Timer with Esp8266 ,micropython and slack – a small weekend project

Leave a comment

 

Hi All,

Pomodoro technique is really effective, more than the technique it’s more or less like a good stress buster to me.

https://en.wikipedia.org/wiki/Pomodoro_Technique

There are few problems with the timer management

1.  It’s impractical for me to manually add 25-minute timer every time

2. I can do a small script but again my computer should always be on

3. Use some app or use a timer with sound (both of them are really disturbing for myself and also colleagues around me)

What did I use

  1. With anything involving DIY/IoT, there are two important aspects – It should be small and portable and secondly, cost should below.

Components Used :

  1. ESP8266
  2. 0.96Inch 128×64 OLED display (Pictures below)
  3. Micropython ( I could have gone with C++ but honestly I don’t know the language, hence I had to go through a lot of pain to make it work in microphone)
  4. Slack for daytime notifications about timer stages

Challenges :

  1. How do I make sure I don’t look at the clock every 25 minutes? Sound is not an option, so I used a slack webhook to notify me
  2. Code was big and hence there were memory allocation issues in micro-controller, used mpy_cross to compile code and transport to micropython (http://docs.micropython.org/en/latest/index.html)
  3. Overall project cost – Less than 3.5 USD

code used :

https://github.com/yukthr/auts/tree/master/pomodoro_esp8266

 

For every 25 Mins, it would indicate a 5-minute non-compulsive break and after 2.5 Hours a compulsive break of 15 minutes. It’s understandable that in our nature of work we might be in a call or meeting or a code review, but just a small a non-compulsive reminder that we have a 5m break for hydration or fresh air does really improve thought process and most importantly is a de-stressor.

 

 

-Rakesh

Grafana and Influx – Infrastructure Engineers Language

Leave a comment

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

 

 

Older Entries