Using as a component - problems

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Using as a component - problems

Postby Fugazi » Fri May 05, 2017 5:55 pm

Having installed everything as per the instructions.

Ran make menuconfig to switch to Arduino style.

Modifying a current example to run in Arduino style I am getting the error that

undefined reference to `setup()'
undefined reference to `loop()'

I have files with setup and loop in them as per the instructions in the main directory - have moved them all over, renamed them, reran clean and make and switched back and forward to ESPIDF style.

What I am doing wrong ? :)

Any ideas

Thanks

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Re: Using as a component - problems

Postby Fugazi » Fri May 05, 2017 6:42 pm

Also if I compile one of the esp-idf examples its fine, adding components and the arduino code it still compiles in both arduino mode and normal mode.

Its only when you remove the app_main and replace with setup and loop it just can not find it.....

Fugazi
Posts: 42
Joined: Wed Apr 26, 2017 9:05 pm

Re: Using as a component - problems

Postby Fugazi » Sat May 06, 2017 10:26 am

Apologies for people who probably understand all this better than me, coming from a GUI background from the ESP8266 - none of this was necessary !

Solution is if your running app_main then the file needs to be a .c file

If you want to switch to Arduino you have to change the file to a .cpp file.

And then you need to go into build and delete the project directory ( usually main ) and then recompile - as it kept referencing earlier builds this was throwing a spanner in the works and I couldnt work out what was the error.

Hope this helps someone :)

sari_bence
Posts: 1
Joined: Sun Jul 16, 2017 5:26 pm

Re: Using as a component - problems

Postby sari_bence » Sun Jul 16, 2017 6:21 pm

Hi, sorry for disturbing you, I have component problems with esp32 IDF.

I have and arduino '.ino' code for esp32, that publishing MQTT, but I don't have arduino ble scan code.
And there is IDF code, that scanning for bluetooth devices, but I don't have properly working MQTT code.

So I tought I could 'add' these arduino libraries to my IDF code, and that would work, but it's not, it says:

Code: Select all

PubSubClient.h: No such file or directory
Could I use arduino libraries in IDF, or this is a bad idea, if I can, how? :(

I tried many things but nothing worked, and now I don't know, where can I ask for help.

Thanks for your help.

Who is online

Users browsing this forum: No registered users and 131 guests