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] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) Blynk, ESP8266 NodeMCU use with Visual Micro (Read 20430 times)
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Blynk, ESP8266 NodeMCU use with Visual Micro
Nov 7th, 2017 at 4:00pm
Print Post  
Using Visual Studio Community 2017.
Board: HiLetgo ESP8266 NodeMCU LUA CP2102 ESP-12E

I am trying to run a simple Blynk,
http://www.blynk.cc/, application.  The application works with the straight Arduino IDE.  With VS and Visual Micro the same code compiles and uploads, but does not work, i.e., the Blynk application on my Android tablet never contacts the Blynk server, as it does when using the Arduino IDE.

In the Arduino IDE the "Programmer" is listed as "AVRISP mkll".  I cannot find a similar setting or choice in the Visual Micro menus within Visual Studio.

Is there a setting I am missing or an incompatibility?
  
Back to top
 
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #1 - Nov 7th, 2017 at 6:05pm
Print Post  
FWIW, I got the Visual Studio/Visual Micro code to run 1 time out of about 10 tries.  I would then stop the code and try to compile and upload again, without changing the code, and it would not work.

Some time ago I was experimenting with the plain ESP8266 module and Visual Studio / Visual Micro connected with the correct interface.  It would do the same thing, work, then not work.

The Arduino IDE works every time.  I think that Visual Micro "reaches out" and uses the installed Arduino IDE's code.  I am thus at a loss as to why Visual Studio / Visual Micro is so pernickety by comparison.
  
Back to top
 
IP Logged
 
Tozapid
Newbies
*
Offline


Posts: 7
Joined: Nov 8th, 2017
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #2 - Nov 8th, 2017 at 6:22pm
Print Post  
Hi, you can try my way - http://www.visualmicro.com/forums/YaBB.pl?num=1510147192/0#5
I turn off debug mode
  
Back to top
 
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #3 - Nov 8th, 2017 at 10:52pm
Print Post  
Tozapid,

I tried your suggestion, and it does work.  I got the same result by setting Visual Studio to compile "Release".

However, I want the debugger functionality.  Have you figured out how to get the debugger to work?  For some reason, mine will work one time in five to ten tries.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #4 - Nov 10th, 2017 at 6:00am
Print Post  
Sorry for the delay.

The programmer selection in the arduino ide can be ignored. it is not used by the arduino ide unless you click "upload using programmer"

Are you trying to debug using Serial?

Is your upload method Serial or OTA?

Which version is esp core?

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


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #5 - Nov 10th, 2017 at 3:36pm
Print Post  
Tim@Visual Micro wrote on Nov 10th, 2017 at 6:00am:
The programmer selection in the arduino ide can be ignored. it is not used by the arduino ide unless you click "upload using programmer"

Tim, Thanks for your queries.

Are you trying to debug using Serial?  If I understand this correctly, I am trying to use the serial monitor to see what the code is doing by inserting breakpoints in the code.

Is your upload method Serial or OTA?
All the uploads have been via serial connection not over the air.

Which version is esp core?  ESP-12E

The problem seems to be in making the WiFi connection.  For Blynk and earlier experiments with the original ESP8266, the code gets "stuck" and does not return from the command to connect to WiFi with "Debug" compiled code.  Even though I am interacting with the NodeMCU module via a wired, serial connection, the uploaded code on the NodeMCU must connect to my router via WiFi.  This is seamless for "Release" compilations, but fraught with difficulties for "Debug" compilations.  When using the original ESP8266 a while back I had the same problem, viz., only sporadic connection to the WiFi router.  At that earlier time it was always with "Debug" compilations as I had not discovered that "Release" configurations did not and do not have this problem.


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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #6 - Nov 10th, 2017 at 4:16pm
Print Post  
Ah okay. If I recall the esp core fails to connect to wifi if the delay(millis) syntax is used before the wifi connects. 

The debugger normally uses  a short delay to wait a small time, to ensure the ide has started listening for debug. 

Because of this issue, normally for esp visual micro skips the delay(). However your report suggests that in recent versions of visual micro the "delay()" is being applied for esp.

I will check for the next release thanks
  
Back to top
WWW  
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #7 - Nov 12th, 2017 at 5:34pm
Print Post  
Tim,

Thanks for the feedback.

Not to be a pest, but have you any idea how long before this issue will be corrected in a new release of Visual Micro?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #8 - Nov 12th, 2017 at 6:19pm
Print Post  
prob over next week or two.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #9 - Nov 18th, 2017 at 4:45pm
Print Post  
There will be an update over the next few days. I have removed a delay() command from the esp debug startup which might be the cause of the wifi connect issue.

I have also updated the visualmicro.com esp8266 page with my test example which works in both wifi and serial mode.

So it will be useful for you to use the same test thanks. 

I found it worked in both release and serial upload/debug mode. The code I use also waits for the IP address to be established and gives useful serial messages to see what is happening during boot.

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


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #10 - Nov 20th, 2017 at 10:46pm
Print Post  
Tim,

I have tried the new version, 1711.19.0, and it no longer stalls when connecting to WiFi.

I am trying to design two applications with Blynk,
http://www.blynk.cc/.  For Release code, neither display the results of Serial.print.  In Debug code, one will show both Serial.print output and messages associated with breakpoints, the other will show neither.

I cannot see any differences in the code that would cause a basic thing like Serial.print (or println) to fail, or why it would be different between two applications.  I have no idea if this is related to Visual Micro, but I thought I'd ask.

Thanks for the quick turnaround on the latest release.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #11 - Nov 21st, 2017 at 2:31am
Print Post  
what speed are you setting in serial.begin() ?

are you terminating your prints with println(ln) or \r\n?
« Last Edit: Nov 21st, 2017 at 2:32am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #12 - Nov 21st, 2017 at 12:34pm
Print Post  
For Serial.Begin() I have tried both 9600 and 115200.

I have NOT been terminating my prints with either println(ln) or \r\n.  Do you recommend that I do so?
  
Back to top
 
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #13 - Nov 21st, 2017 at 2:00pm
Print Post  
Tim,

I have tried to find println(ln) and cannot.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #14 - Nov 21st, 2017 at 3:20pm
Print Post  
You should terminate the serial prints otherwise the serial monitor will not know when to show data. It should still show the data but be less responsive.

If you have not read the documentation for the arduino ide then you should be aware that your serial.begin speed should match the speed that is selected on the lower button panel of the serial monitor. The default is 115200 so stick with that until you know what you are doing.

In release mode at 9600 you won't see any data if the monitor is set to 115200

In debug mode visual micro automatically attempts to discover the speed your code is using or it defaults to 115200


serial.print("Hi")
serial.print(" there\r\n")

serial.println("Hi there")

serial.print("hi there")
serial.println()
« Last Edit: Nov 21st, 2017 at 3:28pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #15 - Nov 21st, 2017 at 3:41pm
Print Post  
Tim,

I know that.  In your note of yesterday at 9:31pm you asked if I was "terminating your prints with println(ln)".  I do not know, nor could I find a reference to, "println(ln)" function.  It looks to me like it is a typo, but I am not sure.

This morning (USA) I have tried various things with no luck.  I have added "\r\n" to print(), I have added println() after print() statements, etc..

Also, breakpoint messages are not coming through.  For example, I put a breakpoint message at the beginning of loop() to trigger when "millis() % 5000UL == 0" and display "loop() running", but the message never appears.

Even fixed breakpoints, i.e., stop at this line, do not work.

I have tried the code directly in the Arduino IDE standalone and the print functions do not print there either.  That is only a "Release" version, so to speak.

That one application using Visual Micro will Serial print, at least some of the time, and another will not is puzzling and appears to be beyond anything I can figure out.

It appears to me that something is interfering with the the Serial call or the Serial.print call.  That debug breakpoint messages do not get through may be related, but I do not know.  That is, something deep is going on.  The Blynk people, per a forum post, say that their code is just an adder, i.e., it does nothing to change the Arduino functions in question.
  
Back to top
 
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #16 - Nov 21st, 2017 at 4:01pm
Print Post  
Tim,

Further to my post of a few minutes ago, I just found that the a breakpoint set to stop execution at a line will work in the setup() function, and show in the "Micro Debug Trace" window as stopped at the given line.

A stop execution breakpoint in the loop() function stops execution, with with NO indication in the "Micro Debug Trace" window.  Further, I could not examine the current values of the variables when it had stopped.  The right-click menu looked as it does when the program is not running.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #17 - Nov 21st, 2017 at 4:04pm
Print Post  
Have you ever used the debugger before?

Please give screen shot of full ide with status bar, trace and code when the break point is stopped in the loop.

Does click the "Continue execution" on the breakpoint properties and also adding a "message" to the breakpoint show correctly in the trace when the app is running?
  
Back to top
WWW  
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #18 - Nov 21st, 2017 at 6:02pm
Print Post  
Tim wrote: Have you ever used the debugger before?

Yes.

Tim wrote: Please give screen shot of full ide with status bar, trace and code when the break point is stopped in the loop.

The two images are successive runs of the program.  In the first image the breakpoint shown has no message associated with it.  In the second, there is a message associated with it.  In both cases, the execution is to stop at that line.

Tim wrote: Does click the "Continue execution" on the breakpoint properties and also adding a "message" to the breakpoint show correctly in the trace when the app is running?

When the code stops, as shown in the attached two screenshots, the “Continue execution” button on the VMicro toolbar is grayed-out.  Adding a message to the breakpoint displays nothing in the “Micro Debug Trace” output window, as shown in the second image.

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
arduinoUser2
Junior Member
**
Offline


Posts: 41
Joined: Dec 30th, 2015
Re: Blynk, ESP8266 NodeMCU use with Visual Micro
Reply #19 - Nov 21st, 2017 at 11:14pm
Print Post  
Tim,

I sent the two screen shots in the last post.  I have also played with the application while following the Visual Micro instructions for debugging, just to be sure I was not missing something basic.  No change.

I said in the original post that I am using a "HiLetgo ESP8266 NodeMCU LUA CP2102 ESP-12E" board.  Since it is compiling and running properly, I am guessing that that is not the problem.  I just wanted to bring it up again to be sure.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint