-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
An ESP8266mDNS related build failure #2211
Comments
A bit more info: ARDUINO_BOARD is #defined as a fallback in ESP8266mDNS.h here: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266mDNS/ESP8266mDNS.h#L49-#L52 If I comment out the #ifndef / #endif lines here leaving ARDUINO_BOARD hard defined as "generic", code then builds fine which tells me that under normal circumstances ARDUINO_BOARD is already defined in the environment as ESP8266_ESP01 and this is a symbol not recognized at build time..I expect that's because ESP8266_ESP01 is not recognized as a string literal like "generic" I note the comment:
..here https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266mDNS/ESP8266mDNS.h#L49 which is all well and good but it doesn't say where the ARDUINO_BOARD symbol should be defined or what to do when it seemingly gets defined improperly in Eclipse |
that is defined at build time in platform.txt here And you should maybe file a report to the maintainer of the plugin about this problem. |
Thanks for the heads up I've raised a new issue over here: Sloeber/arduino-eclipse-plugin#493 |
After a lengthy investigation around the Eclipse Arduino plug-in code I've come to the conclusion that it's actually doing the right thing and the problem is right here where I was first pointed to. With the platform.txt recipe config as it stands right now, we end up with a generated make file that writes out the gcc -D option like so: ..which on the face of it looks ok, but it's not because the gcc pre-processor ends up generating code that looks like this in the .o object file:
It's an easy enough fix though - we just need escaped quotes in platform.txt which results in the desired effect e.g. in platform.txt: resulting in this within the generated make file: which results in this compiled code in the object file and a successful build: If we agree this is the correct fix I'll create the pull request Thanks |
Mind that from experience I know the quotes are treated differently depending on OS. So you might need the .windows .linux extensions to get it working on all oses |
I double checked. The \ is needed in windows but as the arduino IDE runs in some sort of linux simulation it is not needed there. |
I agree good spot. Adding escaping backslashes I'm afraid I can't test windows at all here but I think we know enough to say that the escaping backslashes in platform.txt is not the right fix for this problem. |
I'm a bit confused here. Does it work in the Arduino IDE "out of the box"? This because Arduino uses the same appoach for build.usb_product for the due (and other boards)
giving The link you refer to contains |
It does indeed work in the Arduino IDE v1.6.8 'out of the box' and I guess the Arduino IDE is where ESP8266 arduino core maintainers generally focus their testing efforts to be happy it works for the bulk of the user / dev population.
There are no outer quotes around |
It is actually the command line that interprets differently. |
Ok thanks sounds good - good to hear you have a way to test windows there |
Here's the minimal ESP8266 core sketch that doesn't compile with the eclipse arduino plugin and works fine in the arduino IDE:
|
My brain nailed it :-) My guess is that ESP8266 will move to string with spaces now this is nicely documented :-) Anyway it is not a bug with ESP8266 and we are back to Sloeber/arduino-eclipse-plugin#493. |
Agreed, this "problem" was introduced in v2.3.0 in #2054 where platform.txt was modified to include {build.board} is used in a number of places in platform.txt and introducing spaces into the board string causes other build issues related to a broken command line so I can't see that happening any time soon |
Confirmed as a bug in the eclipse arduino plugin tracked on issue Sloeber/arduino-eclipse-plugin#493. No change is being made to the esp8266 core. This is closed. |
Confirmed as fixed in the eclipse arduino plugin. This comment highlights the issue being fixed on linux however the plugin owner / maintainer confirms the issue is also fixed on windows: |
It's 2.4.2 or older bug.
addServiceTxt("arduino", "tcp", "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD)); |
I hope someone can make sense of this :)
I develop in Eclipse with the Arduino Eclipse extension, I've updated from v2.1.0 -> v2.3.0 and code that did build previously no longer builds.
There seems to be some problem with how ARDUINO_BOARD is being defined. I think I've worked out that this is related to what's defined in boards.txt and I'm trying to use the "Generic ESP8266 Module" profile for an ESP12F board which means the folllowing is defined in platform.txt for this profile: generic.build.board=ESP8266_ESP01
I've created a bare bones new project bringing in the ESP8266mDNS library code and the build problem exists there too so it seems like this is an environmental problem.
This is the actual build error I see:
/home/joe/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266mDNS/ESP8266mDNS.cpp: In member function 'void MDNSResponder::enableArduino(uint16_t, bool)': <command-line>:0:15: error: 'ESP8266_ESP01' was not declared in this scope /home/joe/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266mDNS/ESP8266mDNS.cpp:841:44: note: in expansion of macro 'ARDUINO_BOARD' addServiceTxt("arduino", "tcp", "board", ARDUINO_BOARD);
Does anyone have a clue what's wrong here?
Thanks
Joe
The text was updated successfully, but these errors were encountered: