{"id":14977897,"url":"https://github.com/allyndawn/remote-roller","last_synced_at":"2026-02-11T08:39:17.274Z","repository":{"id":67411193,"uuid":"337796485","full_name":"allyndawn/remote-roller","owner":"allyndawn","description":"Internet of Things - AWS IoT powered MQTT based two terminal dice rolling game using Raspberry Pi Zero W and OpenCV.","archived":false,"fork":false,"pushed_at":"2021-03-14T20:13:10.000Z","size":5740,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T11:40:39.154Z","etag":null,"topics":["aws-iot","mqtt","opencv","raspberry-pi-camera","raspberry-pi-zero-w"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allyndawn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-02-10T17:16:19.000Z","updated_at":"2024-02-01T21:18:42.000Z","dependencies_parsed_at":"2023-07-26T12:32:13.230Z","dependency_job_id":null,"html_url":"https://github.com/allyndawn/remote-roller","commit_stats":null,"previous_names":["allyndawn/remote-roller"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/allyndawn/remote-roller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allyndawn%2Fremote-roller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allyndawn%2Fremote-roller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allyndawn%2Fremote-roller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allyndawn%2Fremote-roller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allyndawn","download_url":"https://codeload.github.com/allyndawn/remote-roller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allyndawn%2Fremote-roller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29330056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aws-iot","mqtt","opencv","raspberry-pi-camera","raspberry-pi-zero-w"],"created_at":"2024-09-24T13:56:30.513Z","updated_at":"2026-02-11T08:39:17.239Z","avatar_url":"https://github.com/allyndawn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remote-roller\n\nAn AWS IoT powered MQTT based two terminal dice rolling game using OpenCV and a pair of Raspberry Pi Zero W.\n\nWork in progress.\n\n## Hardware\n\nTwo of each of the following. One for each \"player\"\n\n- [Raspberry Pi Zero W](https://www.raspberrypi.org/products/raspberry-pi-zero-w/)\n- [Raspberry Pi Camera V2.1](https://www.raspberrypi.org/products/camera-module-v2/)\n- [Raspbbery Pi Zero Camera Case](https://www.raspberrypi.org/products/raspberry-pi-zero-case/)\n- [Raspberry Pi Camera Focus Adjustment Tool](https://www.adafruit.com/product/3518)\n- [SparkFun 16x2 Serial LCD (16397)](https://www.sparkfun.com/products/16397)\n- [Lighted Pushbutton, Green, Momentary (1440)](https://www.adafruit.com/product/1440)\n- [Forged Gaming Dice Tray, White](https://forgedgaming.com/products/copy-of-dice-arena-dice-rolling-tray-and-storage?variant=11773653712932)\n- Dice\n- Chemistry Ring Stand\n- Miscellaneous hook up wires\n\n## Cloud Setup\n\n- Login to your [AWS IoT Console](https://us-west-2.console.aws.amazon.com/iot/home?region=us-west-2#/thinghub)\n- Under Secure \u003e Policies, create the following policy, name it `remote_roller_player_policy`\n- Note: The Resource ARN will be auto-filled for you as you add each Action. You will need to edit the end of the Resource to get the correct client, topic and topicfilters shown below. However, do not change the rest of the ARN.\n\n```\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"iot:Connect\",\n      \"Resource\": \"arn:aws:iot:us-west-2:xxxxxxxxxxxx:client/player*\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"iot:Publish\",\n      \"Resource\": \"arn:aws:iot:us-west-2:xxxxxxxxxxxx:topic/player*/roll\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"iot:Subscribe\",\n      \"Resource\": \"arn:aws:iot:us-west-2:xxxxxxxxxxxx:topicfilter/player*/roll\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"iot:Receive\",\n      \"Resource\": \"arn:aws:iot:us-west-2:xxxxxxxxxxxx:topic/player*/roll\"\n    }\n  ]\n}\n```\n\n- Next, under Manage \u003e Things, create three Things: `player_one`, `player_two` and `player_monitor`\n- Save their certificates into a `.awskeys` folder on each device as you create them\n- Be sure to add the Policy created above to each Things certificates\n\n## Wiring\n\n- Connect the LCD RAW to 3.3V (e.g. J8:1)\n- Connect the LCD GND to GND (e.g. J8:6)\n- Connect the LCD RXD to GPIO 15 (TXD) (J8:8)\n- Connect the Pushbutton GND to GND (e.g. J8:9)\n- Connect the Pushbutton LED anode through a 330 ohm resistor to GPIO 9 (J8:5)\n- Connect one side of the Pushbutton switch to GPIO7 (J8:7)\n- Connect the Pushbutton LED cathode and other side of the Pushbutton switch to GND (e.g. J8:9)\n- Connect the camera to the Raspberry Pi 22-pin connector\n\n## Raspberry Pi Configuration\n\n- Connect an HDMI cable and keyboard\n- Wait for the GUI to boot.\n- Complete setup.\n- Open Preferences (under the Raspberry) and select Boot to CLI (not GUI)\n- Use the GUI or `raspi-config` to disable the linux terminal and enable the serial port\n- Use the GUI or `raspi-config` to enable the camera port\n- After doing this, ` ls -la /dev/serial0` should show `/dev/serial0 -\u003e ttyS0`\n- Reboot (to CLI)\n- Add the following to `~/.bashrc` (or `~/.zshenv`) replacing the xxx with your Thing's details\n- One Thing should be named `player_one` and the other `player_two`\n- The monitoring system should be named `player_monitor`\n\n```\nexport AWS_ROOT_CA=\"/home/pi/.awskeys/AmazonRootCA1.pem\"\nexport AWS_IOT_ENDPOINT=\"xxxxxxxxxxxxxx-ats.iot.us-west-2.amazonaws.com\"\nexport AWS_IOT_CERTIFICATE=\"/home/pi/.awskeys/xxxxxxxxxx-certificate.pem.crt\"\nexport AWS_IOT_PRIVATE_KEY=\"/home/pi/.awskeys/xxxxxxxxxx-private.pem.key\"\nexport AWS_IOT_THING_NAME=\"player_one\"\n\n```\n- Run the following command to check WiFi signal strength. Update wpa_supplicant.conf to use strong networks.\n- `python3 iwlistparse.py`\n\n- Run the following commands to set up dependencies\n```\npython3 -m pip install awsiotsdk\npip install gpiozero\npip install pyserial\nsudo apt-get update\nsudo apt-get upgrade\nsudo apt-get install libssl-dev\nsudo apt-get install build-essential cmake pkg-config\nsudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev\nsudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev\nsudo apt-get install libxvidcore-dev libx264-dev\nsudo apt-get install libgtk2.0-dev libgtk-3-dev\nsudo apt-get install libatlas-base-dev gfortran\nsudo apt-get install libqtgui4\nsudo modprobe bcm2835-v4l2\nsudo apt-get install libqt4-test\nsudo apt-get install python3-dev\nsudo apt-get install python3-pip\npip3 install opencv-python\nsudo apt-get install python-opencv\npip install numpy\npip install sklearn\n```\n\n## Raspberry Pi Pre-check\n- Use `raspistill -o ./image.jpg` to capture an image from the camera\n- Use the focus tool to adjust the image focus (the factory default is out at infinity)\n- Run `python3 serialtest.py3` and ensure \"Hello World\" is displayed on the LCD\n- Run `python3 toggle.py3` and ensure pressing the pushbutton toggles the pushbutton LED\n- (Press Ctrl-C to exit)\n- Run `python3 dicereader.py3` and ensure it is able to count the pips on `image.jpg` captured above\n- You can examine the `processed.png` output file to see what it saw\n\n## Launch the Monitor\n- Run `python3 monitor.py3` and ensure the device is able to connect to AWS\n\n## Launch the \"Remote Roller\" Script on each Raspberry Pi\n- Run `python3 rr.py3`, ensure each device is able to connect to AWS and enjoy the game!\n\n## Sample Images\n- Sample image before processing:\n\n![Before](/sampledata/image.jpg)\n\n- Sample image after processing:\n\n![After](/sampledata/processed.png)\n\n## Props\n\n- Quentin Golsteyn https://golsteyn.com/projects/dice/ for a great example of using OpenCV to read dice\n- Hugo Chargois for his WiFi strength parsing script (iwlistparse.py)\n- Unlocked Lab for [OpenCV Raspberry Pi setup instructions](https://www.youtube.com/watch?v=cmPz6bfIOEU) that work!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallyndawn%2Fremote-roller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallyndawn%2Fremote-roller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallyndawn%2Fremote-roller/lists"}