Browse Source
Merge pull request #211 from cubinet-code/config_override
Improve config system and make DTU_RADIO_ID customizable in config.h
pull/218/head^2
Andreas Schiffler
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
44 additions and
3 deletions
-
tools/esp8266/.gitignore
-
tools/esp8266/README.md
-
tools/esp8266/config.h
-
tools/esp8266/config_override_example.h
-
tools/esp8266/hmRadio.h
-
tools/esp8266/platformio.ini
|
@ -3,3 +3,4 @@ |
|
|
.vscode/c_cpp_properties.json |
|
|
.vscode/c_cpp_properties.json |
|
|
.vscode/launch.json |
|
|
.vscode/launch.json |
|
|
.vscode/ipch |
|
|
.vscode/ipch |
|
|
|
|
|
config_override.h |
|
|
|
@ -34,9 +34,11 @@ This code can be compiled using Visual Studio Code and **PlatformIO** Addon. The |
|
|
### Optional Configuration before compilation |
|
|
### Optional Configuration before compilation |
|
|
|
|
|
|
|
|
- number of supported inverters (set to 3 by default) `config.h` |
|
|
- number of supported inverters (set to 3 by default) `config.h` |
|
|
- DTU radio id `hmRadio.h` (default = 1234567801 |
|
|
- DTU radio id `config.h` (default = 1234567801) |
|
|
- unformated list in webbrowser `/livedata` `config.h`, `LIVEDATA_VISUALIZED` |
|
|
- unformated list in webbrowser `/livedata` `config.h`, `LIVEDATA_VISUALIZED` |
|
|
|
|
|
|
|
|
|
|
|
Alternativly, instead of modifying `config.h`, `config_override_example.h` can be copied to `config_override.h` and customized. |
|
|
|
|
|
config_override.h is excluded from version control and stays local. |
|
|
|
|
|
|
|
|
## Flash ESP with firmware |
|
|
## Flash ESP with firmware |
|
|
|
|
|
|
|
|
|
@ -36,6 +36,9 @@ |
|
|
#define DEF_RF24_CE_PIN 2 |
|
|
#define DEF_RF24_CE_PIN 2 |
|
|
#define DEF_RF24_IRQ_PIN 0 |
|
|
#define DEF_RF24_IRQ_PIN 0 |
|
|
|
|
|
|
|
|
|
|
|
// default radio ID
|
|
|
|
|
|
#define DTU_RADIO_ID ((uint64_t)0x1234567801ULL) |
|
|
|
|
|
|
|
|
// default NRF24 power, possible values (0 - 3)
|
|
|
// default NRF24 power, possible values (0 - 3)
|
|
|
#define DEF_AMPLIFIERPOWER 2 |
|
|
#define DEF_AMPLIFIERPOWER 2 |
|
|
|
|
|
|
|
@ -96,4 +99,8 @@ |
|
|
// changes the style of "/setup" page, visualized = nicer
|
|
|
// changes the style of "/setup" page, visualized = nicer
|
|
|
#define LIVEDATA_VISUALIZED |
|
|
#define LIVEDATA_VISUALIZED |
|
|
|
|
|
|
|
|
|
|
|
#if __has_include("config_override.h") |
|
|
|
|
|
#include "config_override.h" |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#endif /*__CONFIG_H__*/ |
|
|
#endif /*__CONFIG_H__*/ |
|
|
|
@ -0,0 +1,30 @@ |
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
// 2022 Ahoy, https://www.mikrocontroller.net/topic/525778
|
|
|
|
|
|
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __CONFIG_OVERRIDE_H__ |
|
|
|
|
|
#define __CONFIG_OVERRIDE_H__ |
|
|
|
|
|
|
|
|
|
|
|
// override fallback WiFi info
|
|
|
|
|
|
|
|
|
|
|
|
// each ovveride must be preceeded with an #undef statement
|
|
|
|
|
|
#undef FB_WIFI_SSID |
|
|
|
|
|
#define FB_WIFI_SSID "MY_SSID" |
|
|
|
|
|
|
|
|
|
|
|
// each ovveride must be preceeded with an #undef statement
|
|
|
|
|
|
#undef FB_WIFI_PWD |
|
|
|
|
|
#define FB_WIFI_PWD "MY_WIFI_KEY" |
|
|
|
|
|
|
|
|
|
|
|
// ESP32 default pinout
|
|
|
|
|
|
#undef DEF_RF24_CS_PIN |
|
|
|
|
|
#define DEF_RF24_CS_PIN 5 |
|
|
|
|
|
#undef DEF_RF24_CE_PIN |
|
|
|
|
|
#define DEF_RF24_CE_PIN 4 |
|
|
|
|
|
#undef DEF_RF24_IRQ_PIN |
|
|
|
|
|
#define DEF_RF24_IRQ_PIN 16 |
|
|
|
|
|
|
|
|
|
|
|
#undef DTU_RADIO_ID |
|
|
|
|
|
#define DTU_RADIO_ID ((uint64_t)0x1234567802ULL) |
|
|
|
|
|
|
|
|
|
|
|
#endif /*__CONFIG_OVERRIDE_H__*/ |
|
@ -16,7 +16,6 @@ |
|
|
#define DEFAULT_RECV_CHANNEL 3 |
|
|
#define DEFAULT_RECV_CHANNEL 3 |
|
|
#define SPI_SPEED 1000000 |
|
|
#define SPI_SPEED 1000000 |
|
|
|
|
|
|
|
|
#define DTU_RADIO_ID ((uint64_t)0x1234567801ULL) |
|
|
|
|
|
#define DUMMY_RADIO_ID ((uint64_t)0xDEADBEEF01ULL) |
|
|
#define DUMMY_RADIO_ID ((uint64_t)0xDEADBEEF01ULL) |
|
|
|
|
|
|
|
|
#define RF_CHANNELS 5 |
|
|
#define RF_CHANNELS 5 |
|
|
|
@ -14,9 +14,11 @@ src_dir = . |
|
|
[env] |
|
|
[env] |
|
|
framework = arduino |
|
|
framework = arduino |
|
|
|
|
|
|
|
|
|
|
|
build_flags = |
|
|
|
|
|
-include "config.h" |
|
|
; ;;;;; Possible Debug options ;;;;;; |
|
|
; ;;;;; Possible Debug options ;;;;;; |
|
|
; https://docs.platformio.org/en/latest/platforms/espressif8266.html#debug-level |
|
|
; https://docs.platformio.org/en/latest/platforms/espressif8266.html#debug-level |
|
|
;build_flags = -DDEBUG_ESP_PORT=Serial |
|
|
;-DDEBUG_ESP_PORT=Serial |
|
|
;-DDEBUG_ESP_CORE |
|
|
;-DDEBUG_ESP_CORE |
|
|
;-DDEBUG_ESP_WIFI |
|
|
;-DDEBUG_ESP_WIFI |
|
|
;-DDEBUG_ESP_HTTP_CLIENT |
|
|
;-DDEBUG_ESP_HTTP_CLIENT |
|
|