{"id":37214257,"url":"https://github.com/sweetbit-io/sweetbit","last_synced_at":"2026-01-15T00:47:39.481Z","repository":{"id":38456292,"uuid":"135062262","full_name":"sweetbit-io/sweetbit","owner":"sweetbit-io","description":"🔌 Sweet daemon for pairing and control of the Bitcoin-enabled candy dispenser","archived":false,"fork":false,"pushed_at":"2023-03-02T08:16:02.000Z","size":3092,"stargazers_count":49,"open_issues_count":28,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-18T23:16:34.997Z","etag":null,"topics":["bitcoin","candy","dispenser","hardware","lightning","network","sweetbit"],"latest_commit_sha":null,"homepage":"https://sweetbit.io","language":"Go","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/sweetbit-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://sweetbit.io"}},"created_at":"2018-05-27T16:13:45.000Z","updated_at":"2023-09-22T15:37:55.000Z","dependencies_parsed_at":"2024-01-15T01:07:46.952Z","dependency_job_id":"baa54ca1-28b4-4998-b426-5459efa670f6","html_url":"https://github.com/sweetbit-io/sweetbit","commit_stats":{"total_commits":195,"total_committers":2,"mean_commits":97.5,"dds":0.00512820512820511,"last_synced_commit":"7ed139efabaebdf36ee35839ddbe02b53cf9501a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sweetbit-io/sweetbit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbit-io%2Fsweetbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbit-io%2Fsweetbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbit-io%2Fsweetbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbit-io%2Fsweetbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sweetbit-io","download_url":"https://codeload.github.com/sweetbit-io/sweetbit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbit-io%2Fsweetbit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"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":["bitcoin","candy","dispenser","hardware","lightning","network","sweetbit"],"created_at":"2026-01-15T00:47:38.914Z","updated_at":"2026-01-15T00:47:39.467Z","avatar_url":"https://github.com/sweetbit-io.png","language":"Go","funding_links":["https://sweetbit.io"],"categories":[],"sub_categories":[],"readme":"# 🔌 `sweetd`\n\n[![license](https://img.shields.io/github/license/the-lightning-land/sweetd.svg)](https://github.com/the-lightning-land/sweetd/blob/master/LICENSE)\n[![release](https://img.shields.io/github/release/the-lightning-land/sweetd.svg)](https://github.com/the-lightning-land/sweetd/releases)\n\n\u003e Sweet daemon for pairing and control of the Bitcoin-enabled candy dispenser\n\n## Intro\n\n`sweetd` is the daemon process running on the Bitcoin-enabled candy dispenser.\nIt manages pairing and control, which is used by the Candy Dispenser app:\n\n* 📱 [Candy Dispenser iOS app](https://github.com/the-lightning-land/Dispenser-iOS)\n* 📱 *Candy Dispenser Android app coming in the future*\n\nThe `sweetd` program offers the following features:\n\n* [x] 🍬 Control of the motor for dispensing candy\n* [x] 📳 Control of the buzzer for user feedback\n* [x] ☝️ React on events from the touch sensor\n* [x] 🔵 Pair through Bluetooth\n* [x] 🌐 Set up Wi-Fi on candy dispenser\n* [x] ⚡ Dispense candy on payments from remote `lnd` node\n* [x] 💅 Customize name of your dispenser\n* [x] 🔄 Update itself through app\n* [x] ⚙️ Ensure all system configs are made\n\n## Download\n\nDownload the pre-built binary for your system from the GitHub releases page.\n\n* ⬇️ [Download `sweetd`](https://github.com/the-lightning-land/sweetd/releases)\n\nExtract and open the downloaded archive, then run `sweetd`.\n\n## Structure\n\nThe `sweetd` program's source code is split into small modules:\n\n* 🔌 [`api`](api) - REST api for remote management of the dispenser\n* ⚙️ [`app`](app) - website for managing the dispenser\n* 🍬 [`dispenser`](dispenser) - orchestrator for everything the dispenser does\n* ⚡️ [`lightning`](lightning) - controller for configured Lightning nodes, remote and local\n* 🔩️ [`machine`](machine) - hardware controller for the touch sensor, motor and buzzer\n* 📶 [`network`](network) - network subsystem that handles Wi-Fi discovery and connectivity\n* 🤹‍ [`nodeman`](nodeman) - node manager\n* 🧅 [`onion`](onion) - Tor onion service conveniences and .onion address generation\n* 📲 [`pairing`](pairing) - pairing controller for BLE pairing\n* 💵 [`pos`](pos) - point-of-sale website that creates invoices\n* 🛑 [`reboot`](reboot) - methods for rebooting and shutting down the system \n* 📁 [`sweetdb`](sweetdb) - persistent database manager\n* 📃 [`sweetlog`](sweetlog) - logging middleware for intercepting logs\n* 🔖 [`sysid`](sysid) - methods for determining a system-specific id\n* 🔄 [`updater`](updater) - update subsystem that controls system updates\n\n## Configure data directory\n\nBy default, `sweetd` stores all data to `./data`.\nYou can easily override this location:\n\n```sh\nsweetd --datadir=/data/sweetd\n``` \n\n## Configure machine access\n\nCurrently, the `sweetd` program is only tested and executed on a Raspberry Pi.\nRunning the executable with no options is the same as providing the following\noptions:\n\n```sh\nsweetd \\\n  --machine=raspberry \\\n  --raspberry.touchpin=25 \\\n  --raspberry.motorpin=23 \\\n  --raspberry.buzzerpin=24\n```\n\nYou can also mock the underlying machine with the following option:\n\n```sh\nsweetd \\\n  --machine=mock \\\n  --mock.listen=localhost:5000\n```\n\nWith this option, you can fake touches by sending simple\nHTTP requests to the mock machine:\n\n```\ncurl http://localhost:5000/touch/on\ncurl http://localhost:5000/touch/off\n```\n\n## Configure the `sweetd` API server\n\n`sweetd` exposes a gRPC API. It can be used to configure the\nWi-Fi network that the candy dispenser connects to,\npersonalize it and change settings.\n\nBy default, the API server listens on `0.0.0.0:9000`. This can be changed\nwith the following option:\n\n```sh\nsweetd --listen=localhost:9000\n```\n\nIt's also possible to specify multiple `--listen` options and\nlisten to multiple interfaces at once.\n\n## Enable Wi-Fi hotspot pairing\n\nAt the moment, the only app pairing mechanism is through a Wi-Fi hotspot\nthat is created by the `sweetd` program.\n\nThis feature needs to be activated first:\n\n```sh\nsweetd --ap\n```\n\nMake sure that the following dependencies are installed when\nrunning the access point mode:\n\n```\nhostapd wireless-tools wpasupplicant dnsmasq iw\n```\n\nThe access point is configured with the below defaults. Any of these\ncan be changed to your needs.\n\n```sh\nsweetd \\\n  --ap \\\n  --ap.ip=192.168.27.1/24 \\\n  --ap.interface=uap0 \\\n  --ap.ssid=candy \\\n  --ap.passphrase=reckless \\\n  --ap.dhcprange=192.168.27.100,192.168.27.150,1h\n```\n\nThis will create a Wi-Fi network called `candy` with the passphrase `reckless`.\nAn app will connect to that network for pairing and use\nthe gRPC api that is provided by the `sweetd` program.\n\n## Development\n\n`go get -d github.com/the-lightning-land/sweetd`\n\n`cd $GOPATH/src/github.com/the-lightning-land/sweetd`\n\n`go build`\n\n`./sweetd`\n\n## Releasing using [`goreleaser`](https://goreleaser.com)\n\nThe tool goreleaser can automatically sign the release and upload it to GitHub.\n\n`git tag -a v0.1.0 -m \"Release name\"`\n\n`git push origin v0.1.0`\n\n`goreleaser --rm-dist`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsweetbit-io%2Fsweetbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsweetbit-io%2Fsweetbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsweetbit-io%2Fsweetbit/lists"}