Covid-19 patient monitoring using Raspberry Pi

Image Source: CBC Canada

A team from the University of Toronto has created a new way for health-care workers to monitor COVID-19 patients — without having to set foot in their hospital rooms.

The university got a call from Mount Sinai hospital with a requirement to figure out a way to monitor vital signs both continuously and remotely.

The students developed a raspberry pi based continuous remote monitoring system for monitoring the status of the patients without the direct intervention of the nurses.

They attached a standard fingertip probe, already in use in hospitals to monitor vital signs, to a “very, very small computer about the size of a credit card,”

That simple computer, called a Raspberry Pi, can then connect to the internet — allowing health-care workers to check on patients from any nursing station computer, or on their smartphone.

The concept is very simple, the finger clip monitors the respiratory status of the COVID-19 patients. The clip detects the light absorbed by the patient’s blood. The colour vary depending upon the oxygen level in the blood and this is the key factor to monitor. This data will be captured from the finger clip by the Raspberry pi and it gets transmitted to the devices in the nursing station.

The prototype was successful based on several trial deployments made in the Mount Sinai hospital.

References:

https://www.cbc.ca/news/canada/toronto/u-of-t-covid-19-monitoring-system-1.5540089

University of Toronto supports COVID-19 patient monitoring with Raspberry Pi

 

 

VPN installation in Raspberry Pi

What is a VPN ?

VPN stands for Virtual Private Network. VPN extends the private network to external networks so that the users can securely interact with the systems within the private network. I will write another post with the complete details of VPN. We will be concentrating on the installation of VPN in raspberry pi in this post.

VPN is a very important requirement for every enterprises. Now a days even individual started using VPN. It is very easy to configure a VPN. Most of the large enterprises use paid VPN services. There are so many VPN service providers available in the market.

This post is about setting up a free VPN service. This can be used in small or medium scale businesses or for your personal purpose as well. I am using this VPN service from the past several years and it worked very well without any issues.

Installation of VPN in raspberry Pi

raspberrypi

I have used raspberry Pi for the installation of OpenVpn. The simplest way to install and configure VPN is raspberry Pi is using Pi-VPN. PiVPN supports two VPN backends

  • OpenVPN
  • WireGuard

While doing the installation, it asks for the user to select the preference and it installs accordingly. OpenVPN can be operated in TCP and UDP. I have used both of these protocols. From my personal experience, the best performing and stable one is UDP.

The only advantage with TCP is that we can run Open VPN in TCP port 443 and it bypasses almost all firewalls in external network. The TCP port 443 is globally open for HTTPS. So we can easily access the VPN using the same port. In this way we will not have to request for additional exceptions in the firewall to enable the VPN access.

WireGuard is a new VPN protocol. It uses a completely new protocol as compared to Open VPN. It is fast and secure. This is under development. Currently if you look at the installations, the majority share goes to Open VPN. This is mainly because it was there in the industry from several years and it already proved its capability. WireGuard will be up in the market soon.

More details about the configuration of PiVPN is described in the following URLs.

  1. PiVPN installation
  2. Additional Reference

Integration with Network

The integration is very easy. In two steps we can integrate the VPN.

  • Connect the raspberry Pi to your network using an ethernet cable
  • Create a rule in your firewall or router to allow the traffic from outside to the raspberry Pi through a NAT rule. (Create a port forwarding rule to route the requests from outside to the raspberry Pi connected to the internal network.)

Role of Automation & AI in the modern Agriculture

Food is one of the fundamental need of any living organism. For humans in the current age, food is something that has to be purchased from the shops. Once humans became civilized, the freely available food became a commodity product. The idea behind work and salary was all for food in the earlier ages. Later it was for food, medicine and shelter. Now the priorities has changed and we all are running behind the fast moving world.

Now everyone are busy. Getting clean & good food is very difficult.

  • Vegetables are full of pesticides & chemicals
  • Meat is poisonous with antibiotics
  • Rice & grains contains harmful chemicals. People even uses plastic like materials for manufacturing similar materials
  • Water and water bodies are polluted
  • Air is polluted
  • Soil is polluted

Everything is polluted….!!!

In general, the food that we eat is not good for health and it may even take our life. What is the solution ?.

People including me are busy with their work and they don’t have time to do any cultivation. I came from an agricultural background and I have farm lands also. But now everything is unused. Now the food production is getting reduced drastically. It is basically because of the following reasons.

  • The cost of farming is high.
  • No steady income.
  • Lack of stability in the price of agricultural products and market.
  • The major share goes to the middle man
  • High labour cost. Most of the conventional farming needs more man power and the cost of man power is more in the current society.
  • Poor social status.
  • Dependency on climate and the sudden climatic changes.

Because of all these factors new generation is not even thinking about agriculture. I also moved away from agriculture because of all these factors.

Currently I stay in an apartment surrounded by farm lands. When I observed the cultivation process and the deadly harmful pesticides that they use, I got shocked. None of these vegetables are in an eatable condition. I started thinking and researching about the ways to control this.

One of the images that made me re-thing is shared below. The picture shows two oxen with their mouths masked. The reason for the mask is to avoid them eating the cabbage leaves in the farmland while ploughing the fields. Those cabbages were sprayed with highly poisonous chemicals.

pesticide_image

One of my goals in this year is to start an organic farm. Automation is required to improve the efficiency and reduce the human effort. Now my blog posts will include the updates and progress about my organic farm and my learning.

Making hive usable to multiple users in a hadoop cluster.

By default, hive operations are limited to the superuser. If you are using cdh, then the superuser is hdfs.
The reason for this is because of the permission of hive warehouse directory.
By default the read/permission of this directory is given only to the superuser.
So if we want to use hive from multiple users, change the permission of this directory accordingly.
If you want to make hive usable by all users, then do the following command.

hadoop fs –chmod –R 777 /user/hive/warehouse

hadoop fs –chmod –R 777 /tmp

If you group the users in specific groups, then you can do this by giving read/write permission to group only. ie 775

Setting Up Multiple Users in Hadoop Clusters

 

 Need for multiple users

In hadoop we run different tasks and store data in  HDFS.

If several users are doing tasks using the same user account, it will be difficult to trace the jobs and track the tasks/defects done by each user.

Also the other issue is with the security.

If all are given the same user account, all users will have the same privilege and all can access everyone’s  data, can modify it, can perform execution, can delete it also.

This is a very serious issue.

For this we need to create multiple user accounts.

Benefits of Creating multiple users

1)      The directories/files of other users cannot be modified by a user.

2)      Other users cannot add new files to a user’s directory.

3)      Other users cannot perform any tasks (mapreduce etc) on a user’s files.

In short data is safe and is accessible only to the assigned user and the superuser.

Steps for setting up multiple User accounts

For adding new user capable of performing hadoop operations, do the following steps.

Step 1

Creating a New User

For Ubuntu

sudo  adduser  --ingroup   <groupname>   <username>

For RedHat variants

useradd  -g <groupname>   <username>

passwd <username>

Then enter the user details and password.

Step 2

we need to change the permission of a directory in HDFS where hadoop stores its temporary data.

Open the core-site.xml file

Find the value of hadoop.tmp.dir.

In my core-site.xml, it is /app/hadoop/tmp. In the proceeding steps, I will be using /app/hadoop/tmp as my directory for storing hadoop data ( ie value of hadoop.tmp.dir).

Then from the superuser account do the following step.

hadoop fs –chmod -R  1777 /app/hadoop/tmp/mapred/staging

Step 3

The next step is to give write permission to our user group on hadoop.tmp.dir (here /app/hadoop/tmp. Open core-site.xml to get the path for hadoop.tmp.dir). This should be done only in the machine(node) where the new user is added.

chmod 777 /app/hadoop/tmp

Step 4

The next step is to create a directory structure in HDFS for the new user.

For that from the superuser, create a directory structure.

Eg: hadoop  fs –mkdir /user/username/

Step 5

With this we will not be able to run mapreduce programs, because the ownership of the newly created directory structure is with superuser. So change the ownership of newly created directory in HDFS  to the new user.

hadoop  fs –chown –R username:groupname   <directory to access in HDFS>

Eg: hadoop fs –chown –R username:groupname  /user/username/

Step 6

login as the new user and perform hadoop jobs..

su  – username

Note: Run hadoop tasks in the assigned hdfs paths directory only ie /user/username.
Enjoy…. 🙂