Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Design and Development of a System for Monitoring and Managing Workstations

Overview

The aim of this project is to automatically monitor and manage workstations. In particular, three possible states of a workstation are considered: free, occupied, and on hold.

The system first uses an ESP-EYE to capture images of the workstations. A Raspberry Pi then requests these images at regular intervals and processes them using a program based on a YOLO model for detecting people and objects within each workstation.

The result is an array containing the status of all analyzed workstations. This array is then sent to the Measurify cloud API, where it is temporarily stored. Finally, a Flutter application periodically requests data from Measurify to display the current status of the workstations on screen.

The overall objective is to develop a system capable of automatically detecting which workstations are free and which are occupied, making this information available to anyone who needs it.

Workflow

Hardware

The devices used for this project are:

Software

The following software components are required to run the system:

  • CameraWebServer_ESP-EYE.ino - an Arduino sketch to configure the ESP-EYE.

  • camera_poller.py - a Python script to retrieve images from the ESP-EYE.

  • main.dart - a Flutter application to visualize the status of the workstations.

Quick Start

ESP-EYE

  1. Position the camera so that it correctly captures the workstations you want to monitor.

  2. Install Arduino IDE, then go to the edge folder in this repository and open CameraWebServer_ESP-EYE.ino.

  3. Set the ssid and password variables (lines 12–13) with the credentials of the Wi-Fi network to which the ESP-EYE will connect.

  4. Go to Tools > Board > Boards Manager (or simply click the Boards Manager icon in the left-hand corner). Type "esp" in the search bar, scroll down to find esp32 by Espressif Systems, and click INSTALL.

  5. Connect the ESP-EYE to your computer with a USB cable. Select the AI Thinker ESP32-CAM board and the correct port from the drop-down menu, and then click the Upload icon.

If everything worked correctly, you should see a message like the following in the serial monitor:

WiFi connected
Camera Ready! Use 'http://192.168.66.241' to connect

Now the camera will begin streaming the video of the workstations at the URL specified in the serial monitor.

(Note: if you use an ESP32-S3 instead of an ESP-EYE, go to the edge folder in this repository, open board_config.h, comment out line 15, and uncomment line 16.)

Raspberry Pi

  1. Go to the server folder in this repository and upload its contents to a USB drive.

  2. Connect the Raspberry Pi to a monitor and power it using a USB-C cable.

  3. Insert the drive into a USB port on the Raspberry Pi and copy the files into a folder, preferably one that does not require special permissions, such as /home/pi/, to avoid permission-related issues.

  4. Create and use a Python virtual environment.

    Open a terminal and check whether Python is already installed with the following command:

    python3 --version
    

    If it is not installed, you can install it with:

    sudo apt update
    sudo apt install python3
    

    Navigate to the folder where you copied the files (e.g., /home/pi/). Here, you can create a virtual environment by typing:

    python3 -m venv .venv
    

    Finally, activate it with:

    source .venv/bin/activate
    
  5. Open camera_poller.py and seat_status.py and set the following variables to the appropriate values, if necessary:

    • ESP_EYE_IP: the IP address of the ESP-EYE.
    • PYTHON_INTERPRETER: the path to the Python interpreter in the virtual environment.
    • SCRIPT_PATH: the path where you copied the script.
    • IMAGE_DIR: the path where the images will be saved.
    • MODEL_DIR: the path where the models are located.
    • ENDPOINT: the Measurify endpoint to which the measurements are posted (provided by Elios Lab).
    • TOKEN: a token for making API requests to Measurify (provided by Elios Lab).
  6. In seat_status.py, modify the array that defines the regions of interest (lines 24–25):

    • Open the image you want to examine with an image editor to determine the coordinates of the bounding boxes you want to analyze. In the following image, on the left you can see two example points that define a box: the red point (0, 200) and the blue point (300, 500).

      Coordinates

  7. In the terminal, navigate to the folder containing camera_poller.py and run it with:

    python3 camera_poller.py
    

    The script will now request an image from the ESP-EYE every 30 seconds. The images will be saved in the folder specified in step 5, analyzed by the seat_status.py script, and finally sent to Measurify.

(Note: if you want to change the interval between requests, modify the value of the INTERVAL variable in camera_poller.py (line 11))

Flutter

  1. Install Visual Studio Code and the Flutter plugin, then go to the client/lib folder in this repository and open main.dart.

  2. Open a terminal in VS Code and execute the following command:

    flutter run -d chrome --web-browser-flag="--ignore-certificate-errors"
    

    (The flag is necessary if the site's certificate has expired.)

  3. Wait for the following window to open:

    HomePage

    From here, you can choose a room to monitor. At the moment, all rooms are identical, so regardless of which room you choose, the same page will be displayed, showing something like this:

    Seats

    Each colored circle represents a single workstation and its status: green for free, red for occupied, and yellow for on hold.

    The application will now request data from Measurify every 5 seconds and display the current status of the workstations on the screen.

  4. Change the status of the workstations by moving the objects and check the changes in the application.

(Note: if you want to change the update interval, modify the value of the _updateTimer variable in main.dart (lines 107 and 302))

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages