Skip to content
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

Disconnect USB cable cause loop in log writting #20

Closed
maxcharlier opened this issue Aug 10, 2017 · 3 comments
Closed

Disconnect USB cable cause loop in log writting #20

maxcharlier opened this issue Aug 10, 2017 · 3 comments

Comments

@maxcharlier
Copy link

maxcharlier commented Aug 10, 2017

Hi,
I use adrilight on windows 10 for 1 month now. I have note that my hard drive was completely full recently and I found that was cause by adrilight.
If I run adrilight without the USB connected to the Arduino the app start to make a loop with a message writed in the logs files.
Here is the message :

2017-08-10 19:46:27.7252 DEBUG adrilight.SerialStream Exception catched. System.IO.IOException: Le port 'COM3' n'existe pas.
a System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
a System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
a System.IO.Ports.SerialPort.Open()
a adrilight.SerialStream.mBackgroundWorker_DoWork(Object tokenObject)

I have about 300 go of files in the log folder... can you add an option to remove the log activity ?

@fabsenet
Copy link
Owner

fabsenet commented Aug 11, 2017 via email

@fabsenet
Copy link
Owner

fabsenet commented Sep 5, 2017

I am curious, did you unplug your USB connection to your arduino and left it like that?

There is no way, the log file fills up AND adrilight working correctly.

The log creates one log file per day and keeps the last 7 days. This is configured in the nlog.config file.

You may simply replace (line 24 in your nlog.config):

from

    <logger name="*" minlevel="Debug" writeTo="file" />

to

    <logger name="*" minlevel="Fatal" writeTo="file" />

This will change the logging to not log really much anymore.

@morgeek
Copy link

morgeek commented Sep 6, 2017

I had exactly the same problem.
My toddler keeps on unplugging the arduino from the PC. And after a month my PC was saturated with log files (50Gb)
I erased it and everything was ok but it took me a while to figure out that Adrilight was causing this.
I'm glad someone will address this problem.
Keep up the good work !

fabsenet added a commit that referenced this issue Oct 17, 2017
Also implemented a short timeout to reduce load if the serial connection fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants