Skip to content

opensourceoeesoftware/iot_connect

Repository files navigation

IoT connect

Description

IoT connect software

This project is a a software designed to help factories connect Their machine to the Open source OEE&CMMS software. It connects to your machine PLC, process the data and send it to the server where the OEE app is hosted.

Demo app

  • You can access to an OEE software deployed app
  • You can use this crendentials for a demo account username: demo_user , password: oeesoftwaredemo
  • This app is deployed in an EC2 AWS instance only for demo purposes and it is not expected to maintenance performances under stress
  • Visit official website more for info

Key Features

Sensors: Create Sensors Map them with your machine and track data.
Data collector: Collect sensor data and send it to the specified server.
OEE Data collector: Collect Oee data and send it to the specified server.
Multiple industiral protocol: MODBUS RTU & Other protocols.

Project Status

🚧 This project is in the early stages of development. 🚧
Some features may be incomplete or subject to change. Contributions, feedback, and suggestions are welcome as the project evolves.

Getting Started

Stack

  • Backend : Django/Python
  • Frontend : Django templates
  • Deployment & containerization: Docker, Docker-compose, and Nginx as a reverse proxy
  • Database: PostgresSQL
  • Prod Deployment : EC2, Loadbalancer, RDS (AWS)

Dependencies

  • Make sure you have a computer with some kind of IDE installed in it.VS Code for example
  • Make sure you have docker and docker compose installed, check This Tutorial
  • Make sure you have Nodejs and npm installed, check This Tutorial

Run the software locally

  • in the root directory create a .env file, here is the format
SECRET_KEY=S3cr3t_Kksdß023i4o
ALLOWED_HOSTS=localhost
CSRF_TRUSTED_ORIGINS=http://localhost
POSTGRES_DB=iot_connect
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
DB_HOST=db
DB_PORT=5432
DEBUG=False
LOG_LEVEL=INFO
SLEEP_TIME=1
  • Build and run the containers using the command docker-compose up --build, the --build flag is used mostly in the first time to build the images or when you change the Dockerfile of images , for code changes and editing you can simply run the command without the --build flag, volumes are there for this reason

  • In a seperate shell we need to run some migrations for the database to create the nessessary tables, for that we need to excute :

docker-compose run web python manage.py makemigrations
docker-compose run web python manage.py migrate

and it should look like this :

Applying db.0001_initial... OK
Applying django_rest_passwordreset.0001_initial... OK
Applying django_rest_passwordreset.0002_pk_migration... OK
Applying django_rest_passwordreset.0003_allow_blank_and_null_fields... OK
Applying django_rest_passwordreset.0004_alter_resetpasswordtoken_user_agent... OK
Applying sessions.0001_initial... OK
Applying sites.0001_initial... OK
Applying sites.0002_alter_domain_unique... OK
Applying state.0001_initial... OK
  • You need to run the following commands, to collect static files, and create super user
docker-compose run web python manage.py collectstatic
docker-compose run web python manage.py createsuperuser

You can then login the Admin panel

  • You can also use the iot_connect.service file to automatically start in an ubuntu server, you can make relevant changes to the file
[Unit]
Description=Iot connect software service #service name
After=multi-user.target
[Service]
Type=simple
Restart=always
WorkingDirectory=/home/ubuntu/portfolio #might need to specifiy another path
ExecStart=/usr/bin/docker compose up #same apply here depending on linux version
[Install]
WantedBy=multi-user.target
  • You can run the following commands to enable the service to start automatically in case the server is restarted
sudo cp iot_connect.service /etc/systemd/system/iot_connect.service
sudo systemctl daemon-reload
sudo systemctl start iot_connect.service
sudo systemctl enable iot_connect.service

CI/CD

GitHub workflows are used for the pipeline, the steps are :

  1. Installing docker and docker compose
  2. Building and running the images
  3. Running Database migrations

Authors

Contributors names and contact info

Djebab Toufik GitHub

Version History

  • 0.1
    • Initial Release

License

This project is licensed under the License - see the LICENSE.md file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published