Tuesday, 25 August 2020

Cock Hero Machine now on Linux!

Good news everyone! New CHM Python3 script for Linux is now available at GitHub!



Ubuntu example:

To run the script in Ubuntu is quite easy since Ubuntu already comes with Python3 installed,

just download the necessary libraries:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install python3-pip
$ sudo apt install python3-opencv
$ sudo apt install python3-tk
$ sudo apt install python3-xlib
$ sudo apt-get install python3-pil.imagetk
$ pip3 install pyscreenshot
$ pip3 install pyxhook
$ pip3 install pyserial
$ pip3 install pygame
$ pip3 install mss
$ pip3 install pillow


and run the program:

$ python3 ./CHM_FOLDER*/CHMachine.py
*Change this with the script  location on your machine

If the serial port does not work, it might be necessary to set access permission:

$ sudo chmod 777 /dev/YOURSERIALPORT*

*Change this with the CHMachine serial port on your machine


Bluetooth CHM:

If you have a Bluetooth CHM, after you've paired it with your computer you may need to bind the Bluetooth device to the serial port, use the hcitool and rfcomm commands. Example:

Scan for Bluetooth devices:
 
#hcitool scan
Scanning ...
    20:15:12:08:62:95   HC-05


Now bind the serial port rfcomm0 using the rfcomm command:

#sudo rfcomm bind 0 20:15:12:08:62:95 1

then set permission to the port:

#sudo chmod 777 /dev/rfcomm0

Now fire up the CHM, launch the software and hit connect. Have fun!