All Projects โ†’ sweetbit-io โ†’ sweetbit

sweetbit-io / sweetbit

Licence: MIT License
๐Ÿ”Œ Sweet daemon for pairing and control of the Bitcoin-enabled candy dispenser

Programming Languages

go
31211 projects - #10 most used programming language
javascript
184084 projects - #8 most used programming language
BitBake
79 projects
shell
77523 projects

Projects that are alternatives of or similar to sweetbit

sweet-lightning
โšก๏ธ Pay for your candy with Bitcoin over Lightning
Stars: โœญ 18 (-62.5%)
Mutual labels:  candy, dispenser
streamdeck
Golang API for the Corsair / Elgato StreamDeck
Stars: โœญ 46 (-4.17%)
Mutual labels:  hardware
azalea
main board for the GreatFET project, also known as GreatFET One
Stars: โœญ 52 (+8.33%)
Mutual labels:  hardware
pioreactor
Hardware and software for accessible, extensible, and scalable bioreactors. Built on Raspberry Pi.
Stars: โœญ 28 (-41.67%)
Mutual labels:  hardware
zevoicemask
An open source DIY implemetation of a face mask with voice visuals and animations.
Stars: โœญ 13 (-72.92%)
Mutual labels:  hardware
super-sixteen
Code and schematics for the Super Sixteen Eurorack sequencer
Stars: โœญ 90 (+87.5%)
Mutual labels:  hardware
lwow
Lightweight onewire protocol library optimized for UART hardware on embedded systems
Stars: โœญ 98 (+104.17%)
Mutual labels:  hardware
lewis
Let's write intricate simulators!
Stars: โœญ 17 (-64.58%)
Mutual labels:  hardware
dsensor
๐Ÿ“ˆ Digital universal particle concentration sensor โฒ๏ธ
Stars: โœญ 13 (-72.92%)
Mutual labels:  hardware
docker
Scripts to build and use docker images including GHDL
Stars: โœญ 27 (-43.75%)
Mutual labels:  hardware
awesome-open-source-synths
Awesome Open Source Synths List!
Stars: โœญ 64 (+33.33%)
Mutual labels:  hardware
remote refocus
A scientific publication, describing a way to improve microscopy. This repository hosts everything you need to reproduce our results. Read the publication here: https://andrewgyork.github.io/remote_refocus/
Stars: โœญ 13 (-72.92%)
Mutual labels:  hardware
nanopos
A simple Lightning โšก point-of-sale system, powered by Lightning Charge
Stars: โœญ 95 (+97.92%)
Mutual labels:  lightning
hardware-attacks-state-of-the-art
Microarchitectural exploitation and other hardware attacks.
Stars: โœญ 29 (-39.58%)
Mutual labels:  hardware
lightning-xchain-atomic-swap
Lightning Cross Chain Atomic Swap
Stars: โœญ 16 (-66.67%)
Mutual labels:  lightning
Plaid-Pad
Build guide and additional hardware for the Plaid-Pad mechanical macro pad.
Stars: โœญ 39 (-18.75%)
Mutual labels:  hardware
Blitz
Blitz is a 68030 based homebrew computer I designed over the course of nearly 3 years, starting in late 2017.
Stars: โœญ 31 (-35.42%)
Mutual labels:  hardware
MinimumViableSynth
A virtual analog synthesizer with lots of knobs and buttons.
Stars: โœญ 22 (-54.17%)
Mutual labels:  hardware
input-event
๐ŸŽน Read and parse input device(like mouse, keyboard, joystick and IR-Remote)'s event data.
Stars: โœญ 45 (-6.25%)
Mutual labels:  hardware
bitflyer4j
Java wrapper library for bitFlyer Lightning API.
Stars: โœญ 23 (-52.08%)
Mutual labels:  lightning

๐Ÿ”Œ sweetd

license release

Sweet daemon for pairing and control of the Bitcoin-enabled candy dispenser

Intro

sweetd is the daemon process running on the Bitcoin-enabled candy dispenser. It manages pairing and control, which is used by the Candy Dispenser app:

