Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
ESP8266 debug, Variable change slows everything down (Read 906 times)
Visual Micro
Administrator
*****
Offline



Posts: 8120
United Kingdom
Re: ESP8266 debug, Variable change slows everything down
Reply #6 - Jun 2nd, 2017 at 2:39pm
 
Hi,

Thanks, that tells me what to look for.

Point to note: 10ms is too fast to a non-breaking trace point. The pc can't work that fast especially when graphics are involved and I also suspect the Arduino serial buffer is overfilling and only part of the packets are arriving at the server/pc. So the refresh appears to slow but actually it's just waiting for a non corrupted packet. I will try to replicate and then find a workaround or show some hint on the screen that will explain what is happening.

The udp var update isn't far off. Hopefully a few weeks.
Back to top
 
WWW  
IP Logged
 
dob
Newbies
*
Offline



Posts: 4
Re: ESP8266 debug, Variable change slows everything down
Reply #5 - Jun 2nd, 2017 at 1:20pm
 
I cannot understand why, but i used hitcount instead and now it seems to work! Thank you for that! How far away is an update so I can change variable over udp with ESP8266?
Back to top
 
 
IP Logged
 
dob
Newbies
*
Offline



Posts: 4
Re: ESP8266 debug, Variable change slows everything down
Reply #4 - Jun 2nd, 2017 at 1:06pm
 
The {myvar=?} is placed under the "1 s" breakpoint, just to save bandwith. The breakpoints are put on delayMicroseconds(1); and SendDebug = 0;
The task is called every 10 ms.

     //Every 200 ms
     if (!(SendDebug % 20)) {
           delayMicroseconds(1);
           delayMicroseconds(1);
     }

     //Every second
     if (SendDebug++==99) {
           SendDebug = 0;
           
     }
I'm at home now for a short while so I can send you the files you requested.

I have no time to try the hitcount right now, but it seems that I have done the same with my solution, right?
Back to top
 

__vm.zip (25 KB | 71 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 8120
United Kingdom
Re: ESP8266 debug, Variable change slows everything down
Reply #3 - Jun 2nd, 2017 at 12:01pm
 
Ok thanks that's enough info for now. Couple of last questions/info...

1) Is the {myvar=?} in a different breakpoint of the same as a @plot command?

2) The speed control on the chart is just a "user interface refresh" thing. The data is still sent from the arduino at the same rate. The way to slow the data rate is to use the hitCounter (or condition) facility of the breakpoint.  By default hitCount is millis so a hit count of 250 would slow to 4 per second.

I will try to replicate but also interested to know if the hit count helps

Back to top
 
WWW  
IP Logged
 
dob
Newbies
*
Offline



Posts: 4
Re: ESP8266 debug, Variable change slows everything down
Reply #2 - Jun 2nd, 2017 at 11:31am
 
I'm using the @plot command. How many charts I have doesn't seem to make any difference, It's just when I have changed one variable it starts to slow down to finally become useless.
I have tried to minimize the "traffic" by sending charts every 200 ms, and the changeable parameters to 1 s (I'm tuning a PID controller), but it doesn't make any difference. As soon As I got this debug functions to work I removed all my Serial.print. I have also tried the  "vMicro->Debugger->Full Speed Debugging" (It's was a recommendation from your website). I'm not at home no, so I cannot provide you with any files now.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 8120
United Kingdom
Re: ESP8266 debug, Variable change slows everything down
Reply #1 - Jun 1st, 2017 at 11:10pm
 
Hi,

Some initial questions ...

When you say charts have you used the @plot command or are you using built in analog/digital/memory charts?

How many charts have you got?

Is your Arduino code also sending serial to the serial port?

Have you tried with or without "vMicro->Debugger->Full Speed Debugging"?

Please zip and email the files from the "\_vm" folder below your project to info@visualmicro.com?

Thanks
Back to top
« Last Edit: Jun 1st, 2017 at 11:10pm by Visual Micro »  
WWW  
IP Logged
 
dob
Newbies
*
Offline



Posts: 4
ESP8266 debug, Variable change slows everything down
May 31st, 2017 at 6:54pm
 
I'm a newbie in Visual micro and have been testing the debug function that i think is great. But when I change a variable ({MyVar=?}) the variable changes, but suddenly my charts seems to update very slow and data seems to buffer up. If I disconnect and connect again it seems to "reset" and work better again for a short while. If I don't change any variable after fresh download it work ok, and over time also.
Am I missing something or doing something wrong?
I'm on my way to buy the pro version, but I want this to work before.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print