Hand tools and fabrication machines

Story

Follow my paws:

If you have a dog, cat or any pet that needs to go into a kennel when travelling, and be left in the hands of parcel services, you know how stressfull and problematic it is for your precious friends.

The main problem thus is: The horrid care pets get when they are transported in parcel services.

Sometimes we need to send pets with parcel services. How can we be sure they're fine at all times? Take into consideration how baggage is treated.

Always use technology to improve the world, if you are a black hat or gray hat hacker please abstain at this point......... or at least leave your star to make me feel less guilty XP.

Solution:

I will make an integral IoT solution to monitor the pet’s environment, in order to ensure their well-being throughout their journey. All this also integrated with a cloud platform which, in addition to showing the status of the package in real time, also sends notifications at the frequency that is convenient.

The current monitoring solutions are restricted to only lifeless packages, this making the continuous monitoring of pets a novelty. It is useful because thanks to this system pet owners can be 100% sure that their pets will be well and can monitor and follow them throughout their journey.

Soracom Platform Setup:

It is very important to check that your SIM card is already attached to a group, in my case I call it Harvest Group.

In the case that we do not have a group created, we will create one as shown in the image below, if we do not do this we will not be able to perform the AWS IoT configuration.

Since the group was created, in my case we entered the group menu by pressing "Harvest Group" and once inside we will see the following.

Within the group menu we will enter the option "SORACOM Funnel", this option will allow us to access the connectivity with the services of AWS, all the credentials will be obtained later in the AWS configuration, so do not close this tab (Please follow).

AWS IoT Setup

To communicate with AWS IoT we need to create a role in the IAM console in order to authorize Soracom access to our console.

The first step is to create a role that allows us to communicate with AWS.

Within the role configuration we need to grant access to AWS IoT.

Here we can see the services that we can use with this role, in this case this policy is just an example. Note: If you doubt which policy to grab the role, choose the policy (AWSIoTFullAccess).

We put the name we want to the new role.

We enter the AWS IoT console and go to the "Settings" section.

Once in the "Settings" section we will copy the "Endpoint", this will be used in the Soracom console tab.

The next step will be to create the connection between AWS IoT and the other AWS services such as Lambda, SNS and DynamoDB. So for that we will have to create a "Rule" which will serve to generate a bridge between this service and the aforementioned services.

Once we have our rule, we will configure it as shown in the image.

Already in this tab we will configure what lambda we want to be activated once a data arrives (not close until we finish configuring the other services)

AWS Lambda Setup

We create a Lambda as shown on the screen (it is quite intuitive, should not have problems).

The lambda should be seen in this way, the reason for using a lambda would be because we need to process the data obtained from the module to give a response with a message and our web platform (do this process 2 times because we are going to configure 2 lambdas for connect to the services of SNS and DynamoDB)

First Lambda SNS Service:

This is the code to send a notification to SNS, the TopicARN will be obtained later in the SNS configuration.

AWS SNS Setup:

Since we create the topic we can create subscriptions where we want the notification to arrive.

This is an example of all sides that we can send notifications.

Save this ARN for your First Lambda:

AWS DynamoDB Setup:

For this project and for our web implementation, we will need 2 tables created in DynamoDB, since one we will use as data storage and another we will use it for temporary variables that we can use in the WEB platform.

For this step, only two tables were created as shown in the image:

WEB Interface Setup:

The web platform may look simple, but it has a very interesting implementation in its way of interacting with AWS.

One of the biggest problems when working with a web page, is having temporary variables, because every time the page is updated, we will lose all the information stored by the variables, however in my implementation I extract data directly from DynamoDB, thanks to the javascript SDK that provides AWS, therefore I can store information in a database, as seen in the above image in the database called "FMP", and save temporary variables and quick access for the deployment and update of the web page "FMPtemp".

At the time of displaying the web page, the FMPtemp database is called to obtain the status in real time of the pets and according to our algorithm determine the state of the pet in general, it will be notified by colors as shown in the image down.

Each of the legs represents the following:

Temp: Ambient Temperature

Accel: Max Acceleration

Air Q: Air Quality

Moist: Air Moisture

Color Ranges:

The air quality is calculated using the following formula using a reduced version to calculate the dew point of the air and according to the books it must be less than 90: