The User Journey
The core of the system is a seamless "Pay-Code-Pump" workflow. This section breaks down the driver's experience and the background processes triggered at each step.
Payment
M-Pesa / Card
Authorization
Token Generation
Authentication
Input Code at Pump
Dispensing
Fuel Release
Step 1: Payment Initiation
Driver selects amount on the Mobile App or USSD menu. The system triggers an STK Push (M-Pesa Express) to the user's phone.
POST /mpesa/stkpush
{
"Amount": 1000,
"PhoneNumber": "2547XXXXXXXX",
"AccountReference": "PumpStation01"
}
System Architecture
Click on any component in the diagram to view technical specifications.
Daraja / Visa API
Node.js + Redis
Translates HTTP requests from Cloud to Serial commands for Hardware.
Select a component
Click on the diagram blocks to view detailed specifications, required libraries, and integration notes.
PTS-2 Controller Integration
The PTS-2 controller is the bridge between software and dispensers. Use the simulator below to generate traffic, then use Gemini AI to diagnose the logs.
Command Builder
Terminal Output
✨ Gemini Analysis
Protocol: RS-485
The physical layer connection. Requires a USB-to-RS485 converter.
Packet Structure
[STX][LEN][CMD][DATA][CRC][ETX]. All communication is hex-encoded.
State Polling
Middleware must poll status every 200ms to detect nozzle lift.
AI Implementation Copilot ✨
Generate custom M-Pesa callbacks, Python PTS-2 polling scripts, or get instant answers to technical questions using Gemini.
Quick Prompts
Business Case & ROI
Automation reduces theft ("kitu kidogo" loss), lowers labor costs, and increases throughput speed.
Loss from cash handling errors or theft.