Skip to content

Mobusshar/iot-project-msc-oulu-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Name: IoT Mini Project 1

GitHub commit activity GitHub last commit GitHub top language GitHub language count GitHub License GitHub code size in bytes GitHub repo size GitHub forks GitHub Repo stars

Description

This project focuses on the transmission of sensor data from the IoT testbed server to a cloud-based storage system. The primary objective is to establish a seamless and efficient communication channel that enables the transfer of valuable sensor information from the IoT testbed to the cloud infrastructure. By implementing this connectivity, the project aims to facilitate centralized storage and analysis of sensor data, enhancing accessibility and scalability for future applications and research endeavors within the Internet of Things (IoT) domain.

Table of Contents

Installation

First clone the project from this directory

git clone git@github.com:Mobusshar/iot-project-msc-oulu-2024.git

Clone the RIOT server as well using this command

git clone https://github.com/RIOT-OS/RIOT.git

Go to the directory

cd RIOT/

Checkout to a previous version branch to avoid any unexpected error by using this command

git checkout 2022.01

IoT-project

AWS SETUP

For the last part of the project, we need to setup an AWS and after that, we have a server to get data from the IoT testbed. so in order to do that we need to setup a server and I will explain the steps through it.

First step, VPC

A virtual private cloud (VPC) is a secure, isolated private cloud hosted within a public cloud. VPC customers can run code, store data, host websites, and do anything else they could do in an ordinary private cloud, but the private cloud is hosted remotely by a public cloud provider. So we need to create VPC after the account setup in AWS. For VPC setup we need to take care of the IPv6 CIDR block.

Screenshot 2024-02-11 at 7 34 20

Second step, Subnet

We created two subnets one for the public for apps and everything that can be public and one private just in case of things we do not want to everyone have access to it.

Screenshot 2024-02-11 at 7 36 30

Third step, Launch Stance

So you need an internet gateway before the instance works.

Screenshot 2024-02-11 at 7 38 24

Then you need to attach VPC to the Internet gateway but there will be a last step before you set things up and it is :

Last step, Route table

for each subnet, you need to create a route table.

Screenshot 2024-02-11 at 7 44 43

At the end you can ssh into your VPC by following these instructions

Screenshot 2024-02-11 at 7 42 09

After Setting up the EC2 instance on AWS

Now you can get access to the EC2 instance and it is ready

Screenshot 2024-02-11 at 7 48 52

Install docker by following these commands

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Test the docker container by this command

sudo docker run hello-world

Install node-red container in the EC2 instance by using this command

docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red

Install influxdb container on the ec2 instance

docker run --detach --name influxdb -p 8086:8086 influxdb:2.2.0
Screenshot 2024-01-31 at 23 14 04

Testbed Preparation

Connect and build three nodes from this

Screenshot 2024-02-11 at 8 17 42

Create 3 nodes. 1 A8 nodes and 2 m3 nodes

Screenshot 2024-02-11 at 8 20 48

In the end your experiment will look something like this

Screenshot 2024-02-11 at 7 11 30

These three node ids will be used later in the commands so please replace with your created node ID from the IoT-test server

Go to the Testbed directory /mini-project-1/main/ and follow the commands below

To build a router border follow this

source /opt/riot.source

To build a border router firmware run this

make ETHOS_BAUDRATE=500000 DEFAULT_CHANNEL=<channel> BOARD=iotlab-m3 -C RIOT/examples/gnrc_border_router clean all

To flash the border router firmware

iotlab-node --flash RIOT/examples/gnrc_border_router/bin/iotlab-m3/gnrc_border_router.elf -l grenoble,m3,<node-id>

Set up the Border Router Network by picking an IPv6 address (like 2001:660:5307:3100::/64)

sudo ethos_uhcpd.py m3-<node-id> tap0 2001:660:5307:3100::1/64

Now in another terminal ssh into the A8 node

ssh root@node-a8-<node-id>

Check the ifconfig of the A8 node

Screenshot 2024-01-31 at 21 47 21

Go into this directory A8/mosquitto_bridge

Run the broker

broker_mqtts config.conf

Stop the service in another terminal Add your IPV6 instance on the mosquitto.config file

Screenshot 2024-01-31 at 22 02 48

Start the mosquitto service again

mosquitto -c mosquitto.config

Here we are making ready another m3 node to do the test

make DEFAULT_CHANNEL=<channel> SERVER_ADDR=2001:660:5307:3000::67 EMCUTE_ID==station0 BOARD=iotlab-m3 -C . clean all

Then flash the other m3 node

iotlab-node --flash ./bin/iotlab-m3/SensorNode.elf -l grenoble,m3,<node-id>
Screenshot 2024-01-31 at 22 25 21

This is to check the sensor data from the RIOT server

nc m3-<node-id> 20000

Consider writing reboot if it says unable to connect

License

MIT License

Contact

Merged Group Number 29 & 40

Md Mobusshar Islam

Email: mislam23@student.oulu.fi Student id:2305578

Mahdi Mehrpour Moghadam

Email:mmehrpou23@student.oulu.fi Student id:2305003

Magnus William Lange

Email: mlange23@student.oulu.fi Student id:2308245

About

This is our project for my master's course in IOT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published