Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renat2985/crypto_payment_sonoff
Payment for Your Services via Solana, Cosmos, Algorand or TonCoin on the Sonoff
https://github.com/renat2985/crypto_payment_sonoff
algo algorand atom cosmos crypto payment payments sol solana sonoff tatum ton toncoin
Last synced: 10 days ago
JSON representation
Payment for Your Services via Solana, Cosmos, Algorand or TonCoin on the Sonoff
- Host: GitHub
- URL: https://github.com/renat2985/crypto_payment_sonoff
- Owner: renat2985
- Created: 2024-11-03T09:37:05.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-05T23:46:01.000Z (12 days ago)
- Last Synced: 2025-01-06T00:29:28.691Z (12 days ago)
- Topics: algo, algorand, atom, cosmos, crypto, payment, payments, sol, solana, sonoff, tatum, ton, toncoin
- Language: HTML
- Homepage: https://renat2985.github.io/crypto_payment_sonoff/
- Size: 21.6 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[🇷🇺 Русская версия документации здесь](https://github.com/renat2985/crypto_payment_sonoff/blob/main/README_RU.md)
# Payment for Your Services via Solana, Cosmos, Algorand or Toncoin
A convenient and fast way to implement paid services using the Solana, Cosmos, Algorand or TonCoin cryptocurrency. The process is simple: You open any crypto wallet, scan the QR code (for example, it can be printed on a sheet with the required amount), transfer the specified amount, and as soon as the payment is received, the relay will activate and turn on your device for the time you set. This could be any device, from a kettle, coffee machine, or light bulb to powering electricity in a room or another location.
You can assemble the device yourself or ask to build it for you. To order a ready-made device, contact me via [Telegram](https://t.me/ESPiotDevice), [Skype](https://skype:renat2985?chat), [Discord](https://discord.com/invite/zaGaDuGe).
We have a similar project with a screen, [check it out](https://github.com/renat2985/crypto_payment_touchScreen).[![IMAGE ALT TEXT HERE](https://github.com/renat2985/crypto_payment_sonoff/blob/main/doc/intro4.png)](https://www.youtube.com/watch?v=zKdVJmzJNLM&list=PL6NJTNxbvy-LpsI6D_1RM6v5YWDvsm5j4)
### Key Features:
1. **Device Connection:**
- When first powered on, if the device can’t find the router or if you press the button on the Sonoff itself, it will create an access point named “Crypto payments.”
- Connect to this access point (no password needed) and open a browser, then enter http://192.168.4.1. Usually, after connecting to Wi-Fi, the Captive portal will automatically open and redirect you to the desired page.
- Click "Configure WiFi" to proceed with the setup.2. **Device Configuration:**
- **Router and Password:** Enter your Wi-Fi connection details.
- **Crypto Name:** The cryptocurrency associated with the device, for example, "Solana", "Cosmos", "Algorand" or "Toncoin". You can optionally include GPIO pins in this field. Example: `Solana:12,11,22`, where "Solana" is the cryptocurrency, and `12, 11, 22` are the corresponding pin numbers for the relay, reset button, and LED (`RELAY_PIN`, `BUTTON_PIN`, `LED_PIN`).
- **Your Wallet:** Enter your wallet address to receive payments.
- **CoinMarketCap API:** Used to retrieve the current Solana exchange rate in fiat currency.
- **Tatum API:** Used to obtain the balance of your wallet.
For testing purposes, you can use the built-in APIs; however, for long-term use, it is strongly recommended to register on the respective websites ([coinmarketcap.com](https://coinmarketcap.com/api/) and [tatum.io](https://tatum.io/)) and obtain your own API keys. The free plans allow up to 10,000 requests per month, which is sufficient for 10 devices. However, as the number of devices increases, there may be delays in retrieving up-to-date information, potentially causing issues with payment processing.
- **Currency:** Select the currency in which you want to receive payments (EUR, USD, RUB, BYN, BGN, GBP, etc.). This is necessary for automatic conversion to solana based on the current exchange rate, updated hourly through coinmarketcap.com.
- **Service Currency Price:** Specify the price in your selected currency that the customer should pay.
- **Payment Tolerance:** In this field, specify the acceptable price deviation. Since the cryptocurrency price constantly fluctuates, you need to indicate a deviation range (as a single number) that you are willing to accept for payment.
- **Relay Work Time:** Specify how long the relay should be activated in seconds. This can range from one second (for simulating a button press) to several minutes or hours.
3. **Reset Settings:**
To reset the device to its factory settings, follow these steps:
1. Press the Sonoff button on the device.
2. The device will reboot.
3. After rebooting, a Wi-Fi access point named Crypto Sonoff will appear.The device is now ready for reconfiguration.
_Please note, if the blue LED starts flashing, it is a signal that something went wrong. You might have entered your Solana, Cosmos, Algorand or Toncoin wallet incorrectly. It could also indicate an incorrect [CoinMarketCap API](https://coinmarketcap.com/api/), [Tatum API](https://tatum.io/). If you are using the standard API (without changes), it may have exceeded the limit, and you might need to create your own CoinMarketCap API. The WiFi signal has disappeared. Another reason could be that the trial period of the software has expired._
### Instructions for Self-Assembly:
For self-assembly you will need any of these devices: SONOFF OLD, [SONOFF RF R2, SONOFF BASICR2](https://github.com/renat2985/crypto_payment_sonoff/blob/main/doc/flash_gpio_r2.png), [SONOFF Mini R1, SONOFF Mini R2](https://github.com/renat2985/crypto_payment_sonoff/blob/main/doc/flash_gpio_mini_r2.png), [SONOFF S26, SONOFF S26R2](https://github.com/renat2985/crypto_payment_sonoff/blob/main/doc/flash_gpio_s26.jpg).
- A programmer, such as USB to TTL / PL230
- A soldering iron and wires
We have added support for SONOFF devices based on ESP32 (Dual R3, Mini R4, Basic R4, POW, THR316), but most of them have not been fully tested. If you encounter any issues, please contact us, and we will do our best to assist you.
For devices with ESP8266 (Mini R1, Mini R2, S26, S26R2), all GPIO (pins) remain unchanged. You don’t need to configure anything. However, for ESP32, many GPIO pins have changed depending on the device model.
We decided not to release separate firmware for each model, as it would make maintenance more complicated. Instead, you will need to manually configure the GPIO for your device. To do this, in the Crypto Name field, after the cryptocurrency name, add a colon (:), followed by the GPIO for the relay, the GPIO for the reset button, and finally the GPIO for the LED.
Below, you will find a list of devices and their corresponding GPIO settings. Simply copy the required configuration, and your device should work.
Dual R3 ```Solana:27,0,13``` ```Cosmos:27,0,13``` ```Algorand:27,0,13``` ```Toncoin:27,0,13```
Mini R4 ```Solana:26,0,19``` ```Cosmos:26,0,19``` ```Algorand:26,0,19``` ```Toncoin:26,0,19```
Mini R4M ```Solana:4,9,19``` ```Cosmos:4,9,19``` ```Algorand:4,9,19``` ```Toncoin:4,9,19```
Basic R4 ```Solana:4,9,6``` ```Cosmos:4,9,6``` ```Algorand:4,9,6``` ```Toncoin:4,9,6```
POW 16a ```Solana:13,0,18``` ```Cosmos:13,0,18``` ```Algorand:13,0,18``` ```Toncoin:13,0,18```
POW 20a ```Solana:4,0,18``` ```Cosmos:4,0,18``` ```Algorand:4,0,18``` ```Toncoin:4,0,18```
POW Ring ```Solana:21,0,13``` ```Cosmos:21,0,13``` ```Algorand:21,0,13``` ```Toncoin:21,0,13```
THR316 ```Solana:21,0,15``` ```Cosmos:21,0,15``` ```Algorand:21,0,15``` ```Toncoin:21,0,15```
Good luck!
# Web installer (recommended)
## [https://renat2985.github.io/crypto_payment_sonoff/](https://renat2985.github.io/crypto_payment_sonoff/)### For Advanced Users: Firmware Instructions via Programmer
### Specification [ESP8266 crypto_payment_sonoff.ino.bin](https://github.com/renat2985/crypto_payment_sonoff/raw/main/build/esp8266.esp8266.generic/crypto_payment_sonoff.ino.bin) file
```
- Module: Generic ESP8266 Module
- Flash Size: 1M
- CPU Frequency: 80Mhz
- Flash Mode: DOUT
- Flash Frequency: 40Mhz{ "path": "./build/esp8266.esp8266.generic/crypto_payment_sonoff.ino.bin", "offset": 0 }
```### Specification [ESP32 crypto_payment_sonoff.ino.bin](https://github.com/renat2985/crypto_payment_sonoff/raw/main/build/esp32.esp32.esp32/crypto_payment_sonoff.ino.bin), [ESP32C3 crypto_payment_sonoff.ino.bin](https://github.com/renat2985/crypto_payment_sonoff/raw/main/build/esp32.esp32.esp32c3/crypto_payment_sonoff.ino.bin), [ESP32S3 crypto_payment_sonoff.ino.bin](https://github.com/renat2985/crypto_payment_sonoff/raw/main/build/esp32.esp32.esp32s3/crypto_payment_sonoff.ino.bin) file
```
{ "path": "./build/esp32.esp32.esp32*/crypto_payment_sonoff.ino.bootloader.bin", "offset": 4096 },
{ "path": "./build/esp32.esp32.esp32*/crypto_payment_sonoff.ino.partitions.bin", "offset": 32768 },
{ "path": "./build/esp32.esp32.esp32*/boot_app0.bin", "offset": 57344 },
{ "path": "./build/esp32.esp32.esp32*/crypto_payment_sonoff.ino.bin", "offset": 65536 }
```### ESP8266 NodeMCU Flasher
https://github.com/nodemcu/nodemcu-flasher
Download Release: [Win32](https://github.com/nodemcu/nodemcu-flasher/blob/master/Win32/Release/ESP8266Flasher.exe) or [Win64](https://github.com/nodemcu/nodemcu-flasher/blob/master/Win64/Release/ESP8266Flasher.exe).## :battery: Donation
If you like this project, you can buy me a cup of coffee :coffee:
- PayPal [https://www.paypal.me/RKevrels](https://www.paypal.me/RKevrels/5)