This project implements a Smart Tennis Field architecture using:
- EMQX (MQTT broker)
- InfluxDB 3 Core (time-series database)
- FastAPI ingest service
- Sensor simulator (fake publisher)
All services run with Docker Compose.
Sensor Simulator -> EMQX (MQTT)
|
v
Ingest Service
|
v
InfluxDB 3 Core
|
v
REST API
- Start all services:
docker compose up -d --build- Create an admin token:
docker exec -it influxdb3 influxdb3 create token --admin- Put the token in
.env:
INFLUX_TOKEN=YOUR_TOKEN
INFLUX_ENABLED=1- Restart the ingest service to reload
.env:
docker compose restart ingest-service- EMQX dashboard: http://localhost:18083
- InfluxDB 3 Core: http://localhost:8181
- Ingest service API: http://localhost:8000
GET /healthGET /events?limit=10POST /publish
- Host port:
2883 - Container port:
1883
If you connect from your host machine, use port 2883.
docker compose downDo not use docker compose down -v unless you want to delete InfluxDB data and regenerate tokens.
services/ingest_service/app/main.pyservices/ingest_service/app/mqtt.pyservices/ingest_service/app/influx.pyservices/ingest_service/app/config.pyquickstarts/mqtt/Dockerfile.sensordocker-compose.yml.env
-
EMQX fails to start due to port conflict:
- Change
1883to another host port indocker-compose.yml(e.g.2883:1883). - Update your host-side MQTT clients to match.
- Change
-
InfluxDB auth errors:
- Ensure
INFLUX_TOKENis set in.envand restartingest-service. - If the volume was deleted, regenerate the admin token.
- Ensure
-
Ingest service can’t connect to MQTT:
- Confirm
emqxcontainer is running:docker compose ps. - Check logs:
docker compose logs emqx ingest-service.
- Confirm
- Keep changes focused and scoped per commit.
- Prefer Docker Compose for local testing.
- Update
README.mdorPhases.mdwhen behavior or workflow changes.
- MQTT working
- Ingest service MVP
- InfluxDB persistence
- Vision pipeline planned