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.
- Project Structure
- Hardware Requirements
- Software Requirements
- System Overview
- Setup Instructions
- Component Details
[ParkingSystem]
├── STM32 # STM32 GPS simulator firmware
├── BBG # BeagleBone Green client daemon
├── server # TCP server and database management
└── README.md # This file
- 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
- STM32CubeIDE
- Debian-based OS (default BBG image)
- I2C tools and drivers enabled
- GCC toolchain for ARM
- g++ (C++14)
- SQLite3
- Make
- POSIX-compatible system (e.g., Ubuntu)
- STM32 simulates vehicle parking START/STOP events with randomized GPS coordinates.
- 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
- The Server receives incoming TCP requests, identifies the closest parking lot to the coordinates, logs the event, and calculates parking duration and price.
- 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
- Follow BBG/README.md to:
- Compile or upload the daemon
- Install the systemd service
- Configure the
parksys.configfile
- Confirm BBG is connected via I2C to STM32
- Confirm BBG is connected to router via Ethernet
- Follow server/README.md to:
- Build the TCP server and price updater
- Run
./init_db_example.shto create example cities/lots - Launch the server with
./parksys-server-main
- 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
- 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
12321by default
For configuration, logs, and installation, see BBG/README.md
- 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-updaterCLI tool allows runtime management of cities and lots
Complete usage guide and schema are documented in server/README.md