{"id":16156595,"url":"https://github.com/oklahomer/go-raspi-training","last_synced_at":"2026-04-30T14:37:37.945Z","repository":{"id":150310216,"uuid":"261760038","full_name":"oklahomer/go-raspi-training","owner":"oklahomer","description":"A learning project to interact with Raspberry Pi using periph.io","archived":false,"fork":false,"pushed_at":"2020-10-05T12:24:01.000Z","size":1167,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-30T14:37:35.401Z","etag":null,"topics":["golang","iot","periphio","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Go","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/oklahomer.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,"publiccode":null,"codemeta":null}},"created_at":"2020-05-06T13:02:01.000Z","updated_at":"2022-06-23T03:05:10.000Z","dependencies_parsed_at":"2023-07-26T14:15:05.911Z","dependency_job_id":null,"html_url":"https://github.com/oklahomer/go-raspi-training","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oklahomer/go-raspi-training","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fgo-raspi-training","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fgo-raspi-training/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fgo-raspi-training/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fgo-raspi-training/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oklahomer","download_url":"https://codeload.github.com/oklahomer/go-raspi-training/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fgo-raspi-training/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32468009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"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":["golang","iot","periphio","raspberry-pi"],"created_at":"2024-10-10T01:45:23.985Z","updated_at":"2026-04-30T14:37:37.926Z","avatar_url":"https://github.com/oklahomer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\nThis repository contains some example codes and instructions to use `periph.io` library for Raspberry Pi interaction.\nSix years ago, the author used Python to work with Raspberry Pi and it worked pretty well.\nAs a matter of fact, reading [picamera](https://github.com/waveform80/picamera)'s code and [trying out its latest feature](https://blog.oklahome.net/2014/11/trying-out-picameras-overlay-function.html) was a lot of fun.\n\nLately, the author prefers to write Golang for private project in favor of type-safety and compiled single binary.\nThis project aims to prep the author to use Golang for Raspberry Pi interaction.\n\n`Periph.io`'s library is used as it has no C dependency, and hence cross-compilation is easier.\n\n# Examples\n- [Blink LED](https://github.com/oklahomer/go-raspi-training/tree/master/example/001-blink-led)\n- [Read tactile switch state](https://github.com/oklahomer/go-raspi-training/tree/master/example/002-read-tactile-switch)\n- [Measure temperature with ADT7410](https://github.com/oklahomer/go-raspi-training/tree/master/example/003-i2c/adt7410)\n\n# Cross Compile\nTake a look at `uname -a` output to decide options to cross-compile Go code.\n```\npi@raspberrypi:~ $ uname -a\nLinux raspberrypi 5.4.35-v7l+ #1314 SMP Fri May 1 17:47:34 BST 2020 armv7l GNU/Linux\npi@raspberrypi:~ $ cat /proc/cpuinfo\nprocessor\t: 0\nmodel name\t: ARMv7 Processor rev 3 (v7l)\nBogoMIPS\t: 135.00\nFeatures\t: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 \nCPU implementer\t: 0x41\nCPU architecture: 7\nCPU variant\t: 0x0\nCPU part\t: 0xd08\nCPU revision\t: 3\n\nprocessor\t: 1\nmodel name\t: ARMv7 Processor rev 3 (v7l)\nBogoMIPS\t: 135.00\nFeatures\t: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 \nCPU implementer\t: 0x41\nCPU architecture: 7\nCPU variant\t: 0x0\nCPU part\t: 0xd08\nCPU revision\t: 3\n\nprocessor\t: 2\nmodel name\t: ARMv7 Processor rev 3 (v7l)\nBogoMIPS\t: 135.00\nFeatures\t: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 \nCPU implementer\t: 0x41\nCPU architecture: 7\nCPU variant\t: 0x0\nCPU part\t: 0xd08\nCPU revision\t: 3\n\nprocessor\t: 3\nmodel name\t: ARMv7 Processor rev 3 (v7l)\nBogoMIPS\t: 135.00\nFeatures\t: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 \nCPU implementer\t: 0x41\nCPU architecture: 7\nCPU variant\t: 0x0\nCPU part\t: 0xd08\nCPU revision\t: 3\n\nHardware\t: BCM2711\nRevision\t: b03112\nSerial\t\t: 100000002d01a8c3\nModel\t\t: Raspberry Pi 4 Model B Rev 1.2\n```\n\nThe above output indicates the Raspberry Pi's model is `ARMv7`.\nFor such model, The official [GoArm](https://github.com/golang/go/wiki/GoArm) wiki tells to use the GOARM value of `7` and GOARCH value of `arm` for build.\n```\n$ env GOOS=linux GOARCH=arm GOARM=7 go build ./example/XXX-foo-bar/main.go\n```\n\nTo run this, `scp` the resulting executable to the Raspberry Pi as below.\nRemember the IP address varies.\n```\nscp main pi@192.168.2.111:~/main\npi@192.168.2.111's password: \nmain\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklahomer%2Fgo-raspi-training","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foklahomer%2Fgo-raspi-training","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklahomer%2Fgo-raspi-training/lists"}