PiBike is a modular, extensible bike computer built on Raspberry Pi.
It collects real-time data from an MPU6050 (accelerometer + gyroscope) and a GPS module, logs it to a CSV file, and can optionally stream it over WebSocket using Flask-SocketIO.
- ✅ Real-time data from MPU6050 (gyro + accel)
- ✅ Live GPS tracking (latitude, longitude, altitude, time)
- ✅ CSV logging with timestamps
- ✅ Optional WebSocket server for real-time streaming
- ✅ Feature flags via
.env
(enable/disable components) - ✅ Modular & scalable architecture
- ✅ Auto-reconnect for GPS errors or disconnections
Create a .env
file in the project root to configure what runs:
# Modules
USE_FLASK=true
USE_GYRO=true
USE_ACCEL=true
USE_GPS=true
# Sensors
SENSOR_DELAY=0.1
SERIAL_PORT=/dev/ttyS0
BAUD_RATE=115200
# Misc
TIMEZONE=Europe/Warsaw
Make sure you have Python 3.7+ and pip installed.
pip install -r requirements.txt
Run from the project root folder:
python3 -m app.main
MIT License — use, modify, and enjoy 🚴♂️💻