Code Monkey home page Code Monkey logo

iot_services_public's Introduction

Disclaimer

This is the demonstration repository of the project. The source code is private.

If you want access to it, please contact me at [email protected]

IoT Server and client

This repo is a personal project where I developped a client-server architecture using flask as the main server and a REST api communication protocol.

For the the database I used SQLAlchemy which is an ORM (Object–relational mapping) that allows us to have a higher level of abstraction when writing database requests.

A special effort was made to secure the communications between the client and the server using multiple types of tokens.

Token types:

  • Access Token: used only by a user (valid for 30 minutes)
  • Refresh Token: Used only by a user (valid for 1 minute)
  • Device Token: Used by IoT devices only and is valid until revoked by user

JWT and flask_httpauth were used to secure all the requests between (server <-> user) and (server <-> device)

In its current state, the server can handle multiple users and each user can have multiple devices. Each device can upload realtime data captured used its sensors.

Unit testing:

The current unit tests cover the following functionalities:

  • Account creation

  • Existing acount verification

  • Wrong password

  • Add multiple devices per user

  • Upload data from each device

  • Get all devices of a user

  • Get all data from all user devices

  • Revoke access to device

Frontend:

Login page

Login or create an account

login page

Create Device

The user can create a device on the website. Currently the only supported device type is an analog gauge. Using the API the user can create any device type.

create_device

Dashboard

The Dashboard is a unified view where the user can access all the devices associated with his account.

dashboard

The Dashboard allows the user to access and modify certain element concerning each device:

Changing Device Name:

The user can change the device name directly from the dashboard. As you can see in the video below, When device name is valid a success alert is shown to the user. When the device name is the same i.e. the user did not edit the text, a warning is shown and the text field turns orange. When the user enters a name used by another device, an error message pops up.

change device name

Accessing Device Config:

Device config is a slide down menu containing details about each device.

sho device config

Accessing Device QR:

Device QR is an access code that allows the device to connect to server and send data via the API. This code is a secret should not be distributed to other users.

sho device config

Device Data Plots:

The data being sent by the device can be accessed by clicking on the open plots.

In this page, the data is plotted for each sensor that the device has more than one.

data plots

Download all user data from all devices:

All the data sent by the devices belonging to the user can be downloaded in csv format.

download

The data sent by the devices can be either a value or a dict of values

Realtime Live Plotting:

Realtime plotting is a feature currently being developped. However, a demo is available which replicates exactly the behavior between the frontend and backend.

live_plotting

In this demo the user can change the refreshrate which will change the tie between each request to the server. The data plotted is a cosine function recieved from a separate thread running in the background.

Small Screens:

For better UX small screen support has been added to the following pages

Create Device Dashboard Demo
create_device_small create_dashboard create_demo

AI on edge:

AI on edge is a feature in developpement. Initially it will contain a vision module that can be deployed on edge devices that can read data from analog or digital gauges.

This module will be deployable on a raspberry like device equiped with a camera and will allow us to read analog meters and gauges.

Future:

Every user can add and connect as many devices as he wishes. These devices can then either process the collected data on the edge or send a raw format that will be processed by the server. The used can view all the devices output on a dashboard.

A notification system will alert the user if a certain gauge is reading values outside of user-defined boundaries.

iot_services_public's People

Contributors

mserrari 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.