Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Timed loss of serial port in Arduino IDE

  1. #1
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    170

    Timed loss of serial port in Arduino IDE

    I'm using Arduino 1.8.4 and Teensyduino 1.40 under Win7 64 bit enterprise.

    I have been doing some experiments with a Teensy 3.1 board and I run these for many hours. Using the serial monitor in the Arduino IDE, I send short (5 bytes) ad-hoc bespoke commands to the Teensy and receive periodic data back (approx 300 bytes) in 1 second burst displays every second. I normally leave the monitor window open.

    The serial monitor works well at the beginning of the experiment - in excess of 30 minutes etc. But if I leave the experiment running for a few hours, then I often find that the monitor port has closed itself (says "offline").

    If I then close (only) the monitor window and try re-open it, then it fails to re-open again. But if I terminate the Arduino IDE and then re-open both the IDE and the monitor window, it re-establishes connection with the serial port and I see 1 second data burst displays again correctly.

    ---

    It looks to me as though the monitor has a "receive buffer" and maybe the cause of the port closure is the buffer overflowing with accumulated data ??

    Does anyone agree with this reasoning, or have any alternative explanantion ?? If agreement, what default size is the buffer likely to be and can I increase it?

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,589
    What I’ve seen with WiFi usb sticks could apply here, too: Check the energy saving settings of the internal usb hubs in the device manager and uncheck “Windows may disable this device to save energy”

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,459
    Maybe the Java JRE is running out of memory?

  4. #4
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    170
    Quote Originally Posted by Theremingenieur View Post
    What I’ve seen with WiFi usb sticks could apply here, too: Check the energy saving settings of the internal usb hubs in the device manager and uncheck “Windows may disable this device to save energy”
    Yes - this seems to be the source of the trouble. I did as you suggested and now my experiments run (apparently) ad infinitum. Many thanks.

  5. #5
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,512
    the arduino serial monitor tends to slow down and potentially lock up or exit after a given time if theres tons of bursts and huge and/or polling data flowing constantly for long periods.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •