emonTH v2 compile error "load_config was not declared in this scope"

So I purchased 4 of the new emonTH V2s and I was trying to compile the example code an I and getting an error:

‘load_config was not declared in this scope’

The only place I can find 'load_config" is here:

if (RF_STATUS==1){

So I am wondering what I am missing…

This is from:

emonTH V2 Low Power SI7021 Humidity & Temperature, DS18B20 Temperature & Pulse counting Node Example


@richard I think you are missing this file emonth2/config.ino at master · openenergymonitor/emonth2 · GitHub that has the load_config() function.

George -

Thank you. I have not done a multifile sketch before and this answers my question!!

Much appreciated!

The two files should both have been in the directory that you downloaded.

AS he’s new to “multifile sketches” I think he just saw the main file and tried to work with that.

The point is, the Arduino IDE compiles and links all the files it can, which finds in the working directory. Therefore, you cannot have anything it can compile in there unless it is part of the project.
So by inference, every source file that is in there as part of the distribution is necessary.

Yes we know that but the OP is used to working with single files. He saw a suitable ino on GitHub and tried to use it.

And I wrote it down so that everybody would know as well.

1 Like

Hey Robert -

Alas…I had not idea what the config.ino file was for so I didn’t bother to download it. I have never done a multifile sketch so this was new to me. But thanks to you guys, I understand it now!!

1 Like