Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
ESP8266 OTA upload (Read 113 times)
perigalacticon
Junior Member
**
Offline



Posts: 54
detroit area
ESP8266 OTA upload
Oct 16th, 2020 at 3:00am
 
I would like to use the new ESP8266 OTA Debugging feature, but first I have to get the regular OTA to work.  I copied the example from "Full working ESP8266 OTA Code Example:-" from [url]https://www.visualmicro.com/page/esp8266.aspx[url].

The sketch uploads over FTDI Serial, I use Debug set to Off, and then I remove the programming mode pin (using ESP01) and reset the board.

The sketch runs and I get this output on the serial monitor:
Code (C++):
Opening port
Port open
Booting
Mode set
Begin complete
SSID: NETGEAR11
DHCP: Waiting for IP Address ...
IP Address: 192.168.1.5
Connected to wifi 


and I see the port listed in the VM menu under "Port or IP".  I get output to the FTDI serial monitor periodically that I put in the code with a non-blocking simple timer.  Now I try to do the OTA upload.  I select the network port and then Build and Upload.  The error I get is:
Code (C++):
Uploading 'VM_ESP8266_OTA_Example' to 'Generic ESP8266 Module' using '192.168.1.5'
Authenticating...FAIL
The uploader process failed
21:42:37 [ERROR]: Authentication Failed 


The only output on the Serial Monitor is:
Code (C++):
Error[0]: Auth Failed 


I notice in the sketch the following 2 lines:
Code (C++):
 // No authentication by default
 ArduinoOTA.setPassword((const char *)"123"); 


I comment out the 2nd line, repeat the above process, and get this error with the line commented out:
Code (C++):
Uploading 'VM_ESP8266_OTA_Example' to 'Generic ESP8266 Module' using '192.168.1.5'
21:48:06 [ERROR]: No response from device
The uploader process failed 


And the accompanying Serial monitor output:
Code (C++):
OTA Start
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed 



Could you please help me get this working? OTA debugging has a lot of potential.


Back to top
 
 
IP Logged
 
perigalacticon
Junior Member
**
Offline



Posts: 54
detroit area
Re: ESP8266 OTA upload
Reply #1 - Oct 16th, 2020 at 5:23am
 
Some further information:

I have Bonjour running in services Task Manager shows Running (Win10).

I checked my router gateway, it shows the Esp is connected and allowed, with no blocking.

I checked Windows Defender, I don't have another Antivirus.  Firewall shows rules for Inbound for Arduino IDE and Visual Studio, everything is allowed for TCP and UDP.  There are no outbound rules for either program however.  There are inbound rules for mDNS UPD-IN and outbound rules for mDNS UDP-OUT.

Bonjour Browser doesn't show the Esp but it shows RPis I have on the network.

Restarting the router, the Esp, IDEs or the PC have no effect.

When I try the same sketch in the Arduino IDE, the network port never shows up on the port list. 
Back to top
« Last Edit: Oct 16th, 2020 at 6:19am by perigalacticon »  
 
IP Logged
 
perigalacticon
Junior Member
**
Offline



Posts: 54
detroit area
Re: ESP8266 OTA upload
Reply #2 - Oct 16th, 2020 at 6:46am
 
Tried adding board.txt in the project folder with overrides per https://www.visualmicro.com/page/esp8266.aspx

Also tried entering the IP address into the port selection box as suggested on the above webpage.  I see that the Esp IP is no longer found on the port list since I rebooted the router and other devices.  The error I get is now:

Code (C++):
Uploading 'VM_ESP8266_OTA_Example' to 'Generic ESP8266 Module' using '192.168.1.5'
01:39:18 [ERROR]: No Answer
The uploader process failed 



or
Code (C++):
The uploader process failed
02:12:54 [ERROR]: No response from device 


and on Serial Monitor:
Code (C++):
OTA Start
Progress: 0%
Error[2]: Connect Failed
Error[4]: End Failed 




Also if I ping the IP there is no response.

Back to top
« Last Edit: Oct 16th, 2020 at 7:17am by perigalacticon »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10894
United Kingdom
Re: ESP8266 OTA upload
Reply #3 - Oct 16th, 2020 at 5:47pm
 
Hi

The Auth example applies only if your OTA code on the ESP specifies Auth is required and specifies the password. I expect you have not set the Auth and that is why you should not specify it (or enable auth) in board.txt.

If we ignore apple bonjour life can be simpler...

If you can't ping the ip address that would suggest that the esp has not booted and started the wifi correctly.

I suggest following the guide in the yellow box above so that we can see your settings and also providing your OTA code.

Without an IP address resolved via bonjour, you need to enter an IP manually and also in the board.txt would need to set the network.port=8266. Apple bonjour provides us an IP, port and if Auth is required. Therefore, without bonjour we simply need to specify those properties to allow OTA to work.

The network.port= is actually specified in your OTA code on the ESP. However the ESP core defaults to "8266", therefore we use that in our examples and it is normally correct.

Thanks

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
perigalacticon
Junior Member
**
Offline



Posts: 54
detroit area
Re: ESP8266 OTA upload
Reply #4 - Oct 17th, 2020 at 2:53pm
 
When OTA upload is initiated the Esp is contacted via WIFI because it is responding on the Serial Monitor.  It's whatever results in the "Connect Failed" response that is the problem.  I attached the verbose compile and upload for the Serial Upload, and for the OTA upload.
Back to top
« Last Edit: Oct 17th, 2020 at 2:58pm by perigalacticon »  

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10894
United Kingdom
Re: ESP8266 OTA upload
Reply #5 - Oct 18th, 2020 at 2:12pm
 
Often this is flash size set too small but you don't seem to be near near the limit.

What hapens in the arduino ide? If it works every time then please give verbose output using "file>preferences> upload verbose and compile verbose" in the arduino ide
Back to top
« Last Edit: Oct 18th, 2020 at 2:12pm by Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print