Github Boards Devices Community Docs Blog

User_config.h is ignored by PlatformIO

Hello, I know that is not the exact subject here but I have no alternative.
I have been trying to configure OMG in PlatformIO for a week, but all changes I make to User_config.h are ignored in the compilation.
I’ve tried all the alternatives I could think of, can someone help me?


If parameters are defined into your .ini platformio file this is normal.
Main parameters definition in config files are ignored if they are already define into a .ini file.
We may help you if you post a list of the change you made.
You can also try to define your change in the .ini files like below:

platform = ${com.esp32_platform}
board = lolin32
board_build.partitions = min_spiffs.csv
lib_deps =
build_flags =
1 Like

Hi Florian, thanks for the help.
I understood your explanation and made the changes you said. No compilation errors but still without the basics like Wifi.

 My User_Config parameters:

//#define ESP32_ETHERNET=true // Uncomment to use Ethernet module on OLIMEX ESP32 Ethernet gateway

#if defined(ESPWifiManualSetup) // for nodemcu, weemos and esp8266
#  ifndef wifi_ssid
#    define wifi_ssid "My-WIFI-ssid"
#  endif
#  ifndef wifi_password
#    define wifi_password "My-Wifi-Pass"
#  endif

#ifndef WifiManager_password
#  define WifiManager_password "Gate-Pass" //this is going to be the WPA2-PSK password for the initial setup access point

/*-------------DEFINE THE MODULES YOU WANT BELOW----------------*/
//Addons and module management, uncomment the Z line corresponding to the module you want to use

`#define ZgatewayRF     "RF"       //ESP8266, Arduino, ESP32`
#define ZgatewayIR     "IR"       //ESP8266, Arduino,         Sonoff RF Bridge
//#define ZgatewayLORA   "LORA"       //ESP8266, Arduino, ESP32
//#define ZgatewayPilight "Pilight" //ESP8266, Arduino, ESP32
//#define ZgatewayWeatherStation "WeatherStation" //ESP8266, Arduino, ESP32
#define ZgatewayBT     "BT"       //ESP8266, ESP32
//#define ZgatewayRF2    "RF2"      //ESP8266, Arduino, ESP32
//#define ZgatewaySRFB   "SRFB"     //                          Sonoff RF Bridge
//#define Zgateway2G     "2G"       //ESP8266, Arduino, ESP32
//#define ZgatewayRFM69  "RFM69"    //ESP8266, Arduino, ESP32
//#define ZactuatorONOFF "ONOFF"    //ESP8266, Arduino, ESP32,  Sonoff RF Bridge
//#define ZsensorINA226  "INA226"   //ESP8266, Arduino, ESP32
//#define ZsensorHCSR04  "HCSR04"   //ESP8266, Arduino, ESP32
#define ZsensorHCSR501 "HCSR501"  //ESP8266, Arduino, ESP32,  Sonoff RF Bridge
//#define ZsensorADC     "ADC"      //ESP8266, Arduino, ESP32
//#define ZsensorBH1750  "BH1750"   //ESP8266, Arduino, ESP32
//#define ZsensorTSL2561 "TSL2561"  //ESP8266, Arduino, ESP32
//#define ZsensorBME280  "BME280"   //ESP8266, Arduino, ESP32
//#define ZsensorHTU21   "HTU21"    //ESP8266, Arduino, ESP32
#define ZsensorDHT     "DHT"      //ESP8266, Arduino, ESP32,  Sonoff RF Bridge
//#define ZsensorDS1820  "DS1820"   //ESP8266, Arduino, ESP32
//#define ZsensorGPIOKeyCode "GPIOKeyCode" //ESP8266, Arduino, ESP32
//#define ZsensorGPIOInput "GPIOInput" //ESP8266, Arduino, ESP32
#define ZmqttDiscovery "HADiscovery"//ESP8266, Arduino, ESP32, Sonoff RF Bridge
#define ZactuatorFASTLED "FASTLED" //ESP8266, Arduino, ESP32, Sonoff RF Bridge
//#define ZboardM5STICKC "M5StickC"
//#define ZboardM5STACK  "ZboardM5STACK"
//#define ZradioCC1101   "CC1101"   //ESP8266, ESP32
//#define ZactuatorPWM   "PWM"      //ESP8266, ESP32

And in Platformio.ini I have the “default_envs = nodemcuv2-all-test” choosed.

Thanks for your patience, this Platformio makes me feel like an old man who has never turned on a computer or changed a lamp.

ps1: Ow, Why the hell does the compilation continue using the example ip if this number no longer exists in User_config?

ps2: I looked in “Help”, in “FAQ” … I didn’t find how to leave the message as “code” like you did in your answer.

Well, I try this in Platformio.ini :

build_flags =
  '-Dwifi_password "RouterPass"'
board_build.flash_mode = dout

It works, but I have the same config in User_config.h and I don’t know wich is working. My Platformio is very unstable here. :roll_eyes:

You can put the default user_config.h. This way you will be sure that infos are coming from the .ini