How can i use Custom.h in ESPEASY


#1

Hi new here,

I’m struggling with my Platformio - ESPEASY - custom.h file. I’ve done the undef and define things. But i don’t understand how apply the settings using:
export PLATFORMIO_BUILD_FLAGS="’-DUSE_CUSTOM_H’"

… where do i put this line? I tried the serial console but that gave me the reply: “Unknown command!”
Should i add some line somewhere in my platformio.ini or ESPEasy-Globals.h …?

Realy confused …

Thanks !
Harry


#2

Do you use Windows or Linux or Mac as your OS?

The line is supposed to export an environment variable PLATFORMIO_BUILD_FLAGS with the value DUSE_CUSTOM_H. This command will be valid for Linux and Mac.

Effectively you can also do the same by going into your projects platformio.ini and adding the line

build_flags = -DUSE_CUSTOM_H

#3

Hi Maxgerhardt thanks for your reply!

I use Windows, so i’ll have to edit the platformio.ini …
I’ll try that asap.

Harry


#4

It somewhat worked … no errors or what so ever, but the settings used in the custom.h file were not set in the esp (nodemcu) … so i must be overviewing sonething …:thinking::thinking:


#5

Can you please write a

#error "CUSTOM CONFIG BEING USED"

into your Config.h to see if its being included? The file must be named Config.h. During recompilation it should throw you an error if its used. Does it do that?

Reading https://github.com/letscontrolit/ESPEasy/blob/mega/src/ESPEasy-Globals.h#L470-L478 it should work.


#6

I do get this printed: " #warning “**** Using Settings from Custom.h File ***” "
but that’s from my custom.h, … i don’t have any config.h file as far as i can see …


#7

The code linked above will include the Custom.h file when the macro USE_CUSTOM_H is defined, so that’s where your put your custom settings.

Can you upload a ZIP of your project to dropbox or open a github with your actual passwords removed so I can reproduce this?