Skip to content

A comprehensive parking system project, with a TCP server running on Linux, an STM32 simulating GPS and a Beaglebone acting as a client.

Notifications You must be signed in to change notification settings

LeahShl/Embedded-Parking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded Smart Parking System

This project is a complete embedded-to-server parking simulation system. It simulates vehicle parking behavior using an STM32 microcontroller, collects parking events on a BeagleBone Green (BBG) via I2C, and transmits them to a Linux-based TCP server. The server logs and processes these events in real-time using a shared-memory SQLite database.

Contents

Project Structure

[ParkingSystem]
├── STM32               # STM32 GPS simulator firmware
├── BBG                 # BeagleBone Green client daemon
├── server              # TCP server and database management
└── README.md           # This file

Hardware Requirements

  • STM32F756ZG development board (or similar STM32 board)
  • BeagleBone Green (or BeagleBone Black)
  • I2C wiring between STM32 and BBG
  • Ethernet cable for BBG to reach the server
  • Linux host for running the TCP server

Software Requirements

STM32

  • STM32CubeIDE

BBG

  • Debian-based OS (default BBG image)
  • I2C tools and drivers enabled
  • GCC toolchain for ARM

Linux Server

  • g++ (C++14)
  • SQLite3
  • Make
  • POSIX-compatible system (e.g., Ubuntu)

System Overview

  1. STM32 simulates vehicle parking START/STOP events with randomized GPS coordinates.
  2. Messages are sent via I2C to the BeagleBone Green, which runs a daemon that:
    • Receives I2C messages
    • Parses START and STOP events
    • Sends the data via TCP to a Linux server
  3. The Server receives incoming TCP requests, identifies the closest parking lot to the coordinates, logs the event, and calculates parking duration and price.

Setup Instructions

1. STM32 GPS Simulator

  • Follow the build and flash instructions in STM32/README.md
  • Confirm I2C is connected to BBG:
    • Connect SCL: BBG PIN17 <---> STM PB8
    • Connect SDA: BBG PIN18 <---> STM PB9
  • STM32 will start transmitting messages when I2C master is detected

2. BBG Client

  • Follow BBG/README.md to:
    • Compile or upload the daemon
    • Install the systemd service
    • Configure the parksys.config file
  • Confirm BBG is connected via I2C to STM32
  • Confirm BBG is connected to router via Ethernet

3. Linux Server

  • Follow server/README.md to:
    • Build the TCP server and price updater
    • Run ./init_db_example.sh to create example cities/lots
    • Launch the server with ./parksys-server-main

Component Details

STM32 GPS Simulator

  • Runs on FreeRTOS with a timer-based UTC counter
  • Sends messages every 1 second:
    • IDLE: default state when not parking
    • START: begins a random parking session
    • STOP: ends the session after 1-10 seconds
  • Communicates over I2C as a slave

Refer to full details in STM32/README.md


BBG Client

  • Runs as a systemd service (parksys.service)
  • Uses two processes:
    • I2C process reads from STM32
    • Ethernet process sends data to the server
  • Robust logging and config handling
  • Communicates with the server on port 12321 by default

For configuration, logs, and installation, see BBG/README.md


Linux Server

  • TCP server listens on port 12345
  • Stores all data in a shared memory SQLite database (/dev/shm/parksys.db)
  • Periodically flushes to disk ($HOME/.parksys.db)
  • parksys-price-updater CLI tool allows runtime management of cities and lots

Complete usage guide and schema are documented in server/README.md

About

A comprehensive parking system project, with a TCP server running on Linux, an STM32 simulating GPS and a Beaglebone acting as a client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages