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
Very Hot Topic (More than 25 Replies) disable all debugging, compile like arduino IDE (Read 19233 times)
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
disable all debugging, compile like arduino IDE
Oct 27th, 2017 at 4:38pm
Print Post  
Hi!

i was now struggling for hours because my ESP8266 sketch was behaving completely unpredictable regarding WiFi connections. Either it disconnects and reconnects when it receives a packet, or it doesn't reconnect or it connects and disconnects periodically right from the beginning (right after the sketch starts) infinitely.

I then tried to compile my sketch using the arduino IDE and voila, no issues whatsoever.

So: what options do I have to set, to make VisualMicro compile my sketch just as the Arduino IDE would? No debugging, no extra stuff, no extra optimization, ...?

I don't want to load my sketch in the Arduino IDE everytime i want to test a change.

My only use of the VisualMicro Addin is the fact that I can code in Visual Studio instead of the Arduino IDE, which until the last few days, didn't even support anything near IntelliSense.

Thanks!

edit: oh yes, I tried ESP8266 Arduino Core 2.3.0 and 2.4.0 rc2.
« Last Edit: Oct 27th, 2017 at 4:39pm by mamama2 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #1 - Oct 27th, 2017 at 4:45pm
Print Post  
Hi,

You can switch off debug by changing the tool bar from Debug to Release. See docs here

When you have done that please report how it is.

I think the last esp test was 2.3.0 which a lot of people are using.

Are you using OTA or Serial upload?
« Last Edit: Oct 27th, 2017 at 4:45pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #2 - Oct 27th, 2017 at 5:23pm
Print Post  
Thanks for the fast reply.

Unfortunately, setting the tool bar to Release doesn't generate the same output as the Arduino IDE. 
The two resulting bin files aren't even the same size.

391.856 Bytes (Arduino IDE Build)
391.872 Bytes (VMicro Build)

Currently, the "Debug" option and when compiling in Arduino IDE makes the thing work, when compiling with the "Release" option, Wifi connects and disconnects in an endless loop as soon as the ESP is powered on. The rest of the sketch is being executed normally but obviously my software isn't reachable via IP.

I'm using the Web Updater (ESP8266HTTPUpdateServer.h) however it doesn't matter whether I upload the sketch via Serial or via the Web Update page.
  
Back to top
 
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #3 - Oct 27th, 2017 at 8:19pm
Print Post  
now it is the opposite (after ongoing development).

release build works, debug build has the phenomenon where WiFi disconnects and connects infinitely.

thats really annoying. any idea what to configure to make visualmicro compile exactly like the arduino IDE?

again, when compiled with the arduino IDE, there was no issue whatsoever.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #4 - Oct 27th, 2017 at 9:54pm
Print Post  
Hi,

The arduino ide does not have debug so it is always in release mode. Now it is like Visual Micro that is as you request.

I do recall that when serial is connected the opening of the serial window can cause the board to reboot. The serial window opens automatically when in debug mode so this might be related.

I think from memory for the esp8266 you need to ensure the serial dtr and rts are off. Again the arduino ide controls this automatically but then it can be inflexible at the wrong time.

I hope the discussion about the serial window is the key. You should also note that when the serial is open it resets after upload. 

If you want to prove this clearly then power the board from another source, not the pc can't communicate with the usb.

  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #5 - Oct 27th, 2017 at 10:51pm
Print Post  
Hi

thanks for your continuing effort.
I already tried powering the board from my lab PSU, same result.

I can 100% reproduce that when I compile using Arduino IDE and then using VisualMicro in Release Mode, that the output bin files are very different. Also I can 100% reproduce that when uploading the bin compiled with the Arduino IDE the issue doesn't occur and when using the bin compiled with VisualMicro, the issue occurs.

dtr and rts is disabled. it is not related to the serial monitor because the issue also
occurs when no pc is connected to the board. also, the board does NOT reboot, only the wifi connection gets lost and reconnected all the time. the rest of the sketch runs fine all the time.

i do connect to wifi at the beginning and then during loop i maintain and check the connection.
  
