{"id":19069592,"url":"https://github.com/cncjs/cncjs-pendant-ps3","last_synced_at":"2025-04-28T14:11:16.322Z","repository":{"id":57201698,"uuid":"80450876","full_name":"cncjs/cncjs-pendant-ps3","owner":"cncjs","description":"Dual Shock / PS3 Bluetooth Remote Pendant for CNCjs","archived":false,"fork":false,"pushed_at":"2022-05-07T04:59:55.000Z","size":21,"stargazers_count":23,"open_issues_count":6,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-18T16:30:09.990Z","etag":null,"topics":["bluetooth","cnc","pendant","ps3","ps3-controller","raspberry-pi"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cncjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-30T18:38:13.000Z","updated_at":"2024-09-27T15:59:44.000Z","dependencies_parsed_at":"2022-09-17T06:21:03.136Z","dependency_job_id":null,"html_url":"https://github.com/cncjs/cncjs-pendant-ps3","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-pendant-ps3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-pendant-ps3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-pendant-ps3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-pendant-ps3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cncjs","download_url":"https://codeload.github.com/cncjs/cncjs-pendant-ps3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326849,"owners_count":21571636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth","cnc","pendant","ps3","ps3-controller","raspberry-pi"],"created_at":"2024-11-09T01:14:50.948Z","updated_at":"2025-04-28T14:11:16.302Z","avatar_url":"https://github.com/cncjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cncjs-pendant-ps3\nDual Shock / PS3 Bluetooth Remote Pendant for CNCjs\n\n----\n\nNOTE: A more up-to-date implimentation can be found at [balthisar/cncjs-pendant-gamepad](https://github.com/balthisar/cncjs-pendant-gamepad).\n\n----\n\nUse [Playstation 3 Controller](https://www.playstation.com/en-us/explore/accessories/dualshock-3-ps3/) wirelessly over bluetooth to control CNC from the host device (raspberry pi). [PS3 CNC Control Button Map](https://docs.google.com/drawings/d/1DMzfBk5DSvjJ082FrerrfmpL19-pYAOcvcmTbZJJsvs/edit?usp=sharing)\n\n[Remote Pendant (Playstation 3 Dualshock Controller / SIXAXIS Controller)](https://github.com/cheton/cnc/issues/103)\n\nUsing a wireless game controller (like a PS3 controller) seems to be one of the lowest cost \u0026 simplest solution method. See related issue [#103](https://github.com/cheton/cnc/issues/103)\n\n## Playstation Controller Setup ( general guide to connect hardware \u0026 setup )\n\nHere is what I have figured out so far for PS3 on Raspberry PI 3 w/ integrated bluetooth.\nThe bellow just shows how to get PS3 controller connected.\n\n\n## Bluetooth Configuration\n\n### Install\n```\n# Install \u0026 Enable Bluetooth Tools\nsudo apt-get install -y bluetooth libbluetooth3 libusb-dev\nsudo systemctl enable bluetooth.service\n\n# Add pi user to bluetooth group\nsudo usermod -G bluetooth -a pi\n```\n\n### Pairing Tools\n```\n# Get and build the command line pairing tool (sixpair)\nwget http://www.pabr.org/sixlinux/sixpair.c\ngcc -o sixpair sixpair.c -lusb\n\n### Connect PS3 over USB\n# Get PS3 DS \nsudo ./sixpair\n```\n\n### [Parting DualShock 3 Controller](https://wiki.gentoo.org/wiki/Sony_DualShock)\n```\n### Disonnect DualShock 3 over USB\n\n# Start bluetoothctl:\nbluetoothctl\n\n# Enable the agent and set it as default:\nagent on\ndefault-agent\n\n# Power on the Bluetooth controller, and set it as discoverable and pairable:\npower on\ndiscoverable on\npairable on\n\n### Connect DualShock 3 over USB, and press the PlayStation button.\n\n# Discover the DualShock 3 MAC address:\ndevices\n\n### Disonnect DualShock 3 over USB\n\n#Allow the service authorization request:\n#[agent]Authorize service service_uuid (yes/no): yes\n\n#Trust the DualShock 3:\n#trust device_mac_address # Replace \"MAC\" with MAC of \"Device 64:D4:BD:B3:9E:66 PLAYSTATION(R)3 Controller\"\ntrust 64:D4:BD:B3:9E:66 \n\n# The DualShock 3 is now paired:\nquit\n\n# Turn the DualShock 3 off when it's no longer in use by pressing and holding the PlayStation button for 10 seconds.\n# Press the PlayStation button to use the DualShock 3 again.\n```\n\n### Test Controller Connectivity\n```\n### PS3 Controller: press the PS button, the lights on the front of the controller should flash for a couple of seconds then stop, leaving a single light on. If you now look again at the contents of /dev/input you should see a new device, probably called something like ‘js0’:\n\n# List Devices\nls /dev/input\n```\n\n### Get Battery Level\n`cat \"/sys/class/power_supply/sony_controller_battery_64:d4:bd:b3:9e:66/capacity\"`\n\n\n### Joystick Application\n```\n# Install\nsudo apt-get -y install joystick\n\n# Usage / Test\njstest /dev/input/js0\n```\n\n----------------------------------------\n\n## Install NodeJS Libraries\n - https://www.npmjs.com/package/node-hid\n - https://www.npmjs.com/package/dualshock-controller\n\n### Node.js DS3 Controller Setup\n```\n# Install Tools\nsudo apt-get install -y libudev-dev libusb-1.0-0 libusb-1.0-0-dev build-essential git\nsudo apt-get install -y gcc-4.8 g++-4.8 \u0026\u0026 export CXX=g++-4.8\n#npm install node-gyp node-pre-gyp\n\n# Install node-hid with hidraw support\n#npm install node-hid --driver=hidraw --build-from-source --unsafe-perm\n\n# Install Pendant Package\nsudo npm install -g cncjs-pendant-ps3 --unsafe-perm  # Install Globally\n\n## If NOT installed globally, Install node-hid with hidraw support (https://github.com/rdepena/node-dualshock-controller)\n```\n\n### [Create udev Rules](https://github.com/rdepena/node-dualshock-controller#-create-udev-rules)\n```\n# Run as Root\nsudo su\n\n# You will need to create a udev rule to be able to access the hid stream as a non root user.\nsudo touch /etc/udev/rules.d/61-dualshock.rules\nsudo cat \u003c\u003cEOT \u003e\u003e /etc/udev/rules.d/61-dualshock.rules\nSUBSYSTEM==\"input\", GROUP=\"input\", MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"054c\", ATTRS{idProduct}==\"0268\", MODE:=\"666\", GROUP=\"plugdev\"\nKERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", MODE=\"0664\", GROUP=\"plugdev\"\n\nSUBSYSTEM==\"input\", GROUP=\"input\", MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"054c\", ATTRS{idProduct}==\"05c4\", MODE:=\"666\", GROUP=\"plugdev\"\nKERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", MODE=\"0664\", GROUP=\"plugdev\"\nEOT\n\n# Reload the rules, then disconnect/connect the controller.\nsudo udevadm control --reload-rules\n\nexit\n```\n\n# QUICK FIX for node-hid hidraw... PLEASE HELP IF YOU KNOW FIX\n```\n# I am having issues with node-hid --driver=hidraw not seeming to work... quickest fix is to reinstall, node-hid --driver=hidraw \n\n# Reinstall (node-hid --driver=hidraw) on cncjs-pendant-ps3\ncd /usr/lib/node_modules/cncjs-pendant-ps3/\nsudo npm install node-hid --driver=hidraw --build-from-source --unsafe-perm\n```\n\nI recommend rebooting now.\nAfter reboot you can test pendant by running `cncjs-pendant-ps3 -p \"/dev/ttyUSB0\"`.\n\n----------------------------------------\n\n# Auto Start\n\n### Install [Production Process Manager [PM2]](http://pm2.io)\n```\n# Install Production Process Manager [PM2]\nnpm install pm2 -g\n\n# Setup PM2 Startup Script\npm2 startup debian\n  #[PM2] You have to run this command as root. Execute the following command:\n  sudo su -c \"env PATH=$PATH:/home/pi/.nvm/versions/node/v4.5.0/bin pm2 startup debian -u pi --hp /home/pi\"\n\n# Start Dual Shock / PS3 Bluetooth Remote Pendant for CNCjs (conected to serail device @ /dev/ttyUSB0) with PM2\npm2 start $(which cncjs-pendant-ps3) -- -p \"/dev/ttyUSB0\"\n\n# Set current running apps to startup\npm2 save\n\n# Get list of PM2 processes\npm2 list\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncjs%2Fcncjs-pendant-ps3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcncjs%2Fcncjs-pendant-ps3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncjs%2Fcncjs-pendant-ps3/lists"}