Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By penatenjoe
#33338 I tried to follow the illustrated instructions as closely as I could but I was not yet sucessfull. Here are a couple of observations that maybe helpful to others. If nothing else it would be good if the documentation would say where the limitations of the OTA procedure are.
1.) I am using a NodeMCU 1.0 board using the staging release of the esp8266 package. With the proposed settings of step 3 I could not flash the sketch, something like "sync failed". I used "NodeMCU 1.0" as board and "4M (1M SPIFFS)". With that the script flashed properly, started and registered under the "Port:" menu. My guess is that the flash settings do not really matter at this stage.

2.) The first thing is that the "Upload using:" menu item for the NodeMCU 1.0 board is missing. Maybe that is something that could be fixed?

3.) I switched the settings as described in step 5 and reran the compiler. I received the following error message
java.io.IOException: Cannot run program "python.exe": CreateProcess error=2, System could not find the file
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)

Googling for Igor's code it seemed it needs Python 2.7 which I installed. No improvement, same error message. I fixed the PATH windows variable to include the path for Python and now Python starts when typing "python" in the command line but the error is still the same. Here I am stuck.

4. My project is including webpages which I upload into SPIFFS. It seems that the "ESP8266 sketch data upload" is not yet possible using the OTA, right? Here are the error messages I get when trying
error: Failed to open 192.168.178.43
error: espcomm_open failed
SPIFFS Upload failed!


Is there anyone that is willing to help me along? I do appreciate any help.
Thanks, Bernd
User avatar
By krzychb
#33341 Hi Bernd,

Thank you for detailed diagnostics information.

NodeMCU board is perfectly fine for this exercise.
The key is the flash memory size that should be twice the size of your sketch.

I propose the following:

1. Go back to stable esp8266-1.6.5-947-g39819f0 release if possible. I had similar "sync failed" errors with staging esp8266-1.6.5-1160-gef26c5f and so far did not have time to do diagnostics.

2. After first flashing using serial check on Serial Monitor if module indeed connected to the network:
Arduino OTA Test
Sketch size: 304700
Free size: 741376
IP address: 192.168.1.100


3. Use exact settings I have provided in my previous post including “Board: Generic ESP8266 Module”. Menu for specific (not generic) boards does not have “Upload using:” option implemented. These settings do work for NodeMCU. BTW - I did my testing using similar board as well 8-)

Good luck and let me know the results.

Krzysztof
Last edited by krzychb on Sat Nov 07, 2015 6:27 am, edited 2 times in total.
User avatar
By brutzler
#33342 @Bernd:
I had the same starting-problems using a nodemcu 1.0.
Some things I remember:
- I use python 2.7.2
- Setting path to the python-directory + restart the IDE
- Try without firewall
- Look at my post: http://www.esp8266.com/viewtopic.php?f=32&t=6428. With this changes its possible to use the Generic ESP8266 for serial upload with auto-reset on the nodemcu. generic module will not work with nodemcu, because of different reset.methode.

But finally I got it working :-)
I use Arduino 1.6.5 with staging "1.6.5-1160-gef26c5f" and the DNS-SD_Arduino_OTA-Sketch on a NodeMCU 1.0.
Last edited by brutzler on Sat Nov 07, 2015 6:27 am, edited 1 time in total.
User avatar
By brutzler
#33343 @Krzystof
Thanks for the detailed HowTo. Did give me a lot of answers.
Actually I am using Arduino 1.6.5 with staging "1.6.5-1160-gef26c5f" and the DNS-SD_Arduino_OTA-Sketch on a NodeMCU 1.0.
This is working imho very fine and stable.
You think the better solution would be BasicOTA.ino?

Because of just trying to embedd the ota-code into my project (little webserver for some processvalues e.g. temp, flowrate...) I am guessing which sort of code would be better.
But til now, i did not make any tests with the BasicOTA. Will look this afternoon if there is time....

....didn't find the BasicOTA in the examples. Looks like I will have to search on github....
Is this the right one?
https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA

EDIT:
Did some test with the BasicOTA.
I always got a
Code: Select allOTA server at: ESP8266-OTA-7e6b:8266
Good so far.
But never (maybe one time) saw the IP-port in the IDE.
Nevertheless, I could upload via OTA out of the IDE. Maybe it was still stored, because I uploaded the BasicOTA into a DNS_SD_Arduino_OTA-Sketch.
In that case, I agree with you.
BasicOTA would be easier to embedd, but is not as stable
DNS_SD_Arduino_OTA is stable, but needs more work to embedd into the user-code
Last edited by brutzler on Sat Nov 07, 2015 6:55 am, edited 1 time in total.