BioShake driver and edge service.
- Runs the bioshake machine edge service.
- Connects to NATS and translates commands into machine actions.
- Communicates with the bioshake device over serial.
- Docker and Docker Compose installed
- Python 3.14+ and
uv(for baremetal mode) - bioshake device reachable on the serial port
From repo root:
cp .env.example .envEdit .env and configure:
MACHINE_IDNATS_SERVERSBIOSHAKE_HOST_PORT— serial-device path on the Docker hostBIOSHAKE_PORT— serial-device path exposed inside the container
The example uses /dev/ttyUSB0 for both paths. Prefer a stable
/dev/serial/by-id/... value for both BIOSHAKE_HOST_PORT and
BIOSHAKE_PORT. Docker device mappings require Linux device paths; Windows
COM names are supported only in bare-metal mode. Compose uses host
networking, so NATS_SERVERS=nats://localhost:4222 is the broker on the same
machine. Recreate the container after a network-mode change; docker start
keeps the old network.
All commands below are run from repo root.
Build and start:
docker compose up -d --buildView logs:
docker compose logs -fStop:
docker compose downRun puda machine commands bioshake for the advertised commands, parameters
and safety metadata.
heat_shake(temperature, speed, duration, *, plate_seated, heatup_timeout=600, speed_timeout=60) heats and shakes as one blocking operation. It waits for a
stable temperature, ramps to speed, holds for duration seconds, and then
verifies that the heater and shaker are off, whether it succeeds or fails. Use
it instead of overlapping set_temp and shake calls. Tolerances and abort
conditions are listed in the command's docstring.
From repo root:
uv sync
uv run python main.pyLogin:
echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdinBuild:
docker compose buildPush:
docker push ghcr.io/PUDAP/bioshake-edge:latestOr with Compose:
docker compose pushOffline, with no device connected:
uv run python -m unittest discover -s tests -v