VS Arduino
>> >> ESP8266 debug, Variable change slows everything down
https://www.visualmicro.com/forums/YaBB.pl?num=1496253246

Message started by dob on May 31st, 2017 at 5:54pm

Title: ESP8266 debug, Variable change slows everything down
Post by dob on May 31st, 2017 at 5: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.

Title: Re: ESP8266 debug, Variable change slows everything down
Post by Visual Micro on Jun 1st, 2017 at 10: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

Title: Re: ESP8266 debug, Variable change slows everything down
Post by dob on Jun 2nd, 2017 at 10: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.

Title: Re: ESP8266 debug, Variable change slows everything down
Post by Visual Micro on Jun 2nd, 2017 at 11:01am
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


Title: Re: ESP8266 debug, Variable change slows everything down
Post by dob on Jun 2nd, 2017 at 12: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?
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=__vm.zip ( 25 KB | 3 Downloads )

Title: Re: ESP8266 debug, Variable change slows everything down
Post by dob on Jun 2nd, 2017 at 12: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?

Title: Re: ESP8266 debug, Variable change slows everything down
Post by Visual Micro on Jun 2nd, 2017 at 1: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.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.