Serial port 'COM5' already in use.

Basic / Standard Reef Angel hardware
Post Reply
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Serial port 'COM5' already in use.

Post by StuGotz »

This has been happening to me since the first time I tried to upload my 1st PDE. All I have to do is unplug the USB cable to the Reef Angel and plug it back in and it works again. I just have to do that EVERY time I need to upload. It wasn't a big deal until today, when I must have uploaded 50+ different PDEs working on my Custom Main. I have no idea what could be grabbing that port. Printer driver? I don't really have anything else installed. The only other things I plug into my USB ports is my Android phone and my iPhone for work. So other than iTunes, I have no idea what could be polling the port.

Code: Select all

Binary sketch size: 30944 bytes (of a 32256 byte maximum)
processing.app.SerialException: Serial port 'COM5' already in use.  Try quiting any programs that may be using it.
	at processing.app.Serial.<init>(Serial.java:144)
	at processing.app.Serial.<init>(Serial.java:76)
	at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:75)
	at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:93)
	at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:56)
	at processing.app.Sketch.upload(Sketch.java:1603)
	at processing.app.Sketch.exportApplet(Sketch.java:1568)
	at processing.app.Sketch.exportApplet(Sketch.java:1524)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
	at java.lang.Thread.run(Thread.java:619)
processing.app.debug.RunnerException: Serial port 'COM5' already in use.  Try quiting any programs that may be using it.
	at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:99)
	at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:93)
	at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:56)
	at processing.app.Sketch.upload(Sketch.java:1603)
	at processing.app.Sketch.exportApplet(Sketch.java:1568)
	at processing.app.Sketch.exportApplet(Sketch.java:1524)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
	at java.lang.Thread.run(Thread.java:619)
Any Suggestions?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Serial port 'COM5' already in use.

Post by rimai »

Could it be the Client?
Roberto.
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Re: Serial port 'COM5' already in use.

Post by StuGotz »

I have it running, but after I upload a PDE the client never reconnects to the controller again. I would have to exit the client and relaunch it again before it can update again.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Serial port 'COM5' already in use.

Post by rimai »

That's what I mean.
The Client opens up the same port to communicate with the controller and that's why you probably have the COM5 being used error.
If you launch the service dashboard, you will see the listerner service running. You have to stop the service or it will keep picking up the COM port everytime.
Roberto.
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Re: Serial port 'COM5' already in use.

Post by StuGotz »

Then why do I need to restart the client anytime I upload a PDE if it's connecting to the port. Shouldn't it start refreshing after I upload a PDE and it connects to the port again?
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Re: Serial port 'COM5' already in use.

Post by StuGotz »

Same problem :( I exited the client, unplugged the USB cable , plugged it back in, uploaded a PDE, made a couple changes to it, then tried to upload it again and got the same error.

Does the listener service stop if the client is not running?
StuGotz
Posts: 95
Joined: Sat Oct 15, 2011 9:17 am

Re: Serial port 'COM5' already in use.

Post by StuGotz »

I just found the ReefAngelListener service in my services MMC... I guess that answers that.
dmolton
Posts: 182
Joined: Tue Mar 22, 2011 11:08 am

Re: Serial port 'COM5' already in use.

Post by dmolton »

The client itself doesn't lock the port, rather it's the ReefAngel Listener service that you mentioned, StuGotz that locks the port. There's a built in timer to the service that when it ticks, the service will attempt to open the COM port and communicate indefinitely. So long as that service is running, it is constantly trying to get a lock on the COM port and keep it. In cases where you want to release the lock so that other applications, like the Arduino IDE, can communicate I included the "Service Dashboard" with the installation. You can get to it from the Client or from the start menu and it lets you toggle the Listener and Logger services on/off with just one button push. Remember to turn the services on again once your done uploading and want to use the Client.
Post Reply