Close
0%
0%

Industry 4.0: An economical SAAS MES part 2

An OpenSource MES that is easily implementable with resources accessible to everyone.

Public Chat
Similar projects worth following
A MES (Manufacturing Execution System) primarily serves to collect real-time production data from a factory or workshop. This gathered information promotes better production management, including real-time monitoring, traceability, quality control, and preventive maintenance. Despite the recognized advantages of MES, its complex integration and high cost can deter investors. Nonetheless, automatic real-time data collection offers significant benefits compared to using paper forms and manual entry into Excel. The Lean-C IOT project aims to create a free, OpenSource MES that is easily implementable with resources accessible to everyone. After a year of research and development, in collaboration with various industrial partners in Brittany, France, we have achieved a stable version offering advanced functionalities competitive with licensed solutions.

SPECIAL THANKS:

The web management interface of LeanC-IOT MES is developed in Php and utilizes a MySql database.
The interface has been designed responsively to ensure its usability from any device: PC, tablet, or smartphone.

The tables used are based on the work of Matt Smith
https://codepen.io/AllThingsSmitty/pen/MyqmdM

The navigation bar comes from the work of Juan Alberto
https://codepen.io/Juan-Alberto-the-builder/pen/WNPrRNY

Thanks for their code!

LeanC-IOT MES is an open-source system. This means users are free to use, modify, and improve the code under the terms of its license.

By contributing to the development of LeanC-IOT MES, you not only benefit from the collective wisdom of the community but also help in advancing the software's capabilities for everyone.

OVERVIEW OF LEANC-IOT MES FEATURES:

A. LEANC-IOT MES: A TOOL FOR INDUSTRY MANAGERS:

1. Empower Your Decisions with Data: 

With LeanC-IOT MES, harness real-time data collection to gain accurate insights into your production performance. Move beyond guesswork and make decisions that are informed, efficient, and productive.

2. Identify and Resolve Issues Swiftly: 

Our automated data processing identifies anomalies and failures in your production process fast. This means you can quickly correct problems, significantly reducing downtime and production losses.

3. Maximize Your Resources: 

Get precise information on material consumption, machine usage, and labor efficiency. LeanC-IOT MES enables you to optimize resource allocation, cut waste, and boost profitability.

4. Achieve Continuous Improvement: 

Analyze your production data to spot trends, bottlenecks, and areas for improvement. LeanC-IOT MES guides you towards ongoing enhancement of your production processes, elevating product quality and enhancing customer satisfaction.

B. USER MANAGEMENT:

In developing this web application, I focused on four main objectives regarding user account management:

1. Enhanced Security: 

Implement secure access through a login/password system, use password hashing, and integrate CSRF tokens to achieve a level of security comparable to professional platforms.

2. Multi-User Functionality: 

Ensure an efficient multi-user environment to manage user interactions simultaneously without issues.

3. Customized Access Management:

Offer customized access control based on the specific needs of each user type.

4. Session Security: 

Enhance security by employing user-specific sessions, making it ideal for terminals shared among multiple users. This approach ensures that each user's session data is isolated, providing a secure and personalized experience on shared devices.

C. DASHBOARD:

The dashboard is designed to display all connected sensors. If you deploy a new sensor, it will automatically appear on your dashboard and will be fully functional without the need for any coding. Each sensor integrates automatically as soon as it's powered on.

The dashboard updates automatically every minute, providing a real-time visualization tool for the status of your hardware fleet. 

For each sensor, the dashboard displays:

1. The state of WIFI connectivity: 

(CONNECTED or OFFLINE).

2. The status of the production process: 

(PRODUCTION or STOPPED)

3. A quick access link to view the production flows for the current day:

(rate in beats per minute, automatic detection of non-production periods).

D. ALLOWING USERS TO EXPLAIN DOWNTIME PERIODS:

The system standardizes data by enabling users to attribute stoppages to specific causes, based on the Ishikawa diagram framework. Additionally, for each downtime event, it offers a chat-like space for users to discuss and gather insights about the malfunction's causes, designed to promote ongoing enhancement.

logo.png

Portable Network Graphics (PNG) - 229.67 kB - 03/10/2024 at 02:38

Preview

script2.js

x-javascript - 106.00 bytes - 03/10/2024 at 02:38

Download

stops_details.php

php - 8.54 kB - 03/10/2024 at 02:38

Download

logout.php

php - 302.00 bytes - 03/10/2024 at 02:38

Download

style.css

Cascading Style Sheets (CSS) - 8.69 kB - 03/10/2024 at 02:38

Download

View all 16 files

  • 1
    Let's continue developing the structure of our database.

    In the first part of the project, you had already created your database in phpMyAdmin. It contained a single table called ‘ACTIVITY’.

    We will now create the additional tables required for the efficient operation of LeanC-IOT MES.

    Table structure for table `MESSAGES`

    CREATE TABLE `MESSAGES` (
      `id` int UNSIGNED NOT NULL,
      `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
      `initials` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
      `id_activ` int UNSIGNED NOT NULL,
      `reading_time` datetime DEFAULT CURRENT_TIMESTAMP
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

    Table structure for table `STOPS`

    CREATE TABLE `STOPS` (
      `id` int UNSIGNED NOT NULL,
      `id_activ` int UNSIGNED NOT NULL,
      `type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
      `id_activ2` int UNSIGNED NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 
    
    

    Table structure for table `USERS`

    CREATE TABLE `USERS` (
      `idPrimaire` int NOT NULL,
      `usernameIndex` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
      `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
      `emailIndex` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
      `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
      `last_login` datetime DEFAULT NULL,
      `level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

    We simply insert a default user with login = 'Admin' and password = 'Admin' to test the system. You should delete this user afterwards for obvious security reasons.

    INSERT INTO `USERS` (`idPrimaire`, `usernameIndex`, `password`, `emailIndex`, `created_at`, `last_login`, `level`) VALUES
    ('Admin', '$2y$10$1bOu35b9CERvi9Y2IW5tnO46WyH7agG/Cz62jSrUn.4EhblLiv.Qy', 'admin@yourdomain.com', '2024-03-10 00:17:55', NULL, 'Admin');

    Logically, on the left side of your phpMyAdmin control panel, you should be able to see the list of your tables.

    Great news! Our database is now ready. We will now start deploying our .php files on the server.

  • 2
    Creat the 'db_config.php' file

    Use your text editor and modify it to include your specific database credentials.

    <?php
    // Database connection information
    $servername = 'xxxxxxxx.hosting-data.io'; // Your database server
    $dbname = 'your database name';// Database name
    $username = 'enter your user name';// Database username
    $password = 'enter your password';// Password for the user
    
    
    // Connecting to the database
    $conn = new mysqli($servername, $username, $password, $dbname);
    
    // Checking the connection
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    ?>
    

    It's crucial to place your 'db_config.php' file outside of the public root directory of your web server.

    This practice significantly enhances the security of your application by preventing unauthorized users from accessing sensitive database connection details via a web browser.

    The public root directory, often named public_html, www, or htdocs, is accessible to anyone on the internet. Files within this directory can be accessed directly through a URL. 

    However, files placed outside this directory are not accessible via direct URL, making them secure from web-based attacks.

    To implement this security measure, move your 'db_config.php' file to a location on your server that is not publicly accessible. 

    For example, if your public root directory is /var/www/html, you could place 'db_config.php' in /var/www or another secure directory outside /var/www/html.

    After uploading the file, it's important to note the complete file path of 'db_config.php'. You will need this path to include or require the 'db_config.php' file in your PHP scripts.

  • 3
    Adapting the code for your application

    The next steps in adapting the code for your application are remarkably straightforward. All you need to do is download the application structure provided in the resources.

    Once downloaded, open the folder locally to perform batch replacements in the code. It's advisable to use Atom Text Editor for this task. Atom offers a powerful feature for searching and replacing text across multiple files, which can significantly streamline the customization process.

    To utilize this feature in Atom, simply use the shortcut CTRL+SHIFT+F (CMD+SHIFT+F on macOS). This command opens the "Find in Project" search box, allowing you to search for specific strings of text throughout your entire project and replace them as needed.

    This method is incredibly efficient for updating paths, customizing configuration settings, or making any other widespread changes to your codebase. By taking advantage of Atom's search and replace functionality, you can ensure that your code is quickly and accurately updated according to your project's requirements.

View all 5 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates