Home/Projects/Piața Drăgaica Buzău
Turnstile access with QRtickets and card payment
Piața Drăgaica in Buzău asked us to modernize access at five existing turnstiles: QR-code tickets issued at the cash desk, card payment directly at the turnstile, and real-time reporting per cashier. We built the whole system, from the board inside the turnstile to the central server, and validated it end to end at all five entrances.
Where we started
The turnstiles were already there. The owner wanted to fit them with unattended card terminals and QR readers, and to have complete software: a cash desk sales app, a server with a database and API, and an app on each turnstile.
Tickets had to cover several cases – single entry, multiple entries, passes – and sales had to be visible in real time per operator. The computers, thermal printers and server belonged to the owner.
The solution
- a cash desk app that issues and prints QR tickets, with an end-of-shift handover receipt and a report sent automatically by email;
- on each turnstile: a mini PC, a QR reader, an unattended card terminal and an ESP32 board that controls the unlocking and the green/red signal light;
- a central server with a REST API and PostgreSQL that validates each entry and keeps the statistics;
- everything on the local network: an internet outage does not stop access;
- a web panel for updating the code and firmware on all turnstiles, with a backup and automatic rollback.
A ticket's path, cash desk to turnstile
A card payment at the turnstile is recorded on the server just like a validated ticket.
Cash desk
A desktop app in kiosk mode, with operator login.
- QR tickets on a thermal printer
- live statistics: tickets, active, cashed in
- shift handover with receipt and email
- schedulable daily report
The turnstile
Runs unattended and recovers on its own where possible.
- automatic start and a supervisor
- automatic detection of the reader and the board
- pause mode for maintenance
- default state: locked
Central control
One place to see and maintain all five entrances.
- status: online, reader OK, ESP32 OK
- versions verified with a SHA256 fingerprint
- automatic rollback after 3 failed starts
- firmware written with a copy of the old one
What we learned on site
The reader stopped during remote sessions
Desktop Windows has a single interactive session: a remote desktop connection takes it over, and the QR reader, which behaves like a keyboard, is left without a window. This cannot be worked around in code, so maintenance is done with a tool that mirrors the session, and the app brings its focus back on its own within one second.
The app started twice
On the unattended computers we saw duplicate processes and restart loops: a serial port still in use, a file lock that was not atomic, an old supervisor left running. We fixed them one by one, with retries, a Windows mutex and cleanup of leftover processes.
New firmware without a "dead" turnstile
Before writing new firmware, the app saves the existing firmware from the board; if saving fails, it writes nothing. If a write fails, it restores the copy. The errors on two boards turned out to be socket contacts, not software.
Status on 7 Nov 2026: the production server is installed in Buzău; remote code updates are implemented and tested locally, and are yet to be validated on the five turnstile computers.
What Claude did on the project
We work step by step: Claude proposes a single instruction, we run it on the equipment and give it the result, then comes the next step.
What Claude did
- wrote the turnstile app and its supervisor
- wrote the central control module and the ESP32 board firmware
- analysed the logs when something did not work on site
- recorded each work session and the files changed
What we did
- wiring the boards, mounting and installation on the five computers
- on-site tests with the reader and the relay
- the requirements from the field: forced focus, pause mode, control from a single place
- the decisions, final verification and the relationship with the client
Nothing reached the turnstiles without testing, rollback steps and a person's confirmation.
Related services and projects
Access control and payments
All the parts of a paid entrance: firmware, apps, payments and reporting.
Banknote and coin payment kiosk
Cash payment at the turnstile, on Arduino and ESP32, with our own schematic and PCB.
Online ticketing app with QR codes
Online purchase, tickets by email and scanning at the entrance. Public demo with simulated payment.
Do you have turnstiles that need to take payments?
Tell us how many entrances you have, what kinds of tickets you sell and how you want people to pay. We start from the existing equipment.