{"id":14036924,"url":"https://github.com/jhpyle/docassemble-rpi","last_synced_at":"2025-04-13T23:13:40.391Z","repository":{"id":91864433,"uuid":"230678603","full_name":"jhpyle/docassemble-rpi","owner":"jhpyle","description":"A test interview for running Docassemble on the Raspberry Pi","archived":false,"fork":false,"pushed_at":"2020-01-05T22:21:57.000Z","size":9,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T13:21:59.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/jhpyle.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-28T23:13:37.000Z","updated_at":"2024-04-10T15:17:27.000Z","dependencies_parsed_at":"2024-01-29T07:29:35.395Z","dependency_job_id":"eaaa4614-0bc6-4ab3-bea5-955110333d12","html_url":"https://github.com/jhpyle/docassemble-rpi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Fdocassemble-rpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Fdocassemble-rpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Fdocassemble-rpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Fdocassemble-rpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhpyle","download_url":"https://codeload.github.com/jhpyle/docassemble-rpi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794569,"owners_count":21162615,"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":[],"created_at":"2024-08-12T03:02:19.731Z","updated_at":"2025-04-13T23:13:40.363Z","avatar_url":"https://github.com/jhpyle.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"This package demonstrates how Docassemble can be integrated with the \r\nRaspberry Pi, using a Christmas-themed interview, a red LED, and a \r\ngreen LED.\r\n[See a video of the interview in action](https://twitter.com/docassemble/status/1211025053263040512)\r\n\r\nUse a Raspberry Pi with at least 4GB of RAM.\r\n\r\nConnect pin 23 to the positive end of a green LED.  \r\nConnect the negative end of the LED to a 220 ohm resistor, and connect the \r\nother end of the resistor to ground (pin 22 or pin 25).\r\n\r\nDo the same for pin 24, except use a red LED.\r\n\r\nThe idea is that 5 volts on pin 23 or 24 will cause current to flow through\r\nthe LED.\r\n\r\nInstall Docker on the Raspberry Pi and grant access to the user `pi`:\r\n\r\n```\r\nsudo apt-get -y install docker.io\r\nsudo usermod -a -G docker pi\r\n```\r\n\r\nYou might need to restart the Raspberry Pi after doing `usermod` in order to ensure\r\nthat the user `pi` can run Docker commands.\r\n\r\nSince the standard images are not built for the ARM architecture, you need to build\r\nthem yourself.\r\n\r\n```\r\ngit clone https://github.com/jhpyle/docassemble-os\r\ncd docassemble-os\r\ndocker build -t jhpyle/docassemble-os .\r\ncd ..\r\ngit clone https://github.com/jhpyle/docassemble\r\ncd docassemble\r\ndocker build -t jhpyle/docassemble .\r\ncd ..\r\n```\r\n\r\nThis will take several hours.\r\n\r\nThen create a Docassemble container that has privileged access:\r\n\r\n```\r\ndocker run --privileged --restart=always --stop-timeout=600 -d -p 80:80 --env DAPYTHONVERSION=3 jhpyle/docassemble\r\n```\r\n\r\nNext, `docker exec` inside of the container.\r\n\r\nGive the user `www-user` (inside the container) access to `/dev/gpiomem`.\r\nOn the Raspberry Pi host, the owner of this file is `root` and the group is\r\n`gpio`.  But the group `gpio` does not exist inside the container.\r\nWhen you do `ls -l /dev/gpiomem` inside the container, you will likely see that \r\nthe \"group\" for the file is a number, like 997.  It might be something else for\r\nyou.  You need to add the user `www-data` to that group so that the Docassemble\r\nweb application can access the GPIO pins of the Raspberry Pi.  But if the group \r\nis a number, you can't add the user to the group, so first create the group, and\r\nthen add `www-data` to it:\r\n\r\n```\r\naddgroup --gid 997 gpio\r\naddgroup www-data gpio\r\n```\r\n\r\nThen restart the services:\r\n\r\n```\r\nsupervisorctl start reset\r\n```\r\n\r\nBecause the processor is underpowered, things can take a very long time.\r\ncheck `supervisorctl status` to see what is happening, and be patient.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhpyle%2Fdocassemble-rpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhpyle%2Fdocassemble-rpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhpyle%2Fdocassemble-rpi/lists"}