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
Hot Topic (More than 8 Replies) esp8266 debug not working (Read 11081 times)
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
esp8266 debug not working
Feb 16th, 2017 at 10:38pm
Print Post  
My sketch is working fine, and have now also got a OTA upload working (thanks to your earlier help today). But I cannot get the debugger to deal with any breakpoints I set, either with USB upload/debug or using OTA.
I guess I must be missing a setting somewhere  (I have debugged successfully with a UNO and a Mega256 so know the basic methods).
Am using the latest release.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #1 - Feb 17th, 2017 at 12:14am
Print Post  
When you build does it say compiling debug version?
  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #2 - Feb 17th, 2017 at 10:52am
Print Post  
Not sure, in the build log I have both
Code
Select All
build.vm.build.vmdebug=0 


and
Code
Select All
vm.debug=true 


Full file attached.
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #3 - Feb 17th, 2017 at 1:18pm
Print Post  
Hi,

The compile shows :-

Compiling 'OTA_DHT' for 'Adafruit HUZZAH ESP8266'

That's not a debug build.

If the tool bar set to Release or Debug?

Thanks
« Last Edit: Feb 17th, 2017 at 1:19pm by Tim@Visual Micro »  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #4 - Feb 17th, 2017 at 3:19pm
Print Post  
Tool bar is set to 'Debug'. But I had 'automatic debugging' switched off in the menu because I couldn't compile in debug mode  with the previous version. Now re-enabled 'automatic debug' but getting this from compiler:
Code
Select All
OTA_DHT.ino: 149:38: error: '__VisualMicro_DEBUG_2_GLastMillis__' was not declared in this scope
   Serial.println("closing connection");__VisualMicro_DEBUG_2_GLastMillis__=
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging.
                 If this is an unsupported debug board then switch the tool bar from 'Debug' to 'Release' and try the build again 

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #5 - Feb 17th, 2017 at 3:33pm
Print Post  
Hi,

Please switch on "vmicro>compiler>show build folder"

Then make a debug build.

The output will contain a file:/// link to the build folder

In the build folder will be a .cpp with the same name as your project.

Please zip and email the .cpp to info[at]visualmicro.com or post it here.

Thanks
  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #6 - Feb 17th, 2017 at 4:37pm
Print Post  
Ok here goes...renamed from .cpp to .txt
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #7 - Feb 17th, 2017 at 8:56pm
Print Post  
There will be an update of visual micro in the gallery later today.

This is a bug that crept in a few weeks ago if the project has more than one break-point with a millis HitCount condition.

Thanks for the report.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #8 - Feb 19th, 2017 at 10:45pm
Print Post  
Visual Micro 1802.18 has been released with a fix
  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #9 - Feb 21st, 2017 at 4:53pm
Print Post  
Thanks, I installed the update*. Still got the same issue, it won't compile with a breakpoint on hit count. Other breakpoints (with log to output window) compile OK but I get no output. All works OK with a USB connection.
*but if I look at Tools/Options/VisualMicro/Version I get 1.1702.15

I'm putting the ESP8266 aside for a while; apart from this debug issue, the OTA update seems too unreliable for me. I'm continuing with a UNO project and will try with the ESP again later.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #10 - Feb 21st, 2017 at 4:55pm
Print Post  
Did you remove the hit count from the 2nd breakpoint to confirm what the issue was?
  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #11 - Feb 21st, 2017 at 5:07pm
Print Post  
With two breakpoints just giving an output message (but no hit count) it would compile but I got no messages when it ran.
If I change one of those breakpoints to a hit count I get the compile error.
When running with the connection to COM6 (pretty much the same code, but not using OTA at all) breakpoints all work as expected.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #12 - Feb 21st, 2017 at 11:56pm
Print Post  
When using ota the mcu has to logon to the network so there is a much longer pause while debug starts. Possibly 5-10 seconds.

Can you confirm that with ota, when the serial monitor opened for debug the title showed the correct ip address?

Is the esp8266 using dynamic ip address or fixed?
« Last Edit: Feb 21st, 2017 at 11:57pm by Tim@Visual Micro »  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #13 - Feb 22nd, 2017 at 9:32am
Print Post  
Correct address shown, yes. It's dynamic at present but I could try fixing it.
After uploading the sketch over OTA I usually have to reset the board, which kind of defeats the object of OTA. So something else appears to be wrong (not  to do with VisualMicro, I appreciate, but this may be affecting the results I'm getting. Doesn't explain the compile error though!)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #14 - Feb 22nd, 2017 at 12:51pm
Print Post  
Dynamic is fine but takes a few extra seconds to establish an ip via the dhcp server. 

I have seen the OTA reset issue. It's related to the usb connection to the pc. Switch the usb to "power only"  adaptor (no data) and it will work flawlessly.

If you do keep the usb/pc/serial connection then make sure the DTR and RTS are OFF on the serial monitor or it can cause the issue. If the problem does happen then toggle the RTS on the serial monitor On then OFF. This will cause the esp to reboot and work properly again (avoids pulling the cable or pressing reset).

« Last Edit: Feb 22nd, 2017 at 1:19pm by Tim@Visual Micro »  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #15 - Feb 22nd, 2017 at 3:18pm
Print Post  
Ah! Thanks, yes. I fact I think I discovered this just before I went on holiday. Then forgot when I came back. 
So now my module is just powered by a phone charger. And it repeatedly uploads new code. Hurrah!
Still no output to the 'expressions' window for the IP though. I know the code is passing through the breakpoints because data is being successfully sent up to my website.

p.s. I have Serial.print statements still in my code, which do nothing now of course. Is there an equivalent 'ip.print ' command of some kind?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #16 - Feb 22nd, 2017 at 4:04pm
Print Post  
ip print is coming soon.

When debug starts and the serial monitor opens does it show a com port or ip address at the top?
  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #17 - Feb 22nd, 2017 at 7:49pm
Print Post  
when debugging starts, two windows open: 'Expressions on 192.168.1.104' and 'Network 192.168.1.104'.
The expressions window stays blank; the network window says 'opening port / port open'
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: esp8266 debug not working
Reply #18 - Feb 22nd, 2017 at 10:02pm
Print Post  
Thanks, are breakpoints one-time execute in setup() or in a place that is hit regularly?
  
Back to top
IP Logged
 
chris52
Junior Member
**
Offline


Posts: 47
Joined: Jan 9th, 2017
Re: esp8266 debug not working
Reply #19 - Feb 22nd, 2017 at 10:49pm
Print Post  
In a loop, happening twice per minute.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint