Code Monkey home page Code Monkey logo

chariot's Introduction

Chariot

The Internet of Things (IoT) is a system of connected devices capable of collecting and transferring data. Different users of IoT devices may be interested in different types of data. A gardener might want to track the pH value of their soil and the air humidity. A city planner may look for a way to track pedestrian traffic in common spaces. A factory manager might look for a way to track the status of machinery and production rates.

IoT infrastructure has exploded in the past decade, so there are devices on the market to collect data for a wide variety of applications. But the wide variety of devices requires special considerations. A Wi-Fi 4K camera connects to a network much differently than a home thermometer. A motion detector may collect and transfer data in a different form than a pressure sensor.

So, despite progress in the IoT industry, it is still difficult to integrate different types of devices into a unified system. Chariot solves this problem. Chariot is a platform for IoT device management, data storage, and analysis. Users can add, remove, and configure a variety of devices on a single network. With Chariot, a gardener could purchase a pH and humidity IoT devices off the shelf and gather data from his soil and the air from one convenient interface.

Table of Contents

Features

Chariot offers:

  • A platform to use heterogeneous IoT devices regardless of device protocols,
  • Drop in, drop out device connection,
  • Connection to powerful database engines,
  • Modular addition of device adapters to expand Chariot's capabilities.

Getting Started

Prerequisites

The Chariot core exposes a REST-ful API to manage devices, networks, and database connections. The following are required to set up and run the Chariot core:

The Chariot GUI interfaces with the core API. The following are required to set up and run the Chariot GUI:

Installation

Use the *nix shell to install. Start by cloning this repository.

$ git clone https://github.com/chariot-dev/chariot.git

Navigate to the install directory.

$ cd path/to/chariot/install

To install both Chariot's core and GUI, run the install.sh script.

$ bash install.sh

To install just Chariot core, run the install-core.sh script.

$ bash install-core.sh

To install the Chariot GUI, run the install-gui.sh script.

$ bash install-gui.sh

Usage

Starting Chariot

To start Chariot's webserver and utilize its backend, navigate to the run directory and run the run-core.sh script.

$ cd path/to/chariot/run $ bash run-core.sh

To start the Chariot GUI, run the run-gui.sh script. This will attempt to connect to the local server, and must be performed after it is started.

$ bash run-gui.sh

To run the core and the GUI in a single command, run the run.sh script.

CLI

Chariot's server can be accessed via a terminal environment using utilities like curl. Below is an example usage to create a new network, add a device, and review that network and its device configurations.

(Creating a new network)
$ curl -i -X POST localhost:5000/chariot/api/v1.0/network -H "content-Type: application/json" -d '{"networkName":"test", "description":"this is my test network"}'
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 22
Access-Control-Allow-Origin: *
Server: Werkzeug/0.16.0 Python/3.8.1
Date: *Current Date and Time*

{
    "success": true
}

(Adding a device to a network)
(Notice that the associated network must be specified by the `networkName` field.)
$ curl -i -X POST localhost:5000/chariot/api/v1.0/network/device -H "content-Type: application/json" -d '{"networkName":"test", "deviceID":"MyDevice", "deviceType":"Device", "ipAddress":"IP Address", "pollDelay":3, *Device Specific Configurations*}'
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 22
Access-Control-Allow-Origin: *
Server: Werkzeug/0.16.0 Python/3.8.1
Date: *Current Date and Time*

{
    "success": true
}

Thanks to running as a web server, all endpoints can be accessed with curl commands like those demonstrated above. For documentation of all API endpoints please see the API_ENDPOINTS.md file.

GUI

All of Chariot's features can be utilitized through the GUI. This is an alternative to using the CLI. The features that are currently functioning are:

  • Creating a network
  • Creating a device
  • Deleting a network
  • Deleting a device from a network
  • Modifying a network's properties

The features that are not fully functioning are:

  • Authentication (creating an account and logging in with said account)
  • Adding another device to existing network (a little buggy)
  • Connecting to database to configure data collection
  • Data collection from an actual device
  • Modifying an existing device (a little buggy)
  • Monitoring device status as data collection episode is in progress
  • Performing data analysis

Contributing

Please see the CONTRIBUTING.md file for instructions on how to set up a development environment and contribute to Chariot.

License

This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE file for details.

Contributors

Acknowledgments

The team would like to thank:

chariot's People

Contributors

enioluwas avatar ryanhassing avatar hojohn2561 avatar juan-garcia96 avatar kac486 avatar dependabot[bot] avatar

Stargazers

agnes avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

chariot's Issues

Test Doc

Test doc is due Sunday, February 23.

Poll Delay: Required Field

Poll delay is currently not sent back to GUI correctly in order for it to create a text field. Needs to be in settings in the returned JSON. Will hardcode for now to accomodate.
image

Front-end Device Creation Validation

On the front end, required fields need to be differentiated from non-required fields. Before being able to create the device, the completed form must be valid (all required fields filled).

Update GUI to work with modifying network

The GUI should be updated to reflect the changes in payload keys newNetworkName, networkName, and description.
Ex: payload
{
"networkName":"testThree",
"newNetworkName":"test",
"description":"changedAgain"
}

Implement DataCollectionManager

The DataCollectionManager will hold the main functionality of Chariot: efficient data collection. Implementation will be based on the concurrency proposal defined in #15

Device Management

On the front-end, a user should be able to choose an already-instantiated network, then choose a device associated with that network and modify its configuration.

A user should also be able to modify a device's configuration by choosing to view all device configurations on their account and then modifying it from there.

Network Deletion

A user should be able to delete a network from their list of networks. Doing so not only removes the network, but also its corresponding device configurations and data collections parameters.

API GET Not Updating

GET requests to populate device-specific fields doesn't update after the initial device-type selection if the user goes from one device-type to another. b51775b

Update GUI to reflect device modification changes

On the GUI, device modification does not work. A correct payload looks like the following:
{
"networkName":"test",
"deviceId":"MyImpinjSpeedwayR4222",
"newDeviceId":"changedTheName",
"ipAddress":"radfn",
"pollDelay":3,
"antennas": [2,2,2],
"tag_population":2,
"report_every_n_tags":3,
"tx_power":4,
"session":3,
"start_inventory": true,
"mode_identifier":true,
"EnableROSpecID":true,
"EnableSpecIndex":true,
"EnableInventoryParameterSpecID":true,
"EnableRFPhaseAngle": false
}

Network Creation

Before an authenticated user can start collecting data, they must first create a network. This process can be done entirely on the front end until all of the network information has been entered, then a POST request should be made to validate and save the entered network information.

Should the user want to add an initial device to the network, that will continue after the network has been created.

Figure out how to show user custom exceptions

When a custom exception is hit, such as a DuplicateNameError. The console records that an exception has occurred, but a REST client such YARC does not handle this gracefully.

File "C:\Users\Juan Garcia Lopez\Desktop\seniorDesign\chariot\src\chariot\network\NetworkManager.py", line 54, in addNetwork
raise DuplicateNameError(networkName, 'Network')

Refactor method names to be more concise

I am of the opinion that method names such as Network.getNetworkDesc are redundant in their nomenclature. It would suffice to have Network.getDescription, instead of mentioning what type it is in every method.

Affected methods are scattered around in the core, and will all need to be updated to be more concise.

Network Management

An already-created network's attributes should still be modify-able by the user, if they desire to. GET requests to the web service will be used to get the previously-set values, and PUTs will be used to update them.

Internal database structure

Create a database for internal use by Chariot components. Used for storing user info, device info, and network info.

Make module import more concise

Submodules that are single class exports currently have to be imported externally like so:

from chariot.device.configuration.DeviceConfiguration import DeviceConfiguration

If the __init__ file in chariot/device/configuration does this import, then they can be imported like this instead:

from chariot.device.configuration import DeviceConfiguration

This looks shorter and less redundant. This change will have to be made across the entire core.

Test Database Connection

Before being able to click the button to start the data collection episode, the user must first test their connection to the database from the GUI to make sure it is valid and working.

Device Creation

On the front-end, a user should be able to create a device and have it associated with an already instantiated network.

Refactor Network to use Configuration model

The Configuration model makes it easier to manipulate objects since they are exposed via our API. Currently, Network object modifications are manually verified and managed by the API.

This refactor would prevent the need for that, preventing long API call handlers as objects become more complex.

Add docstrings for non-trivial methods and classes

The code is not properly documented in most cases. We need to add docstrings for many of the complex methods and classes e.g

"""
This method does complex stuff.
"""
def doComplexStuff(self, thing):
    pass

Account Creation

Users should be able to create an account through the front-end.

typeDefs missing for some variables

As noted by one of the team members, I have missed a few places where variables do not have type definitions. Go through my code and make sure all variables have a type

Device Removal

On the front-end, a user should be able to move a previously-created device from a network. All references to said device should no longer appear in the system.

Device Creation from Manage Existing Networks

Not only should users be able to create and add a device to a network upon the creation of said network, but the user should also be able to go back and add additional device on the Manage Existing Networks screen.

Modifying Existing Device Config Issues

Need a reference to field type when creating fields so they are passed to the backend properly and can pass validation. This can either be done via 2 separate get requests, one to get the field type, and the other to get the existing device config. Another solution could be to pass the type along with the existing device config fields.

In conjunction with that, fields with checkboxes need to be displayed as such.

Some missing fields.

CI/CD

We would benefit from having continuous integration/deployment set up for this repository. Contingent on the completion of #64

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.