This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefines.h
112 lines (81 loc) · 4.02 KB
/
defines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/****************************************************************************************************************************
defines.h
For ESP32 boards
Blynk_Async_ESP32_BT_WF is a library, using AsyncWebServer instead of (ESP8266)WebServer for inclusion of both ESP32
Blynk BT/BLE and WiFi libraries. Then select either one or both at runtime.
Based on and modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases
Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Async_ESP32_BT_WF
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef defines_h
#define defines_h
#ifndef ESP32
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
#endif
#define BLYNK_PRINT Serial
#define ESP32_BLE_WF_DEBUG true
#define DOUBLERESETDETECTOR_DEBUG true
#define BLYNK_WM_DEBUG 1
// Not use #define USE_LITTLEFS and #define USE_SPIFFS => using SPIFFS for configuration data in WiFiManager
// (USE_LITTLEFS == false) and (USE_SPIFFS == false) => using EEPROM for configuration data in WiFiManager
// (USE_LITTLEFS == true) and (USE_SPIFFS == false) => using LITTLEFS for configuration data in WiFiManager
// (USE_LITTLEFS == true) and (USE_SPIFFS == true) => using LITTLEFS for configuration data in WiFiManager
// (USE_LITTLEFS == false) and (USE_SPIFFS == true) => using SPIFFS for configuration data in WiFiManager
// Those above #define's must be placed before #include <BlynkSimpleEsp32_WFM.h>
#define USE_LITTLEFS true
#define USE_SPIFFS false
#if !( USE_SPIFFS || USE_LITTLEFS)
// EEPROM_SIZE must be <= 2048 and >= CONFIG_DATA_SIZE (currently 172 bytes)
#define EEPROM_SIZE (2 * 1024)
// EEPROM_START + CONFIG_DATA_SIZE must be <= EEPROM_SIZE
#define EEPROM_START 0
#endif
/////////////////////////////////////////////
// Add customs headers from v1.2.0
#define USING_CUSTOMS_STYLE true
#define USING_CUSTOMS_HEAD_ELEMENT true
#define USING_CORS_FEATURE true
/////////////////////////////////////////////
// Force some params in Blynk, only valid for library version 1.0.1 and later
#define TIMEOUT_RECONNECT_WIFI 10000L
#define RESET_IF_CONFIG_TIMEOUT true
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5
// Those above #define's must be placed before #include <BlynkSimpleESP32_Async_WFM.h>
//#define BLYNK_USE_BLE_ONLY true
#define BLYNK_USE_BLE_ONLY false
#include <BlynkSimpleEsp32_Async_BLE_WF.h>
#include <BLEDevice.h>
#include <BLEServer.h>
#define USE_BLYNK_WM true
//#define USE_BLYNK_WM false
#if !BLYNK_USE_BLE_ONLY
#if USE_BLYNK_WM
#define USE_DYNAMIC_PARAMETERS true
/////////////////////////////////////////////
#define REQUIRE_ONE_SET_SSID_PW false
#define SCAN_WIFI_NETWORKS true
// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true
// From 2-15
#define MAX_SSID_IN_LIST 8
/////////////////////////////////////////////
#warning Please select 1.3MB+ for APP (Minimal SPIFFS (1.9MB APP, OTA), HugeAPP(3MB APP, NoOTA) or NoOA(2MB APP)
#include <BlynkSimpleEsp32_Async_WFM.h>
#else
#include <BlynkSimpleEsp32_Async_WF.h>
String cloudBlynkServer = "account.duckdns.org";
//String cloudBlynkServer = "192.168.2.110";
#define BLYNK_SERVER_HARDWARE_PORT 8080
char ssid[] = "SSID";
char pass[] = "PASSPASS";
#endif
#endif
#if (BLYNK_USE_BLE_ONLY || !USE_BLYNK_WM)
// Blynk token shared between BLE and WiFi
char auth[] = "****";
#endif
#ifndef LED_BUILTIN
#define LED_BUILTIN 2 // Pin D2 mapped to pin GPIO2/ADC12 of ESP32, control on-board LED
#endif
#define HOST_NAME "ASYNC-ESP32-BLE-WF"
#endif //defines_h