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

mDNS discovery with IDE cannot detect the board name #7759

Closed
2 tasks
luc-github opened this issue Dec 12, 2020 · 2 comments · Fixed by #8634
Closed
2 tasks

mDNS discovery with IDE cannot detect the board name #7759

luc-github opened this issue Dec 12, 2020 · 2 comments · Fixed by #8634

Comments

@luc-github
Copy link
Contributor

  • [x ] This issue complies with the issue POLICY doc.
  • [ x] I have read the documentation at readthedocs and the issue is not addressed there.
  • [x ] I have tested that the issue is present in current master branch (aka latest git).
  • x[ ] I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-12
  • Core Version: [latest git ]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Generic ESP8266 ]
  • Flash Mode: [dio]
  • Flash Size: [4MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [160MHz]
  • Upload Using: [OTA]
  • Upload Speed: [115200|]

Problem Description

OTA description is incomplete - variant is missing in description in Arduino OTA menu unlike for ESP32

image
it is due to property board which should contain the variant name, but ESP8266 put another string
image
string is put here (thanks @tobozo to find out)
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266mDNS/src/LEAmDNS.cpp#L1278
and also https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266mDNS/src/LEAmDNS2Host.cpp#L792
So arduino IDE cannot match the variant with one present in board.txt

if I hardcode "generic" for the variant on board property - the result is correct

image
image

@luc-github luc-github changed the title in mDNS, board property is not correct and Arduino cannot display variant in description in mDNS, board property is not correct and Arduino Ide cannot display variant in description Dec 13, 2020
@d-a-v d-a-v self-assigned this Dec 30, 2020
@d-a-v d-a-v added this to the 3.0.0 milestone Dec 30, 2020
@d-a-v d-a-v modified the milestones: 3.0.0, 3.0.1 Mar 31, 2021
@d-a-v d-a-v modified the milestones: 3.0.1, 3.1 Jun 16, 2021
@mcspr
Copy link
Collaborator

mcspr commented Jul 12, 2022

Slight correction: "board" from mDNS (for some reason) should be equal to the ID of the board, not the whatever value we set to either board= or variant=
This is true for both the old IDE and the new one; see arduino-cli board list with mDNS discovery enabled
https://github.com/arduino/Arduino/blob/57a931c9c4c084057417837239ad8136f8a7b1aa/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java#L113-L119
https://github.com/arduino/arduino-cli/blob/63b53c0fa6830ce77cfb5508f06b2b4e601c90b5/cli/board/list.go#L134
(where identification prop map of this specific board is {board: d1_mini})

For example, if we select LOLIN(WEMOS) D1 R2 & mini, mDNS should return d1_mini. No relation to the similarly named build.variant=, just the root of the property.

d1_mini.name=LOLIN(WEMOS) D1 R2 & mini

esp32 seems to use a different scheme btw, by introducing ARDUINO_VARIANT flag and using it's value

@mcspr mcspr changed the title in mDNS, board property is not correct and Arduino Ide cannot display variant in description mDNS discovery with IDE cannot detect the board name Jul 12, 2022
@mcspr
Copy link
Collaborator

mcspr commented Jul 13, 2022

(where identification prop map of this specific board is {board: d1_mini})

...which we could find out normally, without going too far into the arduino-cli code

$ arduino-cli.exe board details -b $board_fqbn

for example, huzzah

$ arduino-cli.exe board details -b esp8266com:esp8266:huzzah
Board name:                Adafruit Feather HUZZAH ESP8266
FQBN:                      esp8266com:esp8266:huzzah
Board version:             3.1.0-dev

Identification properties: board=huzzah
...

edit:
Only issue now... how does one inject board ID into the build process? Inject another property ...=$id?
edit2:
Answering myself, we just inject this ${_id} somewhere as string

$ arduino-cli compile --show-properties -b esp8266com:esp8266:d1_mini
_id=d1_mini
...

mcspr added a commit to mcspr/esp8266-Arduino that referenced this issue Jul 13, 2022
When using IDE or `arduino-cli board list`, show full board name and FQBN
```
$ arduino-cli.exe board list
Port          Protocol Type              Board Name                FQBN                       Core
xxx.xxx.x.xxx network  Network Port      LOLIN(WEMOS) D1 R2 & mini esp8266com:esp8266:d1_mini esp8266com:esp8266
```
Also add `description` field to the mDNS response containing the
original `{build.board}` string value.

resolve esp8266#7759
d-a-v pushed a commit that referenced this issue Jul 27, 2022
* Board ID as build flag

When using IDE or `arduino-cli board list`, show full board name and FQBN
```
$ arduino-cli.exe board list
Port          Protocol Type              Board Name                FQBN                       Core
xxx.xxx.x.xxx network  Network Port      LOLIN(WEMOS) D1 R2 & mini esp8266com:esp8266:d1_mini esp8266com:esp8266
```
Also add `description` field to the mDNS response containing the
original `{build.board}` string value.

resolve #7759

* does not work with recent ide (?)

* fixup! does not work with recent ide (?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants