Boskicar Server - A Spring Boot application for controlling a Raspberry Pi-based car with GPIO controls.
- RESTful API for car control (forward, backward, steering)
- Joystick and throttle control
- GPIO integration with Raspberry Pi (lights, fans, motors)
- PWM control via pi-blaster
- Steering wheel calibration
- UDP message handling
- System control (shutdown, reboot, deploy)
- Java 21
- Maven 3.9+
- Docker (optional, for containerized deployment)
- Raspberry Pi with GPIO support (for hardware features)
mvn clean packagedocker build -t bcarserver .java -jar target/bcarserver-1.2.0-RELEASE.jardocker run -p 3333:3333 \
-e SERVER_PORT=3333 \
--privileged \
bcarserverNote: The --privileged flag is required for GPIO access on Raspberry Pi.
Environment variables:
SERVER_PORT: Server port (default: 3333)
POST /forward/{speed}- Move forward (speed: 0-100)POST /backward/{speed}- Move backward (speed: 0-100)POST /stop- Stop all movementPOST /joystick/{angle}/{strength}- Joystick control (angle: 0-360, strength: 0-100)POST /throttle/{fbOrderSpeed}/{lrStrength}- Throttle controlPOST /steeringwheel/{angle}- Set steering wheel angle (0-180)
POST /lights/{status}- Control lights (ON/OFF)POST /fans/{status}- Control fans (ON/OFF)POST /mobilecontrol/{status}- Enable/disable mobile control (ON/OFF)POST /enginecontrol/{status}- Enable/disable engine control (ON/OFF)POST /steeringwheelcontrol/{status}- Enable/disable steering wheel control (ON/OFF)POST /throttlecontrol/{status}- Enable/disable throttle control (ON/OFF)
GET /status/{complete}- Get system status (complete: true/false)GET /logs- Retrieve application logsPOST /calibrate/steeringwheel- Calibrate steering wheelPOST /shutdown- Shutdown systemPOST /reboot- Reboot systemPOST /deploy- Deploy new JAR file
Run tests with:
mvn testTests include:
- Context loading verification
- API endpoint integration tests
- GPIO null-safety checks (for non-hardware environments)
This application is designed to run on a Raspberry Pi with:
- GPIO pins for relay control
- ADS1015 ADC for analog input (steering wheel position sensor)
- pi-blaster for PWM control
- I2C bus for sensor communication
The application uses:
- Spring Boot 2.7.18
- Spring Integration for UDP messaging
- Pi4J for GPIO control
- Scheduled tasks for order processing (150ms intervals)
This project is licensed under the MIT License - see the LICENSE file for details.
For systemd service installation on Raspberry Pi, see scripts/boskicar.service.