joycontrol icon indicating copy to clipboard operation
joycontrol copied to clipboard

Docker Image / 2min setup

Open Pierozi opened this issue 5 years ago • 5 comments

If some of you don't want loose time to find right python version and so on.

  1. Need docker installed
  2. Need Bluetooth device ( mine is USB key )
  3. Clone this repository ( mart1nro/joycontrol ) and move your terminal on this root folder
  4. Run the docker image
docker run -ti --privileged --net=host --volume $(pwd):/joycontrol pierozi57/python-ble:latest
  1. Start DBUS
service dbus start
  1. Start Bluetoothd without input (https://github.com/mart1nro/joycontrol/issues/8)
bluetoothd --noplugin=input > /var/log/bluetoothd.log 2>&1 &disown
  1. Launch Joycontrol
python ./run_controller_cli.py PRO_CONTROLLER
  1. Do whatever you have to do

Pierozi avatar May 14 '20 21:05 Pierozi

If I use docker to run on mac, I will get an error: Address family not supported by protocol, What device are you running docker on?

lilithGao avatar May 20 '20 06:05 lilithGao

It must be because you already have bluetoothd running on your OSX, and it will be tricky to kill as it restarts automatically.

Pierozi avatar May 25 '20 07:05 Pierozi

I have the same issue on Mac, I have no time to research it, but it seems incompatible

matbeedotcom avatar May 26 '20 18:05 matbeedotcom

You might be able to stop bluetoothd on Mac with:

sudo launchctl stop com.apple.bluetoothd

pronoiac avatar Jul 16 '20 22:07 pronoiac

Dockerfile

FROM python:3.9

RUN apt update \
    && apt install -y libglib2.0-dev libhidapi-hidraw0 libhidapi-libusb0 libdbus-1-dev bluetooth usbutils git

RUN pip3 install hid aioconsole crc8 dbus-python
RUN cd / && git clone https://github.com/mart1nro/joycontrol.git

COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

WORKDIR /joycontrol
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["python3", "./run_controller_cli.py", "PRO_CONTROLLER"]

docker-entrypoint.sh

#!/bin/bash
service dbus start
echo "Starting bluetoothd"
bluetoothd --noplugin=input > /var/log/bluetoothd.log 2>&1 &
echo "Bluetoothd started"

exec "$@"
docker build --tag=joycontrol .
docker run -it --privileged --net=host --name=joycontrol -v $(pwd)/amiibo:/amiibo joycontrol

You may need to change the git clone url

FedericoHeichou avatar Apr 24 '22 11:04 FedericoHeichou