probonopd / WirelessPrinting

Print wirelessly from Cura, PrusaSlicer or Slic3r to your 3D printer connected to an ESP8266 or ESP32 module
352 stars 65 forks source link

Add AsyncElegantOTA #118

Closed ayushsharma82 closed 5 years ago

ayushsharma82 commented 5 years ago

Add AsyncElegantOTA to perform OTA's Elegantly.

probonopd commented 5 years ago

Cool! 👍 Build is using the library now but there is still a compile error, please see the build log.

ayushsharma82 commented 5 years ago

@probonopd Right. I am working on a Fix.

ayushsharma82 commented 5 years ago

@probonopd It's saying SendCommands and ReceiveResponses are not declared?

https://github.com/ayushsharma82/WirelessPrinting/blob/master/ESP8266WirelessPrintAsync/ESP8266WirelessPrintAsync.ino#L891

Is that due to, functions declared under it?

probonopd commented 5 years ago

Looks like it. Feel free to move.

ayushsharma82 commented 5 years ago

@probonopd Passed ESP8266 Build. ESP32 Build is causing some problem due to a script error in travis.yml . Please take a look.

probonopd commented 5 years ago

Maybe need to add #include <Hash.h> for ESP32.

I will try to add this.

Seems to be a known issue:

probonopd commented 5 years ago

So this was not sufficient, still getting ESP8266WirelessPrintAsync:9:20: error: Hash.h: No such file or directory for ESP32. Maybe @me-no-dev knows?

ayushsharma82 commented 5 years ago

Maybe you can figure this out.. i have no idea why it's not getting Hash.h

probonopd commented 5 years ago

Yes, but give me some time. Thanks until here, great PR

ayushsharma82 commented 5 years ago

No problem.

probonopd commented 5 years ago

Yay! Looks like we have a winner. :+1:

Do they work for you, including OTA?

(Links available for 14 days)

ayushsharma82 commented 5 years ago

@probonopd I will it check today. 👍

ayushsharma82 commented 5 years ago

Surprisingly, It compiles for me without that library.Try latest release of ESP32 Arduino Core.

ayushsharma82 commented 5 years ago

I just checked the build logs. It is using 75% of Sketch space. Is there any space left for an OTA? 🤦‍♂ .

probonopd commented 5 years ago

On the ESP32 using Firefox 64 on Linux, getting

failed

but the update nevertheless seems to have worked. I have the updated firmware on the machine afterwards.

probonopd commented 5 years ago

Also, we need a link to /update from the main page so that one finds the page.

ayushsharma82 commented 5 years ago

I will update ElegantOTA Webpage by tomorrow. Thanks for testing.

On Sat, 4 May 2019, 2:41 pm probonopd, notifications@github.com wrote:

On the ESP32, getting

[image: failed] https://user-images.githubusercontent.com/2480569/57176827-7c179180-6e4c-11e9-9a64-6a9522216205.png

but the update nevertheless seems to have worked. I have the updated firmware on the machine afterwards.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/probonopd/WirelessPrinting/pull/118#issuecomment-489309353, or mute the thread https://github.com/notifications/unsubscribe-auth/AGK4NSEWAKGJXKPH5A7TXXLPTVHKRANCNFSM4HJ3UDFQ .

ayushsharma82 commented 5 years ago

Fixed webpage and tested on my ESP32. There is a travis script error for esp8266. @probonopd please take a look.

Thanks!

probonopd commented 5 years ago

Don't know why it is failing, perhaps an intermittent issue?

ayushsharma82 commented 5 years ago

I think it's failing due to some change in esp8266 arduino package.json which arduino gets for the board manager.

On Sat, 11 May 2019, 3:33 pm probonopd, notifications@github.com wrote:

Don't know why it is failing, perhaps an intermittent issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/probonopd/WirelessPrinting/pull/118#issuecomment-491497758, or mute the thread https://github.com/notifications/unsubscribe-auth/AGK4NSGRWIJSH3SKVHBS6S3PU2KYNANCNFSM4HJ3UDFQ .

probonopd commented 5 years ago

http://arduino.esp8266.com/stable/package_esp8266com_index.json gives in Firefox:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

ayushsharma82 commented 5 years ago

Yup. It's a problem with their package.json

Can you test it by compiling on your pc for esp8266? We can merge, if it compiles successfully.

On Sat, 11 May 2019, 3:42 pm probonopd, notifications@github.com wrote:

http://arduino.esp8266.com/stable/package_esp8266com_index.json gives in Firefox:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/probonopd/WirelessPrinting/pull/118#issuecomment-491498268, or mute the thread https://github.com/notifications/unsubscribe-auth/AGK4NSA4PBR45FR2T23A4OLPU2LXDANCNFSM4HJ3UDFQ .

probonopd commented 5 years ago

I never compile anything locally. It needs to pass the automated builds...

ayushsharma82 commented 5 years ago

Okay. Then we can wait till esp8266 arduino core fixes itself.

On Sat, 11 May 2019, 3:49 pm probonopd, notifications@github.com wrote:

I never compile anything locally. It needs to pass the automated builds...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/probonopd/WirelessPrinting/pull/118#issuecomment-491498735, or mute the thread https://github.com/notifications/unsubscribe-auth/AGK4NSFRBEOGJ7V4JJO3U43PU2MSBANCNFSM4HJ3UDFQ .

probonopd commented 5 years ago

The build is working now. Do we not get the red arrow anymore? (Couldn't test myself yet)

ayushsharma82 commented 5 years ago

Nope. I have updated AsyncElegantOTA. It shows the Successful when updated. ESP32 was resetting before the AsyncWebServer had actually sent the response in background. So i have added a 1 second delay in which it will send the response back to the webpage.

ayushsharma82 commented 5 years ago

Can we merge it now?

probonopd commented 5 years ago

I did not have a chance to test it on ESP8266 and ESP32 yet, sorry. Do we have a link to the firmware update page from the main frontpage?

ayushsharma82 commented 5 years ago

I will add that

ayushsharma82 commented 5 years ago

Done

probonopd commented 5 years ago

If you have successfully tested updating on ESP8266 and ESP32 hardware with no red arrows or other errors, then I think we can merge?

ayushsharma82 commented 5 years ago

Sure.

On Mon, 13 May 2019, 11:08 pm probonopd, notifications@github.com wrote:

If you have successfully tested updating on ESP8266 and ESP32 hardware with no red arrows or other errors, then I think we can merge?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/probonopd/WirelessPrinting/pull/118?email_source=notifications&email_token=AGK4NSAZOYGY5WWCBWSKXN3PVGRRLA5CNFSM4HJ3UDF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVJA72I#issuecomment-491917289, or mute the thread https://github.com/notifications/unsubscribe-auth/AGK4NSAQTJDMW5JT3ZKKV5LPVGRRLANCNFSM4HJ3UDFQ .