Search found 92 matches

by leenowell
Mon Feb 17, 2020 7:59 am
Forum: ESP-IDF
Topic: How to programm in c++ / How to execute void app_main(void) in c++
Replies: 13
Views: 16484

Re: How to programm in c++ / How to execute void app_main(void) in c++

Think of the header files as declaring to the compiler that at link time you will be providing that variable / function etc at link time so pretend you have already have it for now. The corresponding source files are then compiled independently using either a C or C++ compiler and the linker joins t...
by leenowell
Sun Feb 16, 2020 8:55 pm
Forum: ESP-IDF
Topic: How to programm in c++ / How to execute void app_main(void) in c++
Replies: 13
Views: 16484

Re: How to programm in c++ / How to execute void app_main(void) in c++

In the spi.h file, the #includes above the extern C are standard C header files and therefore need to be inside the wrapper. If that doesn't work can you post the full compile log?
by leenowell
Sun Feb 16, 2020 4:48 pm
Forum: IDEs for ESP-IDF
Topic: Python issues and suggested updates
Replies: 2
Views: 5988

Python issues and suggested updates

Hi, I have rebuilt my laptop and done a clean install of idf and the eclipse plugin. I have a couple of questions / observations 1. The Eclipse plugin seems to require python v3.7 which on my system (Ubuntu 19.10) is installed as python3 as opposed to python. In the install tools section I can point...
by leenowell
Sun Feb 16, 2020 8:32 am
Forum: ESP-IDF
Topic: How to programm in c++ / How to execute void app_main(void) in c++
Replies: 13
Views: 16484

Re: How to programm in c++ / How to execute void app_main(void) in c++

You don't mention what linker errors you have but it is probably because you have put the #include "spi.h" inside the extern "C" wrapper in both source files. The way to think about it is that if the file extension is .cpp the c++ compiler will be invoked and will alter all the names during the comp...
by leenowell
Fri Feb 14, 2020 7:38 pm
Forum: ESP-IDF
Topic: How to programm in c++ / How to execute void app_main(void) in c++
Replies: 13
Views: 16484

Re: How to programm in c++ / How to execute void app_main(void) in c++

Glad you got it working. Once you start using functions from the header files I believe you will get linker errors if you don't put the #includes in extern C wrapper.
by leenowell
Fri Feb 14, 2020 8:20 am
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23415

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

Hi Vikram Yes move to C++ has been fine and almost done refactoring the code. I have split the initialisation and send email into separate methods and split the SMTP only code out into a class. I have a personal preference not to use goto (sorry) so am in the middle of reworking the code to remove t...
by leenowell
Fri Feb 14, 2020 8:10 am
Forum: ESP-IDF
Topic: How to programm in c++ / How to execute void app_main(void) in c++
Replies: 13
Views: 16484

Re: How to programm in c++ / How to execute void app_main(void) in c++

Hi I have done this a few times off the top of my head the steps are... 1. Create the sample / new project using the project -> new etc route. 2. Change the generated main.c to main.cpp 3. Put the extern C around the header file includes too 4. Add the app_main extern inside the extern C braces i.e....
by leenowell
Sun Feb 09, 2020 7:17 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23415

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@ESP_Vikram

server is smtp.googlemail.com
port 587

The receiving email address is a yahoo email address and I am viewing it with their online web client.

Hope this helps.

Thanks

Lee.
by leenowell
Sun Feb 09, 2020 11:54 am
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23415

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@ESP_Vikram Hi Vikram, I have been doing some more testing and noticed that the first sentence of the email body doesn't come through. The fix was to change the \n to \r\n\r\n on the first line as follows. len = snprintf((char *) buf, BUF_SIZE, "Content-Type: text/plain\r\n\r\n" "This is a simple te...
by leenowell
Sat Feb 08, 2020 1:12 pm
Forum: ESP-IDF
Topic: ESP32 IDF smtp (Simple Mail Transfer Protocol) support
Replies: 22
Views: 23415

Re: ESP32 IDF smtp (Simple Mail Transfer Protocol) support

@ESP_Vikram Hi Vikram, In the end I removed v4.0 (looks like the latest version has an issue when you pull it via git) and pulled the master branch instead. I have tested the latest code in the master branch and it still has the 0 bytes attachment issue. I applied my fix from before and it works fin...