Enable OTA Update mechanism for any mDNS enabled platform
 #4107

Merged
merged 3 commits into from Dec 16, 2015

Conversation

@me-no-dev
Contributor

me-no-dev commented Nov 7, 2015

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 added some commits Oct 2, 2015

Enable OTA Update mechanism for any mDNS enabled platform
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

This comment has been minimized.

Show comment
Hide comment
@igrr

igrr 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.

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

This comment has been minimized.

Show comment
Hide comment

👌🏻

@facchinm

This comment has been minimized.

Show comment
Hide comment
@facchinm

facchinm Nov 11, 2015

Member

@ArduinoBot build this please

Member

facchinm commented Nov 11, 2015

@ArduinoBot build this please

@me-no-dev

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Nov 11, 2015

Contributor

OS X test went fine on both Yun and ESP8266

Contributor

me-no-dev commented Nov 11, 2015

OS X test went fine on both Yun and ESP8266

@ffissore ffissore self-assigned this Nov 12, 2015

@me-no-dev

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Nov 12, 2015

Contributor

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

Contributor

me-no-dev commented Nov 12, 2015

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

This comment has been minimized.

Show comment
Hide comment
@AdySan

AdySan 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?

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

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Nov 15, 2015

Contributor

@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.

Contributor

me-no-dev commented Nov 15, 2015

@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.

@AdySan AdySan referenced this pull request Nov 22, 2015

Closed

OTA on ESP-201 #4200

@lmihalkovic lmihalkovic referenced this pull request in lmihalkovic/Arduino Nov 22, 2015

Open

Wouldn't it be nice if Arduino IDE .... #1

@krzychb

This comment has been minimized.

Show comment
Hide comment
@krzychb

krzychb 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

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

This comment has been minimized.

Show comment
Hide comment
@reaper7

reaper7 Nov 22, 2015

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

reaper7 commented Nov 22, 2015

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

@toyorg

This comment has been minimized.

Show comment
Hide comment
@toyorg

toyorg Nov 23, 2015

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

toyorg commented Nov 23, 2015

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

@me-no-dev

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Nov 28, 2015

Contributor

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

Contributor

me-no-dev commented Nov 28, 2015

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

@ffissore

This comment has been minimized.

Show comment
Hide comment
@ffissore

ffissore Nov 30, 2015

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

Contributor

ffissore commented Nov 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@facchinm

facchinm Nov 30, 2015

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

Member

facchinm commented Nov 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Nov 30, 2015

Contributor

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.

Contributor

me-no-dev commented Nov 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@facchinm

facchinm Nov 30, 2015

Member

BTW, I'm 👍 for merging this 😉

Member

facchinm commented Nov 30, 2015

BTW, I'm 👍 for merging this 😉

@crushedice2000

This comment has been minimized.

Show comment
Hide comment

👍

@lmihalkovic

This comment has been minimized.

Show comment
Hide comment

[NTS]

@TurBoss

This comment has been minimized.

Show comment
Hide comment

TurBoss commented Dec 16, 2015

👍

@krzychb krzychb referenced this pull request in esp8266/Arduino Dec 16, 2015

Closed

IDE doesn't find Network ports (Win) #1215

@sticilface

This comment has been minimized.

Show comment
Hide comment
@sticilface

sticilface Dec 16, 2015

Please merge!

Please merge!

@facchinm

This comment has been minimized.

Show comment
Hide comment
@facchinm

facchinm Dec 16, 2015

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 😄

Member

facchinm commented Dec 16, 2015

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

Merge pull request #4107 from me-no-dev/esp8266-ota
Enable OTA Update mechanism for any mDNS enabled platform


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

@krzychb

This comment has been minimized.

Show comment
Hide comment
@krzychb

krzychb 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

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

This comment has been minimized.

Show comment
Hide comment
@reaper7

reaper7 Dec 16, 2015

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

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 me-no-dev:esp8266-ota branch Dec 16, 2015

@thegimliboy

This comment has been minimized.

Show comment
Hide comment
@thegimliboy

thegimliboy Dec 16, 2015

Thanks for merging 😄

Thanks for merging 😄

@mralexgray

This comment has been minimized.

Show comment
Hide comment
@mralexgray

mralexgray Dec 16, 2015

Hallelujah.

Hallelujah.

@mishoboss

This comment has been minimized.

Show comment
Hide comment
@mishoboss

mishoboss Dec 16, 2015

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

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

This comment has been minimized.

Show comment
Hide comment
@krzychb

krzychb 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

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

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Dec 17, 2015

Contributor

kinda sad it did not make it into 1.6.7 :(

Contributor

me-no-dev commented Dec 17, 2015

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

This comment has been minimized.

Show comment
Hide comment
@facchinm

facchinm Dec 17, 2015

Member

It made it into 1.6.7 at the end 😉

Member

facchinm commented Dec 17, 2015

It made it into 1.6.7 at the end 😉

@me-no-dev

This comment has been minimized.

Show comment
Hide comment
@me-no-dev

me-no-dev Dec 17, 2015

Contributor

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

Contributor

me-no-dev commented Dec 17, 2015

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

@me-no-dev me-no-dev referenced this pull request in Sloeber/arduino-eclipse-plugin Dec 17, 2015

Closed

Add Generic OTA for NonSSH boards #333

cmaglie added a commit that referenced this pull request Dec 21, 2015

Fixed unit-test UploaderFactoryTest
It was broken after merging #4107

lmihalkovic added a commit to lmihalkovic/Arduino that referenced this pull request Dec 31, 2015

Fixed unit-test UploaderFactoryTest
It was broken after merging #4107

@krzychb krzychb referenced this pull request in Sloeber/arduino-eclipse-plugin Apr 22, 2016

Closed

V3 Upload menu option is not taken into account (for example with esp8266 ) #439

@g0ro

This comment has been minimized.

Show comment
Hide comment
@g0ro

g0ro Jun 16, 2016

@ArduinoBot build this please

g0ro commented Jun 16, 2016

@ArduinoBot build this please

@facchinm

This comment has been minimized.

Show comment
Hide comment
@facchinm

facchinm Jun 16, 2016

Member

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

Member

facchinm commented Jun 16, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment