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

Thread: Serial Communication Error on Teensy 3.0 -- Com Port Closes After Read/Write Failure

Threaded View

  1. #1
    Junior Member
    Join Date
    Apr 2014

    Serial Communication Error on Teensy 3.0 -- Com Port Closes After Read/Write Failure

    I am trying to talk to my Teensy using serial commands, but after several successful queries and responses, I see a Write Error, and then the Port can't be opened until I physically disconnect and reconnect the USB cable.

    This behavior occurs on Windows 7 both through the Arduino serial monitor and through a putty session with the Teensy's port, as captured in the pictures below. Occasionally I can repon the serial monitor or putty session after the error without getting a com port error, but it disappears often enough that it's a problem.

    Click image for larger version. 

Name:	arduino error.jpg 
Views:	382 
Size:	91.2 KB 
ID:	1837Click image for larger version. 

Name:	arduino error 2.jpg 
Views:	368 
Size:	70.6 KB 
ID:	1838Click image for larger version. 

Name:	putty error.jpg 
Views:	292 
Size:	50.8 KB 
ID:	1839Click image for larger version. 

Name:	putty error 2.jpg 
Views:	414 
Size:	18.6 KB 
ID:	1840

    It also happens on ubuntu 12.04 when I use the screen command (screen /dev/ttyACM0 9600) in a terminal session; I query the Teensy and get a response several times, but eventually the screen session terminates right after I send a query (displays [screen is terminating]). I don't get a "com port error" on this OS -- I can use the screen command again without reconnecting the cord.

    I've pared my code down to an edited version of the mac address program in this post: . My version, which I will attach to this post, edits the main loop to wait for a query from the user (a "?") before printing out the mac address. Eventually I will be interfacing with the Teensy through pyserial, and will be using this query/response technique for a variety of functions. I've narrowed down this problematic behavior to this simple code though, so I'd like to debug this first.

    Other information:
    This behavior occurs on multiple Teensy boards.
    If I have my device manager on Windows open when the write error occurs, I can see it (the device manager) refresh, which indicates that the com port has closed/disappeared. However, the Teensy is still visible on the same com port in the device manager list -- but I still can't talk to it without reconnecting the cable.

    This is my first project using Teensy, and I'd appreciate any help or advice. Is it a timing issue, or does it have to do with the transmit buffering on the Teensy's side? Thanks in advance!
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

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