Back to top
 
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #6 - Oct 29th, 2017 at 1:03pm
Print Post  
Hi

any idea? Is there anything i can do to help you identifying the issue?

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #7 - Oct 29th, 2017 at 1:18pm
Print Post  
Thanks. No i will try 2.3 over next week
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #8 - Oct 29th, 2017 at 9:18pm
Print Post  
ok thank you! if you need anything, let me know.

I have a feeling that you still don't believe me that the Arduino IDE compiled BIN is not the same as the one compiled by Visual Micro, right?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #9 - Oct 30th, 2017 at 4:10am
Print Post  
No not right thanks
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #10 - Oct 30th, 2017 at 7:25am
Print Post  
OK, I'll wait then.
I really like Visual Micro. It is absolutely fantastic, being able to program Arduino and Arduino compatible stuff in Visual Studio.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #11 - Oct 30th, 2017 at 6:41pm
Print Post  
thanks

if you want to help then switch on vmicro>compiler>verbose and then build and copy the output into a .txt file then email

in arduino ide switch on file>preference>compile verbose then copy the output into a .txt file

Email both files to info[at]visualmicro.com

Thanks
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #12 - Oct 30th, 2017 at 7:17pm
Print Post  
sure, just dropped you an e-mail.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #13 - Oct 30th, 2017 at 7:36pm
Print Post  
Thanks, I can see you aren't using the stable 2.3 which is what has been tested and should be working.

Can you please use the arduino ide board manager to remove 2.4 rc2 and install 2.3 then try again

Then send another two build outputs

Thanks a lot
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #14 - Oct 30th, 2017 at 7:36pm
Print Post  
yeh sorry, will do that and come back to you in a minute.
  
Back to top
 
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #15 - Oct 30th, 2017 at 7:56pm
Print Post  
just resent the logs (now 2.3.0).
  
Back to top
 
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #16 - Oct 31st, 2017 at 5:28pm
Print Post  
were you able to find anything out? doesn't this occur with 2.2.0 (didn't try that yet)?

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #17 - Oct 31st, 2017 at 6:21pm
Print Post  
Hi,

2.3. is fine Visual micro only attempts to support the current release of each board.

The build outputs looks the same so I will try my esp8266 over the next few days. 2.3 has been well used by many over the past year or so.

The linker order is the only difference I see. It's possible that the combination of libraries you are using require a certain order. I will look into why there is a difference.
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #18 - Oct 31st, 2017 at 6:35pm
Print Post  
perfect, thanks! currently i have to compile everything using the arduino IDE, thats quite a PITA...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #19 - Oct 31st, 2017 at 6:39pm
Print Post  
Easier if you switch on external editor in Arduino prefs
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #20 - Oct 31st, 2017 at 6:40pm
Print Post  
it will also speed things up if you email or post a sketch that fails and explain how to make it fail.

Thanks
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #21 - Oct 31st, 2017 at 6:44pm
Print Post  
very cool, didn't know that. thanks once again!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #22 - Oct 31st, 2017 at 7:15pm
Print Post  
pls see my previous but one post requesting a simple example project demonstrating the issue and explain how to reproduce.

Thanks
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #23 - Oct 31st, 2017 at 7:50pm
Print Post  
i don't know how to reproduce it. currently this only happens with my current project. this is also the only project I was working on for a long time.

during ongoing programming the following behaviours occur (alternating):

- only release mode (and arduino ide) compile works
- only debug mode (and arduino ide) compile works
- only arduino ide compile works

by "works" i mean that no unexpected wifi connection things occur (like constantly reconnecting or losing connection when receiving data).

i guess the BIN files are always different, with every sketch, if they are linked together differently by vsmicro than the arduino ide does.

shall I send you my monsterious project? it is about 4000 lines of code and you'd have to acknowledge via mail that you won't redistribute or reuse it without my explicit permission...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #24 - Oct 31st, 2017 at 8:28pm
Print Post  
Quote:
you'd have to acknowledge via mail that you won't redistribute or reuse it without my explicit permission

Those conditions are accepted and always apply to any code that I am sent

I think there is a little confusion. The settings you choose in Visual Micro have no impact on the Arduino IDE. It always compiles the same way and does not know about Visual Micro or Visual Studio.

Questions

I think it should be safe to assume that the Arduino IDE is always working and that build and upload via Visual Micro is always a problem from a network dropping perspective?

Out of interested I assume you have checked that the options on the vMicro menu below the list of boards are the same as are selected in the arduino ide?

Can you confirm how you have configured Visual Micro for network OTA upload to the esp8266? You are selecting an IP address? 

Are you using the esp8266 Arduino OTA system? 

Did you read the lower part of this page and does it look like what you have been doing or have you been using apple bonjour?

Thanks



« Last Edit: Oct 31st, 2017 at 8:28pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #25 - Oct 31st, 2017 at 8:48pm
Print Post  
ok, then I'll send the code to you shortly.

no confusion, I know that the settings have no impact on the arduino ide. that description was referring to my code, to outline that the arduino ide compilation always works so that it is unlikely that i have some coding error which causes this behaviour.

Quote:
I think it should be safe to assume that the Arduino IDE is always working and that build and upload via Visual Micro is always a problem from a network dropping perspective?

yes, that is correct. however, sometimes debug OR release mode works, as I change my code during development. currently only arduino IDE works.

Quote:
Out of interested I assume you have checked that the options on the vMicro menu below the list of boards are the same as are selected in the arduino ide?

yes, the settings are all the same. MHz, Board, SPIFFS size, ...

Quote:
Can you confirm how you have configured Visual Micro for network OTA upload to the esp8266? You are selecting an IP address? 

Are you using the esp8266 Arduino OTA system?

I'm not using any of that. I'm using the Webupdater form which is provided by ESP8266HTTPUpdateServer.h (included in the ESP8266 board package). you include that, do
Code (C++)
Select All
ESP8266WebServer Webserver(80);
ESP8266HTTPUpdateServer httpUpdater; 

 

and

Code (C++)
Select All
httpUpdater.setup(&Webserver); 


and you're good to go. just browse /update and you'll be presented a form where you can upload your bin file.
« Last Edit: Oct 31st, 2017 at 8:48pm by mamama2 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #26 - Oct 31st, 2017 at 9:04pm
Print Post  
Okay I have only ever tried the OTA for upload. I prefer to press F5 and see build + upload. It's really quick.

I think you certainly need to stay away from debug mode because you are controlling the upload process.

I will try to see if I can get your code working over the next few days.

After your code is uploaded what do you do to replicate the issue?





  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #27 - Oct 31st, 2017 at 9:09pm
Print Post  
uploading via the web form is considerably faster than serial and I didn't want to mess around with mdns or anything else that constantly is somehow listening and/or wrapping serial output to some ip stack.

that little web form is resting in the program until it is needed (that means, until i browse the url /update) and doesn't take any computing resources.

after the code is uploaded, it doesn't matter what i do. the vmicro serial monitor is opened all the time but it also doesn't matter if I power cycle the board or power it from an external power supply, entirely without any connection to the computer. if the issue is there, it persists. no speical steps needed to reproduce it.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #28 - Nov 2nd, 2017 at 4:37am
Print Post  
I only asked about the serial monitor when I thought you were using serial upload.

The OTA upload is the same speed as the web upload.
  
Back to top
WWW  
IP Logged
 
mamama2
Junior Member
**
Offline


Posts: 17
Joined: Oct 27th, 2017
Re: disable all debugging, compile like arduino IDE
Reply #29 - Nov 5th, 2017 at 5:09pm
Print Post  
did you have any success in finding the issue or are you still having fun with my horrible code?  Grin

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: disable all debugging, compile like arduino IDE
Reply #30 - Jan 28th, 2018 at 2:34am
Print Post  
Sorry for the delay. The November release might have resolved this issue otherwise I will look into it over the next few weeks.

You can use file>preferences>external editor in the arduino ide which allows edit in VS and upload via Arduino with auto detect changes
« Last Edit: Jan 28th, 2018 at 2:35am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint