Skip to content
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

Real board name available in Sketch/MDNS/OTA #2054

Merged
merged 3 commits into from
Jun 1, 2016
Merged

Conversation

hallard
Copy link
Contributor

@hallard hallard commented May 24, 2016

  • Changed WifInfo defaults settings
  • Changed WeMos defined board name not to be ESP8266_NODEMCU but WEMOS_D1_MINI and WEMOS_D1
  • Added board name defined symbol at compilation stage to have it available in sketch, MDNS and OTA using ARDUINO_BOARD (like in ESP8266mDNS.h)
    This avoid board name to be "generic" in case of known board

@igrr
Copy link
Member

igrr commented Jun 1, 2016

build.board variable shouldn't be unique for each board. It indicates the pinout which the given board uses. Some libraries need to change their behaviour depending on board pinout, so they can use #ifdef ESP8266_NODEMCU, #ifdef ESP8266_ESP01, etc to figure out which board the sketch will run on. Making this define different for similar boards doesn't help library writers.

On the second change, what is the use case for having ARDUINO_BOARD as a string literal?

@hallard
Copy link
Contributor Author

hallard commented Jun 1, 2016

@igrr
I thought boards pinout was defined in variant/board_name/pins_arduino.h, and the 2 {build.board} I changed are WeMos D1 and WeMos D1 Mini (which are not NODEMCU boards) so pinout is correct and has not changed in pin definition of the following files:
NodeMCU
D1_Mini
D1

As the boards are declared different on boards.txt file (NODEMCU, WeMos D1 and WeMos D1 Mini) I thought it was making sense to be consistent on "Name" {build.board} view.

For the 2nd point, my goal was to:

  • have correct board name when declared in
    MDNS instead of "generic"
  • have real board name in Arduino IDE network port menu when using OTA instead of Generic ESP8266 board
  • Ability to print board name in my sketch

I don't think this change will have any side effect.

@igrr
Copy link
Member

igrr commented Jun 1, 2016

Let's at least keep the naming convention for build.board variable then — ESP8266_D1MINI or ESP8266_WEMOS_D1MINI.

@hallard
Copy link
Contributor Author

hallard commented Jun 1, 2016

Makes sense thanks,
It's done

@igrr igrr merged commit 5176202 into esp8266:master Jun 1, 2016
igrr pushed a commit that referenced this pull request Jun 15, 2016
* Changed WifInfo settings and WeMos board name

* Added board name to have in sketch and MDNS/OTA

* board naming convention

#2054

* Added Serial.baudRate() to get current baud rate

* Added more description

- Added note about Software Serial Implementation
- Indicate this will works on ESP8266 boards only
@jcRBern
Copy link

jcRBern commented Jul 3, 2016

i use WEMOS D1 Mini and i compile it on Visual studio 2013 with Visual micro plugin.
It's the same problem , i can not compile without error on macro ARDUINO_BOARD.
if i change platform.txt as described on #2211, compilation is OK on Visual studio , but not OK if i compile directly with ARDUINO IDE 1.6.9.
***I don't think this change will have any side effect__.* from hallard --> is not correct!!!
For large projects I prefer to use Visual Studio, for tests Arduino is sufficient, it would be nice if the two environments work.

@bebo-dot-dev
Copy link

Yes it looks like introducing escaping double quotes into platform.txt for "{build.board}" works for the eclipse arduino plugin too but as you say it breaks compile for the arduino IDE. So escaping quotes in platform.txt doesn't look like a viable solution.

I've been working with jantje in Sloeber/arduino-eclipse-plugin#493 to try and come up with a fix in the eclipse arduino plugin for this problem and at the moment it is proving to be quite a difficult problem to solve for all operating systems. It's even more problematic if the -D defined string literal symbol contains one or more spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants