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) [Solved] USB discovery disables and vm hangs trying to show ports list (Read 12362 times)
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
[Solved] USB discovery disables and vm hangs trying to show ports list
Dec 2nd, 2014 at 2:41am
Print Post  
He was using Visual Studio not Atmel Studio Tongue.

And I have the same problem sometimes, I couldn't find anything in Windows's Task Manager (tried to close WmiPrvSE but no luck)

Only a computer restart seems to fix it, very annoying bug Sad
« Last Edit: Dec 20th, 2014 at 8:55pm by Gillian »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #1 - Dec 2nd, 2014 at 9:56am
Print Post  
No he was using atmel studio, one because I know the user and two because only in atmel studio is the .hex copied to the output folder so that native atmel tools can use it.

I think the whole window wmi database is a flaky system. It works 99% of the time but not 100%

It can be disabled in the visual micro options (port and network discovery), you loose serial port descriptions so will just see COM1,COM2 etc in the ports list.
« Last Edit: Dec 14th, 2014 at 4:32pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #2 - Dec 14th, 2014 at 4:07pm
Print Post  
There is something really wrong with how you handle serial ports in VM.

Even with network discovery option disabled, I am most of the time unable to open a project in VM and have to restart PC.

In fact, even without trying to open a project.

For example, I use Termite (serial terminal) to connect to my HC-05 Bluetooth module, it works OK.

Now I disconnect Termite and close it, and I start VS: it starts normally, I can browse in menus etc, but, as soon as I touch the com port selection box, it will load forever and a notification tell me "Visual Studio is busy". I have to close it in Task Manager.

After this, I try to use Termite again (or any other serial terminals), and it cannot connect to my HC-05 anymore. The only solution, is to restart my PC Shocked

VM is mostly unuseable because of this problem.
« Last Edit: Dec 14th, 2014 at 4:32pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #3 - Dec 14th, 2014 at 4:36pm
Print Post  
I have moved your discussion to a new thread because the other thread had a solution and was a different issue (although similar initially)

The possibly indicates a wmi database or networking issue. Let's first try to configure so vm is the same as Termite

In tools>options>visual micro>communications

Friendly Port Names = False
Friendly Port Menus = False
Network Discovery = False

Then restart the ide and please let me know if there is a difference.

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


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #4 - Dec 14th, 2014 at 7:23pm
Print Post  
So I changed Friendly Port Lists and Friendly Port Menus to false (network discovery already false)

Now it doesn't hang anymore when opening sketch or touching the port box, but when I try to compile/upload, VM will hang forever just after starting avrdude. The last line I see in the console is the avrdude command line.

Then, again, after VM and avrdude are closed from the Task Manager, I can't connect to Bluetooth module anymore from PC (I can still connect to it with my smartphone, so it's not a problem of the BT module), until I restart PC.

Thank you

EDIT:

Believe it or not, but after restarting my PC once again after making these changes, I am now able to upload with Bluetooth!

I will do some more tests tomorrow!
« Last Edit: Dec 14th, 2014 at 7:32pm by Gillian »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #5 - Dec 14th, 2014 at 7:31pm
Print Post  
That sounds like a pain.

Well it is cleaner with all the options off.

Did you remove the flush serial command from the boards.txt?

What if you compile then use the .bat file to upload? Let's stick to one post I think it's all related?
  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #6 - Dec 14th, 2014 at 7:33pm
Print Post  
Yes please merge both my topics, also look I updated my previous post! Now it's working!

Edit: no I didn't remove the flush thing. I tried to remove it just now, and it didn't work, same error as in my other topic. Maybe you could add a setting in VM so we (or I...) don't need to edit boards.txt ?
« Last Edit: Dec 14th, 2014 at 7:36pm by Gillian »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #7 - Dec 14th, 2014 at 7:36pm
Print Post  
I can't merge them so have kept the boards.txt discussion as is and asked you to try something.

What is working? The .bat file?
« Last Edit: Dec 14th, 2014 at 7:36pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #8 - Dec 14th, 2014 at 8:00pm
Print Post  
Tim@Visual Micro wrote on Dec 14th, 2014 at 7:36pm:
What is working? The .bat file?


No, that I can now use VM to upload with Bluetooth module Wink

It appear that both changes were needed:
This one:
Quote:

Friendly Port Lists = False
Friendly Port Menus = False
Network Discovery = False

And the boards.txt's one:
Quote:

mega.menu.cpu.atmega2560.upload.disable_flushing=true


After making these changes, I restarted my PC, and magically, not only VM doesn't hang anymore, but now I can upload my sketch with BT! One stone two birds Wink

VM just hang until avrdude finished uploading (which took 30+ seconds for my big sketch ), once avrdude finished, its whole log appear all at once in VM's output window. Maybe you should make it threaded or something so that it doesn't hang VM?

For people reading and not understanding what we are talking about, here is my second topic
« Last Edit: Dec 14th, 2014 at 8:03pm by Gillian »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #9 - Dec 14th, 2014 at 8:07pm
Print Post  
That's great to hear and thanks for such clear reports and summary.

If you have time for one last test it would help.

It's important to try to avoid changing the boards.txt to fix this because it makes it difficult for you to upgrade the arduino ide in the future.

The arduino ide does flush the port so it is wrong that we switch it off (not major but might cause std. serial upload issues for you in the future)

Please remove the disable_flushing=false and add the following:-

Code
Select All
vm.upload.sleep.after.close.flush=1000 



This test is to try to determine how long vm should wait before calling avrdude (1000 ms). 

If you don't have time I am ordering stuff to try to replicate. I expect the bluetooth usb drivers will affect things along with other stuff so it would be helpful for someone with the issue to prove the "delay" working or not.

After altering the boards.txt you can click "tools>visual micro>reload toolchains" instead of re-starting the ide

Thanks very much once again
  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #10 - Dec 14th, 2014 at 8:24pm
Print Post  
OK,

First, unrelated to this topic but: when I do Reload toolchains, I got many errors in my sketch when compiling, such as:
Quote:

multiserial.ino:45:24: error: 'Serial2' was not declared in this scope
:checkSerialCommands( &Serial2 );
:^
multiserial.ino:46:24: error: 'Serial3' was not declared in this scope
:checkSerialCommands( &Serial3 );

Well I won't post my code because it's too big, but I think this indicates that there is a bug with Reload toolchain Wink.


I made the requested change to boards.txt (and restarted VM instead of reloading toochain), I didn't notice any differences, I mean, it doesn't seem to wait anything (I also tried to change value to 10000, still no wait) and it still output the same errors as in first post of my other topic. Are you sure I have to put this line in boards.txt?
« Last Edit: Dec 14th, 2014 at 8:28pm by Gillian »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #11 - Dec 14th, 2014 at 8:27pm
Print Post  
Yes but sorry you have to precede it with the board name


mega.menu.cpu.atmega2560.vm.upload.sleep.after.close.flush=1000
  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #12 - Dec 14th, 2014 at 8:38pm
Print Post  
I see,

With this line, now all it does is hang VM after line "Flushing the serial port", about 90 seconds, then this error appear in output window:
Quote:

A device attached to the system is not working properly.

(translated from french)

I tried to change value to 100, 10000, same result
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #13 - Dec 14th, 2014 at 8:40pm
Print Post  
Okay thanks for all your great effort. I will try to replicate or add easier config settings.

I'll clean up this thread in a while so the current answer is clear for other people.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #14 - Dec 14th, 2014 at 8:42pm
Print Post  
Do you have a debugger trial active? If you try the debugger and find it useful let me know and I will send you some free licences.
  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list
Reply #15 - Dec 14th, 2014 at 8:42pm
Print Post  
Thanks to you for helping with my problems, I will stick with disable_flushing until a better fix Wink

Yes I enabled the debugger trial and it's really useful Wink
« Last Edit: Dec 14th, 2014 at 8:43pm by Gillian »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: USB discovery disables and vm hangs trying to show ports list
Reply #16 - Dec 14th, 2014 at 8:57pm
Print Post  
Ok pm'd you a 3 machine license
  
Back to top
IP Logged
 
Gillian
Junior Member
**
Offline


Posts: 31
Joined: Nov 28th, 2014
Re: USB discovery disables and vm hangs trying to show ports list (WMI database not working)
Reply #17 - Dec 14th, 2014 at 9:17pm
Print Post  
Awesome really, thanks!
« Last Edit: Dec 14th, 2014 at 9:31pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint