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

IDE OTA Upload changes #980

Merged
merged 8 commits into from
Nov 10, 2015
Merged

IDE OTA Upload changes #980

merged 8 commits into from
Nov 10, 2015

Conversation

me-no-dev
Copy link
Collaborator

  • added md5.h and MD5Builder with access to the ROM md5 functions
  • added DIGESTish_MD5 authentication to espota.py and ArduinoOTA
  • added MD5 check of the received image in Updater
  • added extra fields to mDNS to enable IDE OTA for when/if our changes are accepted by the Arduino team
  • add/changed recipe for network upload through the IDE for when/if our changes are accepted by the Arduino team
  • big overhaul to ArduinoOTA to facilitate all necessary authentication and sanity checks
  • fixed relevant example sketches

my Arduino IDE branch with IDE Upload included: https://github.com/me-no-dev/Arduino-1/tree/esp8266-ota

Me No Dev and others added 2 commits November 7, 2015 22:02
mDNS responds with more TXT properties
platform change to support OTA functions
espota.py added authentication parameter
IDE branch: https://github.com/me-no-dev/Arduino-1/tree/esp8266-ota
Me No Dev and others added 6 commits November 8, 2015 02:01
python was keeping the connection open and sending duplicate FINs until
the ESP came back online, because the ESP was resetting without giving
the network a chance to answer and close
igrr added a commit that referenced this pull request Nov 10, 2015
@igrr igrr merged commit 450718b into esp8266:master Nov 10, 2015
@eliabieri
Copy link

did this fix the error, where the arduino IDE always wanted a password?

Elia Bieri
whateveryouwant@eliabieri.com

@me-no-dev
Copy link
Collaborator Author

no. This fixes everything else and adds security
when/if the IDE changes are accepted then upload will work as it is supposed to and ask for password only if you have secured OTA running.
The reason you get asked for password is because by default only Yuns use the network and they are SSH secured

@sticilface
Copy link
Contributor

The new OTA, defines extern ArduinoOTAClass ArduinoOTA;
Im working on a settings manager that allowed you to start and stop the OTA with the flick of a switch. say you have lots of ESPs... This used new and delete to create the object dynamically. my knowledge of c++ is not good enough to know if 1) you can override that or 2) if i used

       ota_server = new ArduinoOTAClass; 

would that effectively mean i have two objects ota_server & ArduinoOTA in memory? i.e. a waste or resources?

@igrr
Copy link
Member

igrr commented Nov 11, 2015

Today I was actually thinking of reverting this change — I don't think we
should have ArduinoOTA instance allocated by default.

The pattern of statically allocated instances works well when these
instances map to hardware resources (e.g Serial and SPI). For things such
as network services this pattern is less applicable, and this becomes
obvious when application complexity passes the level of "I only initialize
things once".

On Wed, Nov 11, 2015, 21:54 sticilface notifications@github.com wrote:

The new OTA, defines 'extern ArduinoOTAClass ArduinoOTA;'
Im working on a settings manager that allowed you to start and stop the
OTA with the flick of a switch. say you have lots of ESPs... This used new
and delete to create the object dynamically. my knowledge of c++ is not
good enough to know if 1) you can override that or 2) if i used

   ota_server = new ArduinoOTAClass;

would that effectively mean i have two objects ota_server & ArduinoOTA in
memory? i.e. a waste or resources?


Reply to this email directly or view it on GitHub
#980 (comment).

@sticilface
Copy link
Contributor

Ah ok. Good to know. thanks

For future reference having two objects, even if one is never used double the memory usage?

@me-no-dev
Copy link
Collaborator Author

but looked at it differently, you can have only one ArduinoOTA and you allocate it when you include the header

@me-no-dev
Copy link
Collaborator Author

So even though it's not directly "hardware" related, it still can exist only once. Any other situation will lead to unknown results. You can not have more than one UDP listener on a particular port and even if you could have more, you could not know which one will get the packet and so on. Therefore I strongly believe that in this case a global object should be used (I think I even made it so it does not init twice).
Surely a method to stop the OTA can be added, but what will you actually stop? MDNS, the UDP or?
This is the only reason I made it global: it can have only one instance running at any given time.

@sticilface
Copy link
Contributor

I agree, only one instance running at a time. My two cents is that i've now got ~ 9 of these in the home, more if u count the ones not running the arduino code... so it means i've got a lot of OTA stuff going on, in that menu. My settings manager allowed me to turn off OTA by deleting a dynamically created OTA object. ( i also see your point looking at the MDNS stuff that there is no destructor , or remove service options, once it is added). This meant I can just have the unstable / projects I'm working on show up. means I'm less likely to go and flash the wrong device. I have to go enable it, then flash it.

so +1 for stop method. New lib is ace btw. much better!

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.

6 participants