Add files via upload

This commit is contained in:
Evgeniy
2025-01-31 23:39:35 +03:00
committed by GitHub
commit c07e82eab4
4 changed files with 130 additions and 0 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 skrepkaq
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

58
README.md Normal file
View File

@@ -0,0 +1,58 @@
# PizzaTime - кнопка для заказа пиццы с помощью ESP32
[![тут должно было быть видео](https://img.youtube.com/vi/6Nl7IEtmYt4/maxresdefault.jpg)](https://youtu.be/6Nl7IEtmYt4)
## Описание
PizzaTime button - это устройство на базе ESP32 для заказа пиццы из Papa John's одним нажатием кнопки.
## Возможности
- Выбор пиццы с помощью энкодера и LCD дисплея
- Заказ выбранной пиццы одним нажатием большой красной кнопки
- Отслеживание статуса заказа на дисплее
## Схема подключения
- LCD дисплей по I2C (SDA - pin 4, SCL - pin 5)
- Энкодер (DT - pin 8, CLK - pin 6, BUTTON - pin 7)
- Большая красная кнопка (pin 10)
- Светодиод кнопки (pin 9)
## Корпус
- Скачать 3D модель можно вот [тут](https://drive.google.com/file/d/1nt_kixFm3K33JhLOQZ-CUh5Is4GnZuJ8/view?usp=sharing)
- Печатал слоем 0.15мм, без поддержек
## Навигация по меню
- Выбор пиццы производится с помощью крутилки
- Для подтверждения выбора нажмите на крутилку
- Чтобы вернуться назад зажмите крутилку на 2 сек
- Чтобы заказать пиццу нажмите на большую красную кнопку когда она загорится
## Настройка
1. Склонируйте репозиторий с подмодулями:
```bash
git clone --recursive https://github.com/skrepkaq/pizza-time.git
```
2. Откройте проект в [PlatformIO](https://platformio.org/install/integration/)
3. Нажмите "build" или скопируйте пример конфига вручную
```bash
cp config.example include/config.h
```
4. В файле `include/config.h` укажите:
- Данные WiFi сети
- IP прокси-сервера
- ID города
- Пины для подключения компонентов
- Данные для заказа (имя, телефон и т.д.)
5. Соберите и загрузите прошивку на ESP
6. Запустите прокси-сервер:
```bash
cd proxy
docker-compose up -d
```
7. Включите кнопку и заказывайте пиццу

29
config.example Normal file
View File

@@ -0,0 +1,29 @@
#define WIFI_SSID "SSID"
#define WIFI_PASSWORD "PASSWORD"
#define API_URL "http://192.168.0.42:5009" // укажите ip своего прокси
#define CITY_ID 0 // можно найти вот тут https://api.papajohns.ru/city/list
// энкодер
#define ENCPIN1 8
#define ENCPIN2 6
#define ENCBTNPIN 7 // кнопка энкодера
#define BRBPIN 10 // большая красная кнопка
#define LEDPIN 9 // светодиод
// Данные заказа
#define ORDER_NAME "Андрей"
#define ORDER_PHONE "+7..."
#define ORDER_EMAIL ""
#define ORDER_GPS_LAT 39.176134
#define ORDER_GPS_LON 26.058903
// #define ORDER_RESTAURANT_ID 0 // у меня без указания заказывается из какого то рандомного, а не ближайшего ресторана
// #define MINPRICE 800 // не показывать с ценой меньше чем
#define TRACK_UPDATE_INTERVAL 50000

22
platformio.ini Normal file
View File

@@ -0,0 +1,22 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:lolin_s2_mini]
platform = espressif32
board = featheresp32-s2
framework = arduino
upload_speed = 921600
monitor_speed = 115200
lib_deps =
bblanchon/ArduinoJson@^7.0.1
mrfaptastic/Json Streaming Parser 2@^2.1.0
marcoschwartz/LiquidCrystal_I2C@^1.1.4
gyverlibs/EncButton@^3.5.6
extra_scripts = pre:scripts/config_copy.py