Giter VIP home page Giter VIP logo

api_weightmixer's Introduction

FastAPI Mixer Control API

This API is designed to control a mixer using a serial port connection. It is built using FastAPI and exposes several endpoints to control and monitor the mixer.

Installation

  1. Install FastAPI: pip install fastapi.
  2. Install Uvicorn, which is an ASGI server to run the FastAPI application: pip install uvicorn.

Running the Application

Run the FastAPI application using Uvicorn with the following command: uvicorn main:app --reload

Replace main with the name of your Python file. The --reload flag allows the server to restart after code changes.

API Endpoints

Here are the available API endpoints:

Command HTTP Method Endpoint Request Payload Response Payload
get_Name GET /get_name None {"name": int}
set_Speed POST /set_speed {"speed": int} {"result": int}
get_Speed GET /get_speed None {"speed": int}
get_Speed_Set_Point GET /get_speed_set_point None {"speed_set_point": int}
get_Viscosity_Trend GET /get_viscosity_trend None {"viscosity_trend": int}
start_Mixer POST /start_mixer None {"result": int}
stop_Mixer POST /stop_mixer None {"result": int}
reset POST /reset None {"result": int}
start_Weight POST /start_weight None {"result": int}
stop_Weight POST /stop_weight None {"result": int}
get_Weight_Value GET /get_weight_value None {"weight_value": int}
get_Weight_Status GET /get_weight_status None {"weight_status": (bool, bool, bool, bool, bool)}

For POST methods, send a JSON payload in the request body. For example, to set speed, send a POST request to http://localhost:8000/set_speed with a request body like {"speed": 120}.

Note

This is a basic implementation and does not include error handling and other considerations for a robust API, such as security, rate-limiting, etc. Depending on the use case, you might need to refine and expand it.

api_weightmixer's People

Contributors

jonasivers avatar rmorenoga avatar

Watchers

Ihar Suvorau avatar  avatar  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.