Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By penatenjoe
#33358 In the link brutzler provided I read a remark that in future releases OTA shall be supported by other than the generic boards. This encouraged me to try myself and modify the NodeMCU 1.0 entries in boards.txt:
Code: Select allnodemcuv2.build.flash_freq=40

 <-------------------- adding these 4 lines -------------------->
nodemcuv2.menu.UploadTool.esptool=Serial
nodemcuv2.menu.UploadTool.esptool.upload.tool=esptool
nodemcuv2.menu.UploadTool.espota=OTA
nodemcuv2.menu.UploadTool.espota.upload.tool=espota

nodemcuv2.menu.CpuFrequency.80=80 MHz

This created a new "Upload Using:" menu button for the NodeMCU. With the rest of the settings
Unbenanntes Bild.png

OTA now seems to work flawlessly using the staging release both initially via "serial / COMx" and then subsequently via "OTA / Port:".
Hope that helps you too. Thanks,
Bernd
You do not have the required permissions to view the files attached to this post.
User avatar
By krzychb
#33361 @penatenjoe (Bernd)
@brutzler

I have provided a simple instruction how to use OTA and I learned much more from both of you about this functionality just within couple of hours.
Thank you for your willingness to discover new stuff and sharing your discoveries – you are great :D

Regarding the “telnet-stuff” asked by Brend this is just copy and paste from original “DNS_SD_Arduino_OTA.ino“ file. I was also really intrigued what is the purpose of it but decided not alter original code. For me it looks like some bridge with serial.

@igrr – could you, please, shed some light into that?
There is no header whatsoever to unhide the author so we can give him or her a credit for this nice and kind of remarkable file than we are now flashing back and forth over OTA :D
User avatar
By brutzler
#33364
krzychb wrote: For me it looks like some bridge with serial.

You are right. I did a closer look at the code and reactivated it.
If you are connected serial and via telnet (telnet 192.168.x.y 8266) then you can send something over serial and it is shown in the telnet window. And vice versa
Maybe we can use it for debug stuff and similiar, because serial is normaly not available during OTA.
User avatar
By penatenjoe
#33373 This is good knews. I was looking for some simple OTA logging via a Telnet terminal. For that I tried to reduce the code starting at //IDE Monitor to a minimum and use it only for some debug output but have to admit to not understand what it actually does. Does someone know what is needed just for some simple Telnet.print statements?
I removed the echo code in both direction after
Code: Select all   if (Telnet && Telnet.connected() && Telnet.available()){
and added the two lines
Code: Select all  // board is alive
  Telnet.println(millis() / 1000.); n
which seemed to work, albeit slow - 1 line per second.
Thanks, Bernd
BTW: when opening the serial monitor in the IDE it asks for a password? I guess that's another mystery for us to explore.