NOTE: The system default lenguage is Spanish, because the project is for a University in Spain (Interfaces are in
Spanish
, system intern communication messages are inEnglish
. The docs are inEnglish
for easing the universal undertanding of the PTOS System, all over the world)
PTOS or SOTA (in Spanish) is a Smart Parking integrated system that offers a safe live view to managers and users of a Smart Campus Parking Lot. The system is capable of handling the detection of a licence plate by a IP Camera at the entrance of a parking lot and asign to registered users a parking place with a unique ticket.
Users are able to interact with the system in a Web Aplication called UFV MyParking. There can to add vehicles that will be detected by the cameras in the parking lot entrance and exits. They are also able to visualize the parking lot capacity and status
Once a user enterers a ticket will be generated indicating the asigned parking place. This asigned place is the one that best suits the type of vehicle configured in the WebApp.
- Description
- Important
- Getting Started
- Deploying the App
- User Manual
- Access To Digital Twin
- Digital Twin Interface
- Header
- Map
- Action Buttons
- Device Manager Server Admin
- Connect Camera
- Add Vehicle Button
- Delete Vehicle Button
- See Places Button
- Barrers Button
- Refresh and AutoRefresh Button
- Access To WebApp UFV MyParking
- Register
- Dashboard
- Profile
- Vehicles
- Tickets
- Responsive Views
- Open TCP/IP Camera Simulator
- License
- Contact
-
Digital Twin (Parking Administration Platform and Simulator)
-
DeviceManager (Simulated IP Cameras Manager Server)
-
UFV MyParking WebApp (Vehicle and User Platform)
If you want to deploy the system in your local machine, you must have a linux (unix) enviroment, we recommend the use of Git Bash
to be able to execute the buildDocker.sh
script and deploy the system into container using docker-compose
You need to install Git
or GitBash
to be able to handle the scripts used by the system. Despite of that you will need to install Docker
in your local machine. The system has the docker files configured and waiting for being mounted.
For the installation of the system you will need:
https://gitforwindows.org/
NOTE: If you already have a virtualizated linux bash shell, like cygwin, please make sure you can execute .sh scripts.
NOTE: Please check the system requirements to successfullu install docker
-
Link for Windows https://docs.docker.com/desktop/windows/install/
-
Link for Mac: https://docs.docker.com/desktop/mac/install/
-
Link for Linux: https://docs.docker.com/desktop/linux/install/
Both Digital Twin
and UFV MyParking
systems make use of the browser to interact with the users. So make sure that you have a updated browser like Google Chrome, Firefox, Edge or Any Chromium Browser.
Here you will find more information about it:
https://docs.docker.com/desktop/windows/
NOTE:: In windows you just need to open the Docker Desktop App
git clone https://github.com/matbmoser/SOTA.git
Configure the database credentials, default settings and default of the enviroment.
NOTE: The system is already configurated with default values, so is optional the configuration of credentials. If you are willing to modify parameters like the connection to the Database, here there is a description.
Go to:
cd digital-twin/src/assets/mod/configs
NOTE: If you are unsafe about editing the configurations you can let them in their default values.
The directory contains two configuration files.
├───configs
├───config.php ## Global configurations
└───db.config.php ## Database configurations
Go to:
cd digital-twin/deviceManager/assets/mod/configs
Device Manager Scructure:
├───camera ## Camera Connection Files
│ └───socket ## Socket Camera Client Files
├───db ## Database files
│ ├───controllers ## Data Access Controllers
│ └───dbConfig.py #<HERE you can edit the DB Connection Settings>
├───docs ## Useful docs like SJMP protocol description
├───operators ## Encription Tools and Operators
├───protocols ## Comunication Protocols Handlers
├───server ## Server Files
└───globalConfig.py ##<HERE you can edit the global configurations>
UFV MyParking Laravel Configurations
Go to:
cd /webapp/src
Open the following file:
.env
Laravel unificates all the global configurations in only one enviroment file. To configurate the database parameters you can access the file and modify the following parameters:
DB_CONNECTION=mysql
DB_HOST=mysql # Indicate DB Server ip or hostname.
DB_PORT=3306 # DEFAULT: MySQL 3306
DB_DATABASE=sotadb ## The default database created is sotadb.
DB_USERNAME=<username> # DEFAULT: root
DB_PASSWORD=<password>
You can modify the docker compose file before building the app.
## --------------------------------------------------------------
# Parking Time Optimization System Configuration
# Author: Mathias Brunkow Moser
# ©2022 - ALL RIGHTS RESERVED
## --------------------------------------------------------------
version: "3.9"
services:
## MySQL Database Configuration
mysql:
image: mysql
container_name: mysql-bbdd
environment:
## Database configuration
MYSQL_DATABASE: "sotadb"
MYSQL_USER: "dbadmin"
MYSQL_PASSWORD: "GT9zEN(FdxSAmWiy"
MYSQL_ROOT_PASSWORD: "s0t42022"
ports:
## Port Configuration
- "3306:3306"
volumes:
- ./data:/var/lib/mysql
## phpMyAdmin administrator configuration
php-my-admin:
image: phpmyadmin
container_name: php-my-admin
ports:
- 7777:80
environment:
- PMA_HOST=mysql
depends_on:
- mysql
## UFV MyParking WebApp Configuration
php-apache:
container_name: php-webapp
build:
context: ./webapp
environment:
WEBAPP: "/var/www/webapp"
ports:
# Range of ports in production
- "8080:80"
## Port range in Development
- "3001:8001"
- "3000:8000"
- "3002:8002"
volumes:
## Create volumes to save the configurations
- ./webapp/src:/var/www/webapp
- ./webapp/apache/default.conf:/etc/apache2/sites-enabled/000-default.conf
depends_on:
- mysql
networks:
## Belongs to the internal network created
- default
- appNet
## Digital twin configuration
digital-twin:
container_name: digital-twin
build:
context: ./digital-twin
environment:
## Configuration of default path variables
DEVICE_MANAGER: "/usr/src/app"
DIGITAL_TWIN: "/var/www/digital-twin"
ports:
## Range of ports used.
- "3333:80" # Access port to the digital twin.
- "8888:8888" # Default device manager port.
- "4050-4100:4050-4100" # Device manager port range.
volumes:
## Volumes created to configure the environment
- ./digital-twin/src:/var/www/digital-twin
- ./digital-twin/php/php.ini-development:/usr/local/etc/php/php.ini-development
- ./digital-twin/php/php.ini-production:/usr/local/etc/php/php.ini-production
- ./digital-twin/deviceManager:/usr/src/app
- ./digital-twin/apache/default.conf:/etc/apache2/sites-enabled/000-default.conf
depends_on:
- mysql
networks:
- default
- appNet
## We create networks so that containers can communicate with each other.
networks:
default:
driver: bridge
appNet:
external: true
## The volumes used by the database will be stored in data.
volumes:
data:
NOTE: When you build the docker compose container enviroment, a new directory will be created, it will contain the persistent data from the system database.
./data
The deployement from all the SOTA system is centralized in only one Bash Script.
For building the docker compose container enviroment run the following script.
./buildDocker.sh
ALERT: If you execute for the first time the script it will take some minutes.
The script will perform a series of actions to build the containers.
########## < buildDocker.sh >
## Set up internal network
docker network create appNet
## Build Docker Compose <docker-compose.yml> file required
docker-compose up -d --build
## Give permits for Laravel to access the storage.
docker exec -it php-webapp chmod -R 777 storage
## Install all the PHP Laravel packets
docker exec -it php-webapp composer install
## Install all JS Packets
docker exec -it php-webapp npm install
## Wait 15 seconds for MySQL Server Container to startup
sleep 15
## Execute the preconfigured database migration.
docker exec -it php-webapp npm run migrate
NOTE: This is a simplified version of
buildDocker.sh
, to show the main commands.
Once the migrations are completed, the system is ready to go.
You can enter in the Digital Twin accessing the following url:
http://localhost:3333
For safety reasons you will be redirected to a login page in /login
:
Introduce the following credentials to have access to the digital twin.
> Default Admin Credentials:
Email: [email protected]
Password: 789456123 # Default Password
> Default Manager Credentials:
Email: [email protected]
Password: 789456123 # Default Password
** You can configure more default users in "```./webapp/src/database/seeders/UserSeeder.php```" and after you need to run again "```./buildDocker.sh```" to execute the migrations.
In case you want to execute a manual migration you can use:
docker exec -it php-webapp php artisan migrate --seed
The the digital twin will have some test data included so you can visualize how the data is shown:
You have two interface color modes: Dark Mode
(DEFAULT) and Light Mode
:
NOTE: Here you can visualize the parking place in real time, by zones.
In the header are able to:
- Logout
- Visualize your current information
- Change to light/dark modes
The map will show you the parking lot capacity status, in zones.
NOTE: In smartphones you will be not able to see the zones capacity just with
Ver Plazas
Action Button.
In the action buttons you are able to:
- Open a Camera Manager Server
- Add a new vehicle to the parking place
- Delete vehicle from parking place
- See all the vehicles inside the parking place
- Simulate the control of the barrers
- Visualize the parking place free space capacity
- Visualize the parking place filled space capacity
This server manages all the cameras, and recieves WebSocket and TCP connections if the structures uses the SJMP Protocol digital-twin/deviceManager/docs/SJMPProtocolDescription.pdf
packet structure.
When Started up a random UUID will be generated as serverid
.
Here you can see the server status, inside the digital-twin
docker container.
In server admin you can:
- Choose a random port to open the server.
- Choose the default port.
- Open the server when is closed
- Close the server when is opened (will close all the cameras)
- If open you can see the server log inside the
digital-twin
container
The camera will connect to the current running server using SJMP Protocol digital-twin/deviceManager/docs/SJMPProtocolDescription.pdf
Here you can see the logs for the camera connected to the server in digital-twin
docker container.
You will recieve a sessionid which can identify your session in the server.
In camera admin you can:
- See camera status
- Disconnect the camera
After you connected the button will change to disconnect:
NOTE: If you reload the digital twin page, the camera will reconnect to the server and recieve a new sessionid.
NOTE: Make sure the camera is connected, before adding!
Here you can simulate to add a new vehicle like a camera.
The camera will send a SJMP Protocol digital-twin/deviceManager/docs/SJMPProtocolDescription.pdf
IN Flag with the plate
NOTE: Make sure the camera is connected, before adding!
Here you can simulate to delete a new vehicle like a camera.
The camera will send a SJMP Protocol digital-twin/deviceManager/docs/SJMPProtocolDescription.pdf
IN Flag with the plate
Here you can see all the vehicles in the parking.
Here you can simulate to open and close the barrers.
All the information from status will appear in the monitor.
Autorefesh: Every 10 seconds it will update the parking map and info if is on.
You can click in refresh to refresh the information in the map.
The parking information will update then.
You can enter in the WebApp UFV MyParking accessing the following url if available:
NOTE: If is not available you can change in the
docker-compose.yaml
the default port inphp-webapp
container, then rerun the./buildDocker.sh
command.
http://localhost:8080
For safety reasons you will be redirected to a login page in /login
:
Introduce the following credentials to have access to the webapp:
> Default Admin Credentials:
Email: [email protected]
Password: 789456123 # Default Password
> Default Manager Credentials:
Email: [email protected]
Password: 789456123 # Default Password
> Default User Credentials:
Email: [email protected]
Password: 123456789 # Default Password
You can also create your own user:
NOTE: To register click in
Registrate
in the bottom of the login.
Read the data policy if is necesary, there we specify why the data is stored.
The dashboard shows you all the parking places.
The menu is variable by the permits of the user rol.
Click over the icon of profile in the header
Here you can see your data and permits:
NOTE: As a normal user you have no permits, change to admin to have more permits.
Here you can modify your data, and password.
Add vehicles so you can simulate them in the digital twin
Here you can see and manage all your vehicles
Click over the add button in the bottom right
of the screen
Introduce your plate
and vehicle type
:
Click over the delete button in the right
of the register and click on delete
:
NOTE: Go to digital twin and click over the
Add Vehicle Button
and add the plate you just added
You will recieve a ticket if you refresh the page
.
Click over Ver Ticket
:
You can see your parking place in the top left:
NOTE: Go to digital twin and click over the
Delete Vehicle Button
and add the plate in your ticket and refresh the page.
Your ticket is now invalid, because you went from the parking lot.
All the WebApp UFV MyParking is responsive so you can see how the views are in mobile:
You can open a new camera and simulate using the CameraManager
simulator
NOTE: You need to have an
open server
, in thedigital twin
!
Execute the script:
./openCamera.sh
A menu will open for you to configure a new camera
:
Select the diferent options to:
- Start new Camera
- Start Default Camera, if the default server is open.
- Disconnect a camera
- Add a vehicle to parking (needs to exist)
- Delete vehicle from parking (needs to be inside)
- List all the cameras in the manager
NOTE: If you exit
all the cameras
will be closed!
Introduce the data from the open server to connect!
NOTE: If you introduce empty, the default settings will be used.
NOTE: After this you are ready to
add/delete vehicles
, select thecamera
in the list that will be deployed. Then you can add thevehicle plate
, and it is done!
Distributed under the Creative Commons License. See LICENSE.md
for more information.
Commercial use is not authorized, please contact with: Mathias Moser - [email protected]
Mathias Moser - [email protected]
Project Link: https://github.com/matbmoser/SOTA