The sweetd program offers the following features:

  • ๐Ÿฌ Control of the motor for dispensing candy
  • ๐Ÿ“ณ Control of the buzzer for user feedback
  • โ˜๏ธ React on events from the touch sensor
  • ๐Ÿ”ต Pair through Bluetooth
  • ๐ŸŒ Set up Wi-Fi on candy dispenser
  • โšก Dispense candy on payments from remote lnd node
  • ๐Ÿ’… Customize name of your dispenser
  • ๐Ÿ”„ Update itself through app
  • โš™๏ธ Ensure all system configs are made

Download

Download the pre-built binary for your system from the GitHub releases page.

Extract and open the downloaded archive, then run sweetd.

Structure

The sweetd program's source code is split into small modules:

  • ๐Ÿ”Œ api - REST api for remote management of the dispenser
  • โš™๏ธ app - website for managing the dispenser
  • ๐Ÿฌ dispenser - orchestrator for everything the dispenser does
  • โšก๏ธ lightning - controller for configured Lightning nodes, remote and local
  • ๐Ÿ”ฉ๏ธ machine - hardware controller for the touch sensor, motor and buzzer
  • ๐Ÿ“ถ network - network subsystem that handles Wi-Fi discovery and connectivity
  • ๐Ÿคนโ€ nodeman - node manager
  • ๐Ÿง… onion - Tor onion service conveniences and .onion address generation
  • ๐Ÿ“ฒ pairing - pairing controller for BLE pairing
  • ๐Ÿ’ต pos - point-of-sale website that creates invoices
  • ๐Ÿ›‘ reboot - methods for rebooting and shutting down the system
  • ๐Ÿ“ sweetdb - persistent database manager
  • ๐Ÿ“ƒ sweetlog - logging middleware for intercepting logs
  • ๐Ÿ”– sysid - methods for determining a system-specific id
  • ๐Ÿ”„ updater - update subsystem that controls system updates

Configure data directory

By default, sweetd stores all data to ./data. You can easily override this location:

sweetd --datadir=/data/sweetd

Configure machine access

Currently, the sweetd program is only tested and executed on a Raspberry Pi. Running the executable with no options is the same as providing the following options:

sweetd \
  --machine=raspberry \
  --raspberry.touchpin=25 \
  --raspberry.motorpin=23 \
  --raspberry.buzzerpin=24

You can also mock the underlying machine with the following option:

sweetd \
  --machine=mock \
  --mock.listen=localhost:5000

With this option, you can fake touches by sending simple HTTP requests to the mock machine:

curl http://localhost:5000/touch/on
curl http://localhost:5000/touch/off

Configure the sweetd API server

sweetd exposes a gRPC API. It can be used to configure the Wi-Fi network that the candy dispenser connects to, personalize it and change settings.

By default, the API server listens on 0.0.0.0:9000. This can be changed with the following option:

sweetd --listen=localhost:9000

It's also possible to specify multiple --listen options and listen to multiple interfaces at once.

Enable Wi-Fi hotspot pairing

At the moment, the only app pairing mechanism is through a Wi-Fi hotspot that is created by the sweetd program.

This feature needs to be activated first:

sweetd --ap

Make sure that the following dependencies are installed when running the access point mode:

hostapd wireless-tools wpasupplicant dnsmasq iw

The access point is configured with the below defaults. Any of these can be changed to your needs.

sweetd \
  --ap \
  --ap.ip=192.168.27.1/24 \
  --ap.interface=uap0 \
  --ap.ssid=candy \
  --ap.passphrase=reckless \
  --ap.dhcprange=192.168.27.100,192.168.27.150,1h

This will create a Wi-Fi network called candy with the passphrase reckless. An app will connect to that network for pairing and use the gRPC api that is provided by the sweetd program.

Development

go get -d github.com/the-lightning-land/sweetd

cd $GOPATH/src/github.com/the-lightning-land/sweetd

go build

./sweetd

Releasing using goreleaser

The tool goreleaser can automatically sign the release and upload it to GitHub.

git tag -a v0.1.0 -m "Release name"

git push origin v0.1.0

goreleaser --rm-dist

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].