-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_def.h
196 lines (156 loc) · 5.3 KB
/
ext_def.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
// Language config
#define CURRENT_LANG INTL_LANG
// Wifi config
const char WLANSSID[] PROGMEM = "luftdaten";
const char WLANPWD[] PROGMEM = "luftd4ten";
// BasicAuth config
const char WWW_USERNAME[] PROGMEM = "admin";
const char WWW_PASSWORD[] PROGMEM = "";
#define WWW_BASICAUTH_ENABLED 0
// Sensor Wifi config (config mode)
#define FS_SSID ""
#define FS_PWD "nebulocfg"
#define HAS_WIFI 1
#define HAS_LORA 0
const char APPEUI[] = "0100000000000000";
const char DEVEUI [] = "70B3D57ED004B120";
const char APPKEY[] = "D8667367328BE4C820847A56E9AD3B64";
// // Application Identifier (u1_t[8]) in lsb format
// #define OTAA_DEVEUI 0x20, 0xB1, 0x04, 0xD0, 0x7E, 0xD5, 0xB3, 0x70
// // Application Identifier (u1_t[8]) in lsb format
// #define OTAA_APPEUI 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
// // Application Key (u1_t[16]) in msb format
// #define OTAA_APPKEY 0xD8, 0x66, 0x73, 0x67, 0x32, 0x8B, 0xE4, 0xC8, 0x20, 0x84, 0x7A, 0x56, 0xE9, 0xAD, 0x3B, 0x64
// Where to send the data?
#define SEND2SENSORCOMMUNITY 0
#define SSL_SENSORCOMMUNITY 0
#define SEND2MADAVI 0
#define SSL_MADAVI 0
#define SEND2CSV 0
#define SEND2CUSTOM 0
#define SEND2CUSTOM2 0
enum LoggerEntry {
LoggerSensorCommunity,
LoggerMadavi,
LoggerCustom,
LoggerCustom2,
LoggerCount
};
struct LoggerConfig {
uint16_t destport;
uint16_t errors;
void* session;
};
// IMPORTANT: NO MORE CHANGES TO VARIABLE NAMES NEEDED FOR EXTERNAL APIS
static const char HOST_MADAVI[] PROGMEM = "api-rrd.madavi.de";
static const char URL_MADAVI[] PROGMEM = "/data.php";
#define PORT_MADAVI 80
static const char HOST_SENSORCOMMUNITY[] PROGMEM = "api.sensor.community";
static const char URL_SENSORCOMMUNITY[] PROGMEM = "/v1/push-sensor-data/";
#define PORT_SENSORCOMMUNITY 80
static const char NTP_SERVER_1[] PROGMEM = "0.pool.ntp.org";
static const char NTP_SERVER_2[] PROGMEM = "1.pool.ntp.org";
// define own API
static const char HOST_CUSTOM[] PROGMEM = "192.168.234.1";
static const char URL_CUSTOM[] PROGMEM = "/data.php";
#define PORT_CUSTOM 80
#define USER_CUSTOM ""
#define PWD_CUSTOM ""
#define SSL_CUSTOM 0
// define own API
static const char HOST_CUSTOM2[] PROGMEM = "192.168.234.1";
static const char URL_CUSTOM2[] PROGMEM = "/data.php";
#define PORT_CUSTOM2 80
#define USER_CUSTOM2 ""
#define PWD_CUSTOM2 ""
#define SSL_CUSTOM2 0
//GPIO Pins
// the IO pins which can be used for what depends on the following:
// - The board which is used
// - onboard peripherials like LCD or LoRa chips which already occupy an IO pin
// - the ESP32 module which is used
// - the WROVER board uses the IOs 16 and 17 to access the PSRAW
// - on WROOM boards the IOs 16 and 17 can be freely used
// - if JTAG debugging shall be used
// - some IOs have constraints
// - configuration of ESP32 module configuration options ("strapping") like operating voltage and boot medium
// - some IOs can only be used for inputs (34, 35, 36, 39)
// see https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
// https://github.com/va3wam/TWIPi/blob/master/Eagle/doc/feather-pinout-map.pdf
// === pin assignments for the LoRa module according to LMIC library ===================================
// ttgo:
// PIN_SX1276_NSS = 18
// PIN_SX1276_NRESET = 23
// PIN_SX1276_DIO0 = 26
// PIN_SX1276_DIO1 = 33
// PIN_SX1276_DIO2 = 32
// PIN_SX1276_ANT_SWITCH_RX = UNUSED_PIN,
// PIN_SX1276_ANT_SWITCH_TX_BOOST = UNUSED_PIN,
// PIN_SX1276_ANT_SWITCH_TX_RFO = UNUSED_PIN,
// PIN_VDD_BOOST_ENABLE = UNUSED_PIN,
// Heltec:
// PIN_SX1276_NSS = 18,
// PIN_SX1276_NRESET = 14
// PIN_SX1276_DIO0 = 26
// PIN_SX1276_DIO1 = 35
// PIN_SX1276_DIO2 = 34
// PIN_SX1276_ANT_SWITCH_RX = UNUSED_PIN,
// PIN_SX1276_ANT_SWITCH_TX_BOOST = UNUSED_PIN,
// PIN_SX1276_ANT_SWITCH_TX_RFO = UNUSED_PIN,
// PIN_VDD_BOOST_ENABLE = UNUSED_PIN,
#if defined(ESP32) and not defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) and not defined(ARDUINO_TTGO_LoRa32_v21new)
//#define ONEWIRE_PIN D25
#define PM_SERIAL_RX D19
#define PM_SERIAL_TX D23
#define I2C_PIN_SCL D22
#define I2C_PIN_SDA D21
#define GPS_SERIAL_RX D12
#define GPS_SERIAL_TX D13
#endif
#if defined (ARDUINO_TTGO_LoRa32_v21new)
//#define ONEWIRE_PIN D25
#define PM_SERIAL_RX D19
#define PM_SERIAL_TX D23
#define I2C_PIN_SCL D22
#define I2C_PIN_SDA D21
#define GPS_SERIAL_RX D12
#define GPS_SERIAL_TX D13
#endif
#if defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
#define I2C_SCREEN_SCL D15
#define I2C_SCREEN_SDA D4
#define OLED_RESET D16
#define PM_SERIAL_RX D23
#define PM_SERIAL_TX D17
// #define ONEWIRE_PIN D32
// #define PM_SERIAL_RX D27
// #define PM_SERIAL_TX D33
#define I2C_PIN_SCL D22
#define I2C_PIN_SDA D21
#define GPS_SERIAL_RX D12
#define GPS_SERIAL_TX D13
#endif
// SDS011, the more expensive version of the particle sensor
#define SDS_READ 0
#define SDS_API_PIN 1
// Tera Sensor Next PM sensor
#define NPM_READ 1
#define NPM_FULLTIME 0
#define NPM_API_PIN 1
// BMP280/BME280, temperature, pressure (humidity on BME280)
#define BMX280_READ 1
#define BMP280_API_PIN 3
#define BME280_API_PIN 11
// GPS, preferred Neo-6M
#define GPS_READ 0
#define GPS_API_PIN 9
// OLED Display SSD1306 connected?
#define HAS_SSD1306 1
// Show wifi info on displays
#define DISPLAY_WIFI_INFO 1
// Show wifi info on displays
#define DISPLAY_LORA_INFO 0
// Show device info on displays
#define DISPLAY_DEVICE_INFO 1
// Set debug level for serial output?
#define DEBUG 3