commit c07e82eab4e8cb515765d492f2afa3496ce7f448 Author: Evgeniy <38162408+y0zhyck@users.noreply.github.com> Date: Fri Jan 31 23:39:35 2025 +0300 Add files via upload diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..503d1eb --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff74324 --- /dev/null +++ b/README.md @@ -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. Включите кнопку и заказывайте пиццу diff --git a/config.example b/config.example new file mode 100644 index 0000000..e27b808 --- /dev/null +++ b/config.example @@ -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 \ No newline at end of file diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..289716e --- /dev/null +++ b/platformio.ini @@ -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