Hi,
I am looking for a way to use a #define in my platform.ini, Is it possible to use it or am I wishful here?
I have the following configuration I use in my platform.ini
[env]
platform = espressif8266
framework = arduino
build_flags =
-I"C:/My Data/OneDrive/Circuits/home_automation/include"
lib_deps = jwrw/ESP_EEPROM@^2.1.1
[env:balconydoor_ota]
board = esp12e ; common boards: d1_mini , esp01 , esp01_1m , esp12e
upload_port = 192.168.XX.XX
upload_protocol = espota
monitor_port = COM4
monitor_speed = 115200
build_flags =
${env.build_flags}
-DDEVICE=3
I already have the IP address of the device to which I have to upload in a header file. This is used in my C++ code
#define IP_espnow_sensor IPAddress(192,168,XX,XX) // generic IP address for any espnow sensor being used in OTA mode
The issue here is that , this way I have defined the IP address in two places (once in platform.ini and another in my header file) and any change has to be made in both places. Can I instead provide a dynamic value for upload_port, something like :
[env:balconydoor_ota]
board = esp12e ; common boards: d1_mini , esp01 , esp01_1m , esp12e
upload_port = IP_espnow_sensor
upload_protocol = espota
monitor_port = COM4
monitor_speed = 115200
build_flags =
${env.build_flags}
-DDEVICE=3