Giter VIP home page Giter VIP logo

be-iort's Introduction

๐Ÿ‘พ .NET Robotics IoT API

Build status Quality Gate Status

Azure DevOps builds Azure DevOps releases

๐Ÿ’ญ About

This is a .NET Backend API project and has the following features :

  • Remotely maneuvre a robot through a web browser [Feb 2022 Release]
  • Retrieve and monitor IoT sensor data displayed on the dashboard [Feb 2022 Release]
  • Camera video streaming in real-time [Apr 2022 Release]

MicrosoftTeams-image (4)

Features to be added in future release

  1. Robot Control Panel module

    • SignalR and BackgroundService to enable real-time IoT sensor monitoring (Temperature, Humidity, Pressure)
    • Ultrasonic sensor integration to detect collision
    • Robot speed sensor integration to monitor the rover's speed
    • Battery status integration to monitor the leftover battery on the RaspberryPi
    • Camera stream integration
  2. Weather Station module

    • Line chart to monitor sensor trends for T-10 seconds
    • MongoDB to store IoT sensor data
  3. DevSecOps

    • Perform Static Code Analysis with SonarCloud โœ…
    • Perform unit testing with XUnit
    • Integrate unit testing into CI Pipeline and generate code coverage

-----------------------------------------------------

๐ŸŽž๏ธ Demo

Controlling the rover from a mobile device

-----------------------------------------------------

๐Ÿ› ๏ธ Tech Stack

Technology Remarks
.NET Web API Backend API logic built with .NET 5
RaspberryPi Server to host the Backend API logic and to host the Azure DevOps agent for CICD
Docker Containerization platform to host the Backend API logic
Azure DevOps Continuous Integration/Continuous Deployment platform
Pi-Top Robotics Kit Hardware to maneuver the robot by Pi-Top - Pi-Top OS is used to integrate with the peripherals
SenseHat Hardware to capture IoT sensor data

-----------------------------------------------------

๐ŸŽ† Installation

Hardware

The following hardware is required prior to installing the software

  1. RaspberryPi 4B+
  2. Pi-Top Robotics Kit
  3. SenseHat

Software

  1. Install Docker engine on the RaspberryPi
  2. Install .NET 5 / .NET 6 on the RaspberryPi
  3. Download the docker image : amirashrafizham/be-iort
  4. Run the following docker command : sudo docker run --privileged -p 5000:80 --name be-iort --detach --restart unless-stopped amirashrafizham/be-iort

-----------------------------------------------------

๐Ÿ’ป Code Structure

CodeStructure

Pattern

The project follows the Repository pattern, where C# classes called Services will be instantiated into the Controller using Dependency Injection

Modules

  1. RobotWheel - This is the service to manoeuvre the robot
  2. PiSenseHat - This is the service to retrieve the Iot sensor data

Libraries

  1. IoT.Device.Bindings
  2. Pi-Top
  3. Pi-Top.MakerArchitecture
  4. System.Device.Gpio

-----------------------------------------------------

๐Ÿš€ CICD

Due to the limitation of the 32-bit Pi-Top OS as of Apr 2022, the project will be built using .NET 6 on local machine and configured to .NET 5 on the server. These are the steps to build and release the code to the RaspberryPi Server

  1. From local machine, push the latest code update to Github
  2. Azure Pipelines will automatically trigger the CI pipeline
  3. The CI pipeline will download .csproj and Dockerfile.stg hosted on Azure DevOps secure file. These files are configured for .NET5
  4. Overwrite .csproj and store Dockerfile.dev from $(Agent.TempDirectory) to $(Build.Repository.LocalPath)
  5. Build and containerize the code using Dockerfile.stg. The Dockerfile has the following main commands
    • docker stop old image
    • docker remove old image
    • docker run new image with privileged access, detached mode, restart-unless-stop and point to port 5000
  6. Push to Dockerhub for backup
  7. Azure Pipelines will then automatically trigger the CD pipeline with the following main commands
    • docker stop old image
    • docker remove old image
    • docker run new image with privileged access, detached mode, restart-unless-stop and point to port 5000
    • docker remove images on the server with label <none>

Screenshot 2022-03-07 232948

-----------------------------------------------------

๐Ÿ›ฐ๏ธ Connectivity

To access the Swagger API, simply point the IP address of the RaspberryPi with port 5000 and the extension /swagger/index.html

SwaggerScreenshot

-----------------------------------------------------

be-iort's People

Contributors

amirashrafizham avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.