-
-
Notifications
You must be signed in to change notification settings - Fork 398
mDNS discovery "board" value and board detection #1803
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
Comments
Hi @mcspr, thanks for the question and sorry for the long delay...
You're right, the current situation comes from a poor design in the early implementations of the OTA made in the Arduino IDE 1.6.x, https://github.com/arduino/Arduino/blob/89539b1131f8cde9f7a83225f21c811071af53a8/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java#L91-L115. At the times it has been chosen to compare the This is still supported and we kept backward compatibility even after introducing the Pluggable Discovery. Unfortunately, if you want to keep compatibility with all the old versions of the Arduino IDE 1.8.x you must stick with it.
The CLI/IDE 2.0 uses Pluggable Discoveries to detect boards. Those are much more powerful tools specialized to detect boards. Each discovery manages a specific protocol (serial, network, DFU...) that's why the mDNS discovery is now a separate tool and is no more implemented as part of the CLI or the IDE: https://github.com/arduino/mdns-discovery/. I don't know if you already experimented with it, but if you want to have a glimpse of how it works, you may try to run it with something like:
The peculiar piece is the An example is given in the piece of documentation you linked: https://arduino.github.io/arduino-cli/0.25/pluggable-discovery-specification/#board-identification If you want to go that way you need also to specify explicitly that you want to use a discovery in platform.txt:
BTW after adding those definitions, the CLI will consider the platform as "Pluggable Discovery"-aware and it will disable all the automatic backward compatibility features for that platform. This means that, among other things, you must add the definitions for
must be converted to:
or make some adjustments to the network-upload rule. Ok, I'll stop here for now, if you have any questions do not hesitate to ask. |
Thanks! ESP8266 boards.txt lacks vid & pid pairs, no idea how I would go about finding out those at this point :> So I assume serial connection won't be as discover-able. But, we could continue to use Also just noticed that these key-values can be discovered in build properties output
I have not considered upload tool changes related to pluggable discovery, would have to adapt those. ESP8266 repo never used programmers.txt (which seems to be required), but I could port changes from ESP32 project that have introduced Arduino IDE 2.x support |
I'm closing this issue, feel free to reopen it if you want to discuss it further. |
Describe the request
(not really sure whether this is a bug or an enhancement proposal, preemptive sorry :)
While researching this issue with esp8266/Arduino
esp8266/Arduino#7759
I have noticed that our platform.txt sets mDNS 'board' value to
{build.board}
when sending out_arduino._tcp
data.https://github.com/esp8266/Arduino/blob/a2982f96a49f40197a56207d6a6a0a4a34fcf90a/platform.txt#L134
https://github.com/esp8266/Arduino/blob/a2982f96a49f40197a56207d6a6a0a4a34fcf90a/libraries/ESP8266mDNS/src/LEAmDNS.cpp#L1261
In case of
d1_mini
it isESP8266_WEMOS_D1MINI
https://github.com/esp8266/Arduino/blob/a2982f96a49f40197a56207d6a6a0a4a34fcf90a/boards.txt#L3848-L3849
Neither current stable IDE or arduino-cli board list output anything like the 'nice esp32 board name' described in the issue. While poking around the discovery code and board options of the tool, I have noticed
arduino-cli board details
and the 'Identifying Properties' entry that seem to describe everything needed to detect the board. Replacing-DARDUINO_BOARD="{build.board}"
with-DARDUINO_BOARD="{_id}"
fixed our issue.Shouldn't the arduino-cli discovery code check
{build.board}
instead? Or, perhaps, check both strings? Or we just used the wrong value all this time?Can we get some documentation for mDNS identification process and expected key-values?
(search only finds this entry on pluggable discovery spec - https://arduino.github.io/arduino-cli/0.25/pluggable-discovery-specification/#board-identification)
Only example I have found so far is
https://github.com/arduino-libraries/WiFi101OTA/blob/master/src/WiFi101OTA.cpp
Which simply hard-codes board ID string inside of the source, by using
ARDUINO_...
board flagDescribe the current behavior
With
d1_mini
board, board list showsInstead of the expected
Arduino CLI version
arduino-cli.exe Version: git-snapshot Commit: 63b53c0 Date: 2022-07-12T02:29:55Z
Operating system
Windows
Operating system version
11
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: