Skip to content

quoted strings from the command line not always working #1028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
OllisGit opened this issue Oct 4, 2018 · 15 comments
Closed

quoted strings from the command line not always working #1028

OllisGit opened this issue Oct 4, 2018 · 15 comments
Labels
domain: build The build does not work as the Arduino IDE. importance: board specific OS: all

Comments

@OllisGit
Copy link

OllisGit commented Oct 4, 2018

Hi,
I used this tutoriual: https://www.instructables.com/id/Secure-IOT-With-AWS-and-Hornbill-ESP32-Using-Ardui/ to connect my esp32 with the aws cloud.
Everthings works fine, if I use the Arduino IDE 1.8.7, but if I switch wo sloeber the programm doesn't work.
OS: Windows 7

I received the following error:

  • several *.h files located under /Expressif-ArduinoESP32/tools/sdk/include/mbedtls/mbedtls were effected
  • error-message: #include expects "FILENAME" or <FILENAME>
  • e.g. platform.h, debug.h, pk.h, ssl.h, ....
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
RED-MARKED: #include MBEDTLS_CONFIG_FILE RED-MARKED
#endif

Any idea how to solve this or how to analyse the bug deeper?

BR
Olli

@jantje
Copy link
Member

jantje commented Oct 4, 2018

This is probably related to command line high tech (which only works in windows in some linux simulators and Sloeber works natively) and not using


#define VAL(str) #str
#define TOSTRING(str) VAL(str)

Which should be used to convert defines into strings in C/C++

@OllisGit
Copy link
Author

OllisGit commented Oct 4, 2018

first: wow, thanks for the fast response!

Unfortunately, I didn't understand your answer.

@jantje
Copy link
Member

jantje commented Oct 4, 2018

I don't have time to try this out but easiest way out is something like this

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#define VAL(str) #str
#define TOSTRING(str) VAL(str)
#include TOSTRING(MBEDTLS_CONFIG_FILE) 
#endif

@OllisGit
Copy link
Author

OllisGit commented Oct 4, 2018

That solves the problem!!!!
Thanks a lot, now I can work with your GREAT IDE again!!!!

@OllisGit OllisGit closed this as completed Oct 4, 2018
@jantje
Copy link
Member

jantje commented Oct 4, 2018

Think about this next time you see http://eclipse.baeyens.it/remind.php

@jantje jantje added status: known limitation This is soimething we can live with OS: all importance: board specific domain: build The build does not work as the Arduino IDE. labels Oct 4, 2018
@jantje jantje changed the title AWS IoT ESP32: error MBEDTLS_CONFIG_FILE quoted strings from the command line not always working Nov 24, 2018
@jantje
Copy link
Member

jantje commented Dec 2, 2018

For espressif boards ESP8266 and ESP32 a solution for the usage for ARDUINO_BOARD has been fixed in #1047
To get the fix you need to deinstall en install the platform and open the project properties->apply and OK
Should be available on the nightly build from tomorrow onwards

@Bascy
Copy link

Bascy commented Dec 16, 2018

I made a pull-request with a fix for this for the usage of ARDUINO_VARIANT in the ESP32mDNS library in arduino_esp32 project and it was accepted

@jantje
Copy link
Member

jantje commented Dec 16, 2018

@Bascy cool.
do you have a link?

@Bascy
Copy link

Bascy commented Dec 16, 2018 via email

@jantje
Copy link
Member

jantje commented Dec 17, 2018

Thanks :-)

@mikemoretti3
Copy link

I'm still seeing this issue. I had to edit the Environment and change the A.COMPILER.CPREPROCESSOR.FLAGS where it says -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" to -DMBEDTLS_CONFIG_FILE="""mbedtls/esp_config.h""" note the triple quotes.

@executer-uno
Copy link

executer-uno commented Dec 19, 2019

Me too. Clean fresh Install. Fresh Ububntu system.
I was managed to make it work with change DMBEDTLS_CONFIG_FILE to:
-DMBEDTLS_CONFIG_FILE="<mbedtls/esp_config.h>"

PS: for me as newbe it was not obvious. You can find Enviroment variables in Project/Properties/C/C++_Build/Enviroment
There is a big table where you can find A.COMPILER.CPREPROCESSOR.FLAGS variable. It contains a lot of definitions, be carefull to edit DMBEDTLS_CONFIG_FILE only.

!! Be avare that definition resets to default after any manipulations with with board/libraryes/project configurations.
Its quite annoing, so better to fix in esp package file:
file:///home/user/Sloeber/arduinoPlugin/packages/esp32/hardware/esp32/1.0.4/platform.txt

@jantje
Copy link
Member

jantje commented May 21, 2020

I think this is fixed. If not please provide the json and board settings that fail.

@punj
Copy link

punj commented Apr 24, 2021

This fixed the issue in Eclipse. However I am not sure if Arduino IDE can still compile?

@jantje
Copy link
Member

jantje commented Apr 24, 2021

@punj
You should not share arduino IDE and Sloeber packages. So sloeber workarounds/fixes at the level of platforms should never hit Arduino IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: build The build does not work as the Arduino IDE. importance: board specific OS: all
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants