Skip to content

brendio/bitcoinswitch

 
 

Repository files navigation

Waveshare ESP32-S3-ETH-8DI-8RO

This fork extends the original lnbits/bitcoinswitch with major new features and hardware support:

Waveshare ESP32-S3-ETH-8DI-8RO Support

  • Native support for Waveshare relay board (8 relays, 8 digital inputs)
  • I2C relay control via TCA9554 expander
  • Digital input monitoring with 1:1 relay-to-input mapping

Ethernet-First Networking

  • W5500 Ethernet (SPI) with automatic WiFi fallback
  • WiFi can be disabled by leaving credentials blank

RGB LED Status Indicator

  • WS2812 RGB LED (GPIO 38) replaces TFT display
  • Multi-state LED patterns for boot, config, network, WebSocket, payment, and error

Enhanced Configuration System

  • SPIFFS-based config file with serial protocol
  • Python configuration tool with interactive config mode detection and remote reset
  • No physical button required for configuration

Remote Reset and Status via Serial

  • /reset and /reboot commands accepted in both config and normal operation
  • /status command for runtime diagnostics

NTP Time Synchronization

  • Automatic time sync on network connect
  • Real UTC timestamps in logs and Telegram alerts

Digital Input Monitoring and Lock Feedback

  • Monitors digital inputs after relay activation to detect mechanical failures
  • Configurable timeout and active state

Telegram Notification Integration

  • Sends alerts for payments, lock failures, and status events (optional)

Event Logging System

  • SPIFFS-based persistent event log (human-readable)
  • RAM circular buffer for recent events
  • Optional syslog/network logging

Robust Network State Machine

  • Ethernet/WiFi/WebSocket state tracking with automatic recovery
  • 2-second stabilization delay before WebSocket connection

Improved Error Handling and Debugging

  • Detailed serial debug output for all major subsystems
  • Error/status reporting via LED, serial, and (optionally) Telegram

Configurable and Backward-Compatible

  • All new features are optional and backward-compatible with original config
  • Hardcoded mode for development/testing

Clicky, the Bitcoin Switch

👉 An absolutely incredible bitcoinSwitch guide by Axel 👈

Also check out our video tutorial.

✅ $8 worth parts / 15min setup

✅ Websockets for blazingly fast turning on the things

✅ Web-installer/config for easy setup

✅ Support for MULTIPLE GPIOS/LNURLs (!)

Flash and configure via webinstaller https://bitcoinswitch.lnbits.com/

switch_front switch_back

Things you can turn on with a switch

There is a broad range of things from lamps, to candy-, claw or even arcade machines that can be turned on by a lightning payment with Clicky. Have a look at the LNbits shop what we did or check the LNbits wiki on how to build those yourself.

What you need

  • esp32 dev kit

  • High level relais

  • Female to male and male to male cables

  • Data cable

  • Optional: a case

  • Desktop PC

  • LNbits LNURLdevice Extension

  • Something to turn on

    Snow Forest Mountains Mountains

    Once flashed, press GPIO4 in few seconds of ESP32 booting up to be able to config.

    Got questions ? Join us t.me/lnbits, t.me/makerbits

    Complicated install instructions not using browser flashing

    trigger

    Development

    build with arduino-cli

    sh build.sh

    build webinstaller, fetch main assets from lnbits.github.io

    sh build-installer.sh

    start preview

    cd installer
    http-server -p 8080

    arduino-cli

    compiling

    arduino-cli compile --build-path build --fqbn esp32:esp32:esp32 bitcoinSwitch

    monitoring

    arduino-cli monitor -p /dev/ttyUSB1 -c baudrate=115200

    uploading

    arduino-cli upload --fqbn esp32:esp32:esp32 --input-dir build -p /dev/ttyUSB1

About

Turn things on with bitcoin!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 72.0%
  • Python 17.7%
  • Shell 5.6%
  • C 3.2%
  • JavaScript 1.5%