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

Enable OTA Update mechanism for any mDNS enabled platform
 #4107

Merged
merged 3 commits into from
Dec 16, 2015
Merged

Enable OTA Update mechanism for any mDNS enabled platform
 #4107

merged 3 commits into from
Dec 16, 2015

Conversation

me-no-dev
Copy link
Contributor

Adds ability to update the firmware of non-SSH boards using TXT
parameters from mDNS

Three new TXT keys are added (defaults are capital):

  1. ssh_upload=YES/no
  2. tcp_check=YES/no
  3. auth_upload=yes/NO
  • "ssh_upload" controls which Uploader should be used. Defaults to
    SSHUploader
  • "tcp_check" controls wether TCP reachability test should be performed.
    Defaults to "yes". Boards that have few TCP ports available, can use
    "no" to skip the check and update over UDP (ESP8266 for example).
  • "auth_upload" controls wether authentication is required (only for
    "ssh_upload=no").

One new pattern and two new variables are available.

  1. Var "network.port" resolves to the advertised by mDNS device port.
  2. Var "network.password" resolves to the entered device password if
    upload authentication is used, else it's empty string.
  3. Pattern "upload.network_pattern" is usable if the platform is using
    different tool/command to do network updates. If not defined,
    "upload.pattern" will be used instead.

Changes are inspired by the need of the ESP8266 Arduino project to utilize it's wireless for simple updates, it does not interfere with any other previous configuration or official Arduino boards and can be applied to basically any networked MCU.

me-no-dev and others added 3 commits October 2, 2015 19:22
Adds ability to update the firmware of non-SSH boards using TXT
parameters from mDNS
Three new TXT keys are added (defaults are capital):
  ssh_upload=YES/no
  tcp_check=YES/no
  auth_upload=yes/NO

"ssh_upload" controls which Uploader should be used. Defaults to
SSHUploader
"tcp_check" controls wether TCP reachability test should be performed.
Defaults to "yes". Boards that have few TCP ports available, can use
"no" to skip the check and update over UDP (ESP8266 for example).
"auth_upload" controls wether authentication is required (only for
"ssh_upload=no").

One new pattern and two new variables are available.
Var "network.port" resolves to the advertised by mDNS device port.
Var "network.password" resolves to the entered device password if
upload authentication is used, else it's empty string.
Pattern "upload.network_pattern" is usable if the platform is using
different tool/command to do network updates. If not defined,
"upload.pattern" will be used instead.
@igrr
Copy link

igrr commented Nov 11, 2015

Would really like to see this merged. Network upload stopped working for the esp8266 core since 88e8019 when upload.via_ssh property was removed.

@eliabieri
Copy link

👌🏻

@facchinm
Copy link
Member

@ArduinoBot build this please

@me-no-dev
Copy link
Contributor Author

OS X test went fine on both Yun and ESP8266

@ffissore ffissore self-assigned this Nov 12, 2015
@me-no-dev
Copy link
Contributor Author

Tested also on Windows XP 32, Windows 8.1 64 and Windows 10 Pro with success on all 3 OS's and both Arduino Yun and ESP8266

@AdySan
Copy link

AdySan commented Nov 15, 2015

@me-no-dev On OSX testing the binaries generated above with ESP8266 (NodeMCU 0.9), I get a prompt asking "Type board password to upload a new sketch", any idea how to get around this?

@me-no-dev
Copy link
Contributor Author

@AdySan Have you set a password ArduinoOTA.setPassword()?
If not, are you using the latest ESP8266 core from git? Updated OTA core is not yet published to the packager, so you need to manually clone the repository and use that.

@krzychb
Copy link

krzychb commented Nov 22, 2015

Love heart you put into development of Arduino IDE and I am looking forward to seeing PR # 4107 merged 👍

keep calm and merge pr-4107 s

@reaper7
Copy link

reaper7 commented Nov 22, 2015

@ArduinoBot - windows version on win10pro works perfectly for me!
@me-no-dev good job - tnx!

@toyorg
Copy link

toyorg commented Nov 23, 2015

Win 10 Edu x64 with NodeMCU 1.0 works flawlessly. Thanks @me-no-dev

@me-no-dev
Copy link
Contributor Author

@ffissore is there something wrong with the code? Or a reason to hold/reject this pull request?

@ffissore
Copy link
Contributor

Lack of thorough testing on our side. Plus, @facchinm tried it for a few hours and it broke his dev env, so there are unhandled corner cases

@facchinm
Copy link
Member

Really the bug I experienced was my fault, I've being testing this PR + my code for two weeks now and I haven't found any misbehaviour with original "upload using ssh" flow

@me-no-dev
Copy link
Contributor Author

we had a similar case when the current IDE was not closed prior to installing/starting the PR Build, but I doubt any of that could be related as the code itself does not really touch anything that could cause a trouble.

@facchinm
Copy link
Member

BTW, I'm 👍 for merging this 😉

@0x2b3bfa0
Copy link

👍

@lmihalkovic
Copy link

[NTS]

@TurBoss
Copy link

TurBoss commented Dec 16, 2015

👍

@sticilface
Copy link

Please merge!

@facchinm
Copy link
Member

No problem so far with this PR, had no time to test it directly but surely it doesn't harm the normal flow (ssh powered), so I'm going to merge it at last 😄

facchinm added a commit that referenced this pull request Dec 16, 2015
Enable OTA Update mechanism for any mDNS enabled platform

@facchinm facchinm merged commit 22a37ea into arduino:master Dec 16, 2015
@krzychb
Copy link

krzychb commented Dec 16, 2015

Hi Martino,

This is great!

If I were a woman I would give you a kiss
But I am not – so what about a hug?

Thank you for merging this pull request 😄 👍

Krzysztof

@reaper7
Copy link

reaper7 commented Dec 16, 2015

👍
works for me on latest hourly_builds (16 December 2015 10:15:28 GMT)
tnx!

@me-no-dev me-no-dev deleted the esp8266-ota branch December 16, 2015 11:08
@thegimliboy
Copy link

Thanks for merging 😄

@mralexgray
Copy link

Hallelujah.

@mishoboss
Copy link

I just tried with today's build and I've got this:

[ERROR]: No response from device

Device is listed in the Network ports of Arduino IDE. I'm trying the "OTA-mDNS-SPIFFS.ino" example. Any ideas?

P.S. This is on OSX 10.11.2

@krzychb
Copy link

krzychb commented Dec 16, 2015

Hi mishoboss - try this one - esp8266/Arduino#1196 (comment) and check what is shown on serial terminal
This tread is now reserved to express our gratitude to Martino 😄
Krzysztof

@me-no-dev
Copy link
Contributor Author

kinda sad it did not make it into 1.6.7 :(

@cmaglie cmaglie added this to the Release 1.6.7 milestone Dec 17, 2015
@facchinm
Copy link
Member

It made it into 1.6.7 at the end 😉

@me-no-dev
Copy link
Contributor Author

Oh my god! Thanks! Did not mean to rant, but was so not looking forward troubleshooting users another release cycle :)

@g0ro
Copy link

g0ro commented Jun 16, 2016

@ArduinoBot build this please

@facchinm
Copy link
Member

@g0ro, the patch is already included in IDE 1.6.7+, no need to trigger a bot build

@sypumsb
Copy link

sypumsb commented Mar 10, 2019

@ArduinoBot build this again, or give new link. I have several reasons to stay on the old version. Please.

@artynet
Copy link
Contributor

artynet commented Oct 13, 2020

hello @facchinm would you mind writing the exact syntax to customise the boards.txt file ? plese be more specific....

I have tried so far :

myBoard.tcp.ssh_upload=no  
myBoard.tcp.tcp_check=no  
myBoard.tcp.auth_upload=no

myBoard.network.ssh_upload=no  
myBoard.network.tcp_check=no  
myBoard.network.auth_upload=no 

myBoard.port.ssh_upload=no  
myBoard.port.tcp_check=no  
myBoard.port.auth_upload=no

myBoard.ssh_upload=no  
myBoard.tcp_check=no  
myBoard.auth_upload=n

these four combinations without any result...I would really appreciate your help....

@me-no-dev
Copy link
Contributor Author

@artynet properties are given through mDNS, not through boards config.

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.