Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Image / 2min setup #46

Open
Pierozi opened this issue May 14, 2020 · 5 comments
Open

Docker Image / 2min setup #46

Pierozi opened this issue May 14, 2020 · 5 comments

Comments

@Pierozi
Copy link

Pierozi commented May 14, 2020

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 (Incompatibility with bluetooth "input" plugin #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 Pierozi changed the title Docker Image / 2min setup 🙌 Docker Image / 2min setup May 14, 2020
@lilithGao
Copy link

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?

@Pierozi
Copy link
Author

Pierozi commented May 25, 2020

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

@matbee-eth
Copy link

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

@pronoiac
Copy link

You might be able to stop bluetoothd on Mac with:

sudo launchctl stop com.apple.bluetoothd

@FedericoHeichou
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants