-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COM port is busy (access denied) or generally just doesn't work #241
Comments
Hello @mortenmoulder. Sorry it took so long to get back to you. I haven't seen this behavior before, so I'm not really sure what the best way to proceed with this is. We are in the process of releasing nRF Connect for Desktop 3.10, which will include the option of turning on verbose logging for nrf-device-lib, i.e. the underlying library handling device operations. Enabling verbose logging while the device is in this unselectable state might give us some useful information. As I write this we are doing the final testing stages on 3.10, so hopefully it will be available within a few days. |
Hi @nicolai-nordic - thanks for the update. I'll give it a go when it's released. In the meantime, you might want to try to install WSL (Debian for example) on a Windows PC. I've been consistently experiencing these issues, and it's only when I launch Debian through WSL that the device doesn't work anymore. You can install Debian through the Microsoft Store. |
I had WSL with Ubuntu installed and tried launching that, but it didn't happen. I'm not on Windows 11 yet though, so I will look into this. |
Aha, hmmm. That might be a Windows 11 issue then! |
Just checking in to say, that this issue is still happening and it's VERY annoying. Have to reboot my PC every time I want to use my PPK2. |
To me it sounds like Windows is reporting the PPK2 as available up to the software. We have never seen this on any Linux distribution, Mac OSX or Windows 10. Are you able to test this on another computer, not using Windows 11? |
@wlgrd I don't think that's the right approach, to be fair. Let's say I cannot replicate on Windows 10, then nothing happens. I'm sure there are people working at Nordic Semiconductor who has a PPK2 and who runs Windows 11. Installing WSL through Microsoft Store takes ~3 minutes. |
This is to ensure that the software and your PPK2 are working as it should and that W11 is indeed the culprit. I know how flaky the use of serial ports can be with Windows, and adding WSL into the mix makes it even worse and will not only affect the PPK2 for sure. Can you confirm that this is only happening when WSL is running at the same time? |
@wlgrd I can confirm that if I have PPK2 connected and I'm monitoring, if I open WSL it immediately disconnects and is unable to connect to PPK2 until I reboot. I'm not even doing anything with WSL. I just open the Debian terminal and that's it. I will test on a Windows 10 machine later, but thus far I have not been able to replicate it on Windows 10. Luckily I have 2x Windows 11 and 1x Windows 10 machine at home, so I should be able to confirm it's a Windows 11 issue. |
@wlgrd Can confirm that it is not happening in Windows 10, but it's happening on two Windows 11 machines with Debian installed in WSL. I have not tried a fresh install and just installed the Power Profiler and Debian in WSL, but I think it's safe to assume, that the issue is happening in Windows 11. However, all of my other serial ports work. I even tried flashing a pretty large firmware to an Arduino, then opened WSL, and it didn't stop flashing. Anyone I can reach out to from Nordic Semiconductor, who can work on this issue? Having Windows 11 and running Linux commands via WSL is not an uncommon thing as a developer. |
Happy to hear that it is working as intended under Windows 10. |
@wlgrd Our entire enterprise of 1000+ people are using Windows 11. It came out half a year ago, so I think Windows 11 support is a requirement (with WSL, which is also common for the likes of us). Thank you. |
I tried this now on Windows 11, Ubuntu WSL2, PPK v3.4.3, nRF for Desktop v3.11.0 and could not reproduce. I even flashed the ppk with some other fw and flashed it again with the bundled fw from the ppk app and it just works. Is there anything else that is done with your WSL except from installing ubuntu from the store? Trying to reproduce as much as possible. I haven't used the launcher version reported 3.7.1, but the most current one, 3.11.0, maybe there is something in between there that fixes it? Have you tried recently with a current version of nRT Connect for Desktop? |
I downgraded to nRF Connect 3.7.1 and ppk v3.1.3, and it still works fine, launching both Ubuntu and Debian mid-trace. |
@jonasem Thank you for trying! Try launching WSL via Windows Terminal (it's also in the Microsoft Store). I can replicate without, but worth a shot. Hmm. I honestly don't know how much I've changed. I know there's something called usbipd in WSL, that allows devices to pass through, but you actively have to select those devices. It's used for flashing other chips in my case. See if you can at least install that and still not replicate it. Remember to terminate the running "OS" with You are using WSL 2? |
Checked that they were stopped, then started ppk profile, then stopped ubuntu with
I haven't installed any tooling related to usbipd, have you? In such a case I could try that as well. |
I do have usbipd installed yes. It's not passing the PPK through, tho'. https://docs.microsoft.com/en-us/windows/wsl/connect-usb Make sure your Linux kernel is up to date as per the prerequisite. |
So, after updating the kernel, installing usbipd and attaching the ppk, I got an error It also lists an error:
But I gather that you havent attached the ppk itself to a running wsl distribution? For me everything still works as long as I haven't attached the ppk to wsl. |
Hmm yeah, I don't attach the PPK to WSL. Does your PPK still work even when you get that error? Or do you get that error when you try to attach it to WSL? |
I only get the error upon attaching to wsl, after detaching it works fine again. |
Right okay. Hmm that's so weird. I'm not even sure where I can begin to debug this issue. One thing is for sure: It's really annoying. |
If you update to the latest nRF for Desktop, you can enable "Verbose Logging" in the About Pane in the PPK app. Clicking the "Open Log File" button after PPK disconnects might give some more information, but other than that I can't think of other things to debug it at the moment. |
I will give that a try asap and come back with a result! |
Hi again @jonasem and sorry for the delay. Been really busy. I stumbled upon a weird issue tonight. WSL didn't immediately disconnect the PPK, and I was able to disconnect and connect, enable power and start logging data after opening WSL. However, after unplugging and plugging the PPK back in, I was no longer able to do that. Now it's just stuck at "Opening device" again. I'm using latest Power Profiler and I've enabled verbose logging. Search for EDIT: I just rebooted and tried again. This is so weird:
Something with WSL is definitely messing it up. I can open WSL and use the PPK, but as soon as I unplug the PPK and plug it back in, it won't connect anymore. But only after I've opened WSL. If I don't open WSL it works perfectly. Here is the log:
|
Do you have a dmesg trace when plugging in the PPK after WSL is started? |
This has also been reproduced by me. Something worth mentioning: |
Thanks @Decee1. This is still an issue and it's really, really annoying. None of my other serial devices experience this. I'm at the point where I barely use my device, because it happens so frequently. Having to restart my computer every time it fails to communicate is a horrible experience. |
@mortenmoulder Agree. |
Interesting, the RESET command seems to not be implemented as it complains about the command is invalid. I'm curious @mortenmoulder Do you by any chance use a USB hub between the device and your computer? |
Another update. It requires a bit of delay after closing, what i do is just monitor the list of available comports until it reapperar in the list and then a 0.1s delay between resetting and waiting for the port reappears |
@Decee1 I am not sure which RESET command you're referring to. I am just using the Power Profiler program. I do have it connected to a hub most of the time, but even connected straight to my motherboard, it doesn't work consistently. |
@mortenmoulder Oh I thought you used it though some Python script.. My bad I found one thing which is the device reset after closing the serial communication I've just spend a long time trying different things out, and my best solution until now is after closing the communication then i wait for the port to disappear and wait for it to reappear but i do still see some problems while trying to communicate but it seems a bit more stable than before |
Update time; It is pretty hard to reproduce the issue in the interface. I have tried to use the Python API to reproduce it and I haven't had any luck. I have looped my testcase over 100 times and haven't had any luck reproducing it there. Only in the testcases that I have made for my company I have managed to reproduce that after executing 2 testcasses and then execute a RESET testcase then it fails with reset but if I then And then in the actual current consumption testcase i used to be able to reproduce it but after handling the reset doing close of serial it was harder to reproduce but still possible. Next test |
I asked for a dmesg while plugging in/out the PPK2 quite some time ago. Can you provide this? |
@wlgrd I don't use Linux so in my case I cannot provide that |
The main issue was that this didn't work when WSL was started. Aren't you using that? |
Nope, running Windows 10 Version 22H2 |
I don't think WSL is the issue but rather a way to reproduce the issue. |
@wlgrd Is there some data i could provide you or try to do in order to troubleshoot the issue? |
I don't think it is the same issue, since there have been no other complaints about this issue using Windows. I have PPK2's, I have the software and I am unable to reproduce unfortunately. |
Oh well in case it isn't I will create a new issue, on top of that I will try to see if i can reproduce the issue using the https://github.com/IRNAS/ppk2-api-python and then I can attach the testcases I made with it |
If you have only used the official software, I suggest opening a ticket on Nordic's DevZone would be best. If using this repository, then you can continue a new issue here =) |
I'm running Windows 11 and I have been experiencing some weird issues with my PPK2. Once in a while it works flawlessly, as in no issues what so ever. Then suddenly after opening the Power Profiler app, it simply will not connect to the device. I can see it in the list, but it never connects.
I read multiple places that I should try to downgrade to 3.7.1. That did not solve it either.
I also read people saying, that if I open the Programmer first, put it into bootloader mode, and then open Power Profiler, I should accept the firmware install. That has surprisingly worked a few times.
If I open Programmer, put it into bootloader mode, open Power Profiler and proceed with the firmware install, I get an "Error while setting up device XXXXXX: Opening COM4: Access denied". I tried as administrator, but to no avail.
If I use Microsoft's Process Explorer, and I search for
usbser
using this guide, I get 0 results back, which probably means the COM port isn't being used by another application.If I unplug it, plug it back in, it's now COM3 because it's out of the bootloader again. If I open Power Profiler and select the device, I just get this in the log and nothing else:
Completely dead. If I reboot my PC, it's most likely going to work again, but that's a huge pain in the rear to do every time.
Is this a Windows problem?
EDIT: Just rebooted and now it works again. So weird.
EDIT 2: Hmmmmmmmmmm after running Power Profiler for a few minutes, I wanted to open Debian running in WSL (which wasn't running at the time). Right after opening it, Power Profiler disconnected from the PPK2 and now I'm back to the original errors. Seems like WSL is messing something up. At least now I know how to replicate it!
The text was updated successfully, but these errors were encountered: