← All work
Product · 2022

Smart Parcel-Locker Hardware REST Controller

Overview

A Flask REST API that bridges HTTP requests to physical Kerong CU48B parcel-locker controller boards over a serial connection. It exposes endpoints to query locker/sensor status and to unlock individual cells or entire boards, turning low-level hardware commands into a clean web interface for a self-service locker kiosk.

The Challenge

Smart parcel lockers are driven by controller boards that speak a proprietary binary serial protocol. A touchscreen kiosk front-end and back-office systems needed a simple, networked way to read door/sensor state and trigger unlocks without dealing with raw serial framing.

What We Built

A Flask + Flask-RESTful API (api/app.py) with routes such as GET /cu48b/<board_id> (read lockers and sensors), DELETE /cu48b/<board_id> (unlock all), and POST /cu48b/<board_id>/<locker_id> (open a specific cell). A service layer (service/Cu48b.py, service/KerongCommProtocol.py) implements the CU48B command protocol over pyserial; scan_ports.py discovers serial ports. A conf.sh provisions the deployment as a kiosk, rotating the display via xrandr, calibrating an ILITEK touch panel with xinput, and launching Chrome in --kiosk mode against the web app. A Postman collection documents the API.

Technologies & Approach

Lightweight Flask with CORS so a browser kiosk can call it directly; pyserial for the RS-485/serial link to the Kerong boards. The kiosk shell is plain Linux tooling (xrandr, xinput, Chrome kiosk) for a fixed-function appliance.

Outcome / Impact

Delivered a working hardware-to-HTTP bridge that let a touchscreen kiosk and external systems operate physical lockers through simple REST calls, proving out the full path from web request to a clicking solenoid. Archived after the build.

Capabilities Demonstrated

  • Bridging physical hardware to clean REST APIs
  • IoT device control over serial / proprietary protocols
  • Linux kiosk provisioning for self-service appliances
  • API documentation and testability (Postman)
More work See all →