Metadata-Version: 2.4
Name: openflexure-gamepad-client
Version: 0.1.0
Summary: Gamepad interface for the OpenFlexure Microscope Server (v3)
Author-email: OpenFlexure Project <contact@openflexure.org>
License: GPL-3.0-only
License-File: LICENSE
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: numpy>=1.17.0
Requires-Dist: pigamepad==0.1.1
Requires-Dist: requests~=2.28
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: codespell~=2.4; extra == 'dev'
Requires-Dist: mypy[reports]; extra == 'dev'
Requires-Dist: ruff~=0.15.1; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# OpenFlexure Gamepad Client

Control an OpenFlexure Microscope with a gamepad.

This was previously called "OpenFlexure Microscope SNESClient" as the first (and currently only) controller supported is a USB SNES client.


### Install

On an OpenFlexure microscope with a v3 microscope server you can install by running:

```
ofm activate
pip install openflexure-gamepad-client
```

### Run the gamepad-client

To run the gampade client manually you can run

```
sudo -u openflexure-ws env "PATH=$PATH" openflexure-gamepad-client
```

When you close this terminal or exit the program it will stop.

### Run as a service

For the gamepad to always be running you can create a systemd service.

To create the service run:

`sudo nano /etc/systemd/system/openflexure-gamepad.service`

and paste in

```
[Unit]
Description=Python script to control the OpenFlexure Microscope with a gamepad
After=network.target

[Service]
User=openflexure-ws
WorkingDirectory=/var/openflexure/
ExecStart=/var/openflexure/application/openflexure-microscope-server/.venv/bin/openflexure-gamepad-client

[Install]
WantedBy=multi-user.target
```

Reload systemd so it sees the new service

```
sudo systemctl daemon-reload
```

Enable the service so it starts on boot, and also start it now

```
sudo systemctl enable --now openflexure-gamepad.service
```

To check status

```
sudo systemctl status openflexure-gamepad.service
```

View logs

```
journalctl -u openflexure-gamepad.service -f
```
