Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • 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
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ESP8266 OTA upload (Read 2244 times)
perigalacticon
Junior Member
**
Offline


Posts: 55
Location: detroit area
Joined: Nov 7th, 2016
ESP8266 OTA upload
Oct 16th, 2020 at 2:00am
Print Post  
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++)
Select All
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++)
Select All
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++)
Select All
Error[0]: Auth Failed 


I notice in the sketch the following 2 lines:
Code (C++)
Select All
 // 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++)
Select All
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++)
Select All
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: 55
Location: detroit area
Joined: Nov 7th, 2016
Re: ESP8266 OTA upload
Reply #1 - Oct 16th, 2020 at 4:23am
Print Post  
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.  
« Last Edit: Oct 16th, 2020 at 5:19am by perigalacticon »  
Back to top
 
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 55
Location: detroit area
Joined: Nov 7th, 2016
Re: ESP8266 OTA upload
Reply #2 - Oct 16th, 2020 at 5:46am
Print Post  
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++)
Select All
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++)
Select All
The uploader process failed
02:12:54 [ERROR]: No response from device 


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




Also if I ping the IP there is no response.

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 OTA upload
Reply #3 - Oct 16th, 2020 at 4:47pm
Print Post  
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
WWW  
IP Logged
 
perigalacticon
Junior Member
**
Offline


Posts: 55
Location: detroit area
Joined: Nov 7th, 2016
Re: ESP8266 OTA upload
Reply #4 - Oct 17th, 2020 at 1:53pm
Print Post  
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.
« Last Edit: Oct 17th, 2020 at 1:58pm by perigalacticon »  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 OTA upload
Reply #5 - Oct 18th, 2020 at 1:12pm
Print Post  
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
« Last Edit: Oct 18th, 2020 at 1:12pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint