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

Thread: Help Please: Error while setting serial port parameters: 115,200 N 8 1

  1. #1
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50

    Help Please: Error while setting serial port parameters: 115,200 N 8 1

    Hello

    I have ran into a problem (outlined below) and I have tried many things to overcome it but to no avail. Any help on this matter would be much appreciated.

    I have been using my Teensy for a few months now and have not had any problems. However I was using it the other day and doing some coding when I saw a spark, very briefly, because the positive and negative wires of the APA102 touched. Safety aside, not long after this(a few hours) the uploading of sketches to the Teensy started messing up. I upload a sketch and usually there are 2 beeping noises to confirm the upload. I also use the serial monitor. However since the spark incident whenever I upload there is only 1 beep, IE the IDE saying it has completed uploading but it does not seem to get to the Teensy beep because the comment saying Teensy is not connected to the USB port comes up. Furthermore when I open the serial monitor there are potentially a few things happening. Sometimes the USB port is not recognised and therefore it says "no serial port name defined" at other times it says "Error while setting serial port parameters: 9,600 N 8 1", with 9,600 being the baud rate i have set.

    I have done some Google research and the general consensus from what I can understand is to uninstall and restart the IDE and the Teensyduino software. I did this a few times including a full shut down of my computer and nothing has changed. I have ran it with admin mode too but no difference. The only time something did change was when I removed the firewall from my computer and there would then be 2 beeps to indicate the data had gone to the Teensy, but when I tried to open the monitor it still came up with the same error message (Error while setting serial port parameters: 9.600 N 8 1). I think something is wrong linked to the ports but I am no expert with computers so I am keen to hear what anyone has to say. I something stopping it, or altering it in someway. Im lost

    I have also changed my USB cable from computer to Teensy in case that was ruined by the spark. I have also tried every port on the computer in addition to testing out the ports with other things, and they all seem fine. Also used a new Teensy as I had a spare one lying around.

    Help is very much appreciated here!



    Complete Source Code (or a link to the code) - It does not matter if there is any code or not(I tried an empty sketch and it still did not work), the problem seems to be with connections

    Screenshot or the exact text of any error messages -
    1) Error while setting serial port parameters: 115,200 N 8 1

    2)Teensy did not respond to a USB-based request to automatically reboot.
    Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

    3)no serial port name defined

    Which PJRC product you're using - Teensy 3.2

    Part numbers of any other chips or modules + links to their info - APA102c addressable LED strip, but this is not where the error lays

    Wiring details - how exactly have you connected the hardware (a photo's worth 1000 words) - Wiring positive 5V to Vin and Ground to GND, data and clock to pins 11 and 13, and also data/clock to 7 and 14 too.

    Software setup, Arduino vs C+makefile, running on Windows, Mac or Linux?Versions? - Windows 10 and Arduino IDE

    Any other information needed to reproduce the problem..... I thnk I have explained it all above. Sometimes the rror message has 9,600 at other times 115,200 simply because i have tried changing the baud rate in the monitor window but that did not change anything

    EDIT: added last few lines
    Last edited by Tejkaran; 06-09-2016 at 03:17 PM. Reason: added few liines

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,092
    First, you should understand uploading to Teensy uses HID protocol, not serial. Serial is only used when you open the Arduino Serial Monitor.

    Uploading is done by the Teensy Loader program. HID protocol is always used, so all this stuff about serial does not apply. Teensy Loader has a Verbose Info option in the Help menu. It'll open a window that gives more info.

    When Teensy is detected and programmed, you should see activity in the Teensy Loader window. Just press the button on Teensy and you should see a response in the Teensy Loader window (assuming the hardware still works).

    You can also open the Windows Device Manager. Remember to look for new devices appearing under HID (human interface), not Ports. Teensy only appears as a serial port *after* you load a program.

  3. #3
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50
    Thanks for the reply, but i am not sure what I am to take from it?

    I clicked the Verbose button and it shows a load of info when I upload, am I looking for something from here?
    End of the day, my LED strip does not do anything now....
    Code:
    17:02:36: Device came online, code_size = 262144
    17:02:36: Board is: Teensy 3.2 (MK20DX256), version 1.03
    17:02:36: File "Rainbow.ino.hex". 16120 bytes, 6% used
    17:02:36: set background IMG_ONLINE
    17:02:36: File "Rainbow.ino.hex". 16120 bytes, 6% used
    17:02:36: elf size appears to be 262144
    17:02:36: elf binary data matches hex file
    17:02:36: Code size from .elf file = 262144
    17:02:36: begin operation
    17:02:36: flash, block=0, bs=1024, auto=1
    17:02:36: flash, block=1, bs=1024, auto=1
    17:02:36: flash, block=2, bs=1024, auto=1
    17:02:36: flash, block=3, bs=1024, auto=1
    17:02:36: HID/win32: waiting for device
    17:02:36: HID/win32: waiting for device
    17:02:36: HID/win32: waiting for device
    17:02:36: HID/win32: waiting for device
    17:02:36: flash, block=4, bs=1024, auto=1
    17:02:36: flash, block=5, bs=1024, auto=1
    17:02:36: HID/win32: waiting for device
    17:02:36: flash, block=6, bs=1024, auto=1
    17:02:36: flash, block=7, bs=1024, auto=1
    17:02:36: flash, block=8, bs=1024, auto=1
    17:02:36: HID/win32: waiting for device
    17:02:36: flash, block=9, bs=1024, auto=1
    17:02:36: flash, block=10, bs=1024, auto=1
    17:02:36: HID/win32: waiting for device
    17:02:36: flash, block=11, bs=1024, auto=1
    17:02:36: flash, block=12, bs=1024, auto=1
    17:02:36: flash, block=13, bs=1024, auto=1
    17:02:36: HID/win32: waiting for device
    17:02:36: flash, block=14, bs=1024, auto=1
    17:02:36: flash, block=15, bs=1024, auto=1
    17:02:36: HID/win32: waiting for device
    17:02:36: sending reboot
    17:02:36: begin wait_until_offline
    17:02:36: offline, waited 3
    17:02:36: end operation
    17:02:36: set background IMG_REBOOT_OK
    17:02:36: redraw timer set, image 14 to show for 1200 ms
    17:02:37: redraw, image 9
    I press the button on the Teensy to bring up the above code on the verbose
    In the device manager there is a listing for "USB Input Device" which I assume to be the one connected to the Teensy


    What I dont understand is after months of working in the IDE, and using is perfectly, with the Teensy is no longer loading any program that I try to upload.
    Secondly why I can no longer use the monitor when I used to use that fine too?

    I am very lost here...

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,092
    That info shows the code is uploading to your Teensy.

    First, go back to a simple program. Open File > Examples > 01.Basics > Blink. Upload that to your Teensy. Does the LED blink? Change the delays and upload again. Is your Teensy still working well enough for the LED blink to change?

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,119
    Note: The sounds from WINDOWS acknowledging a DEVICE on the USB port Leaving and then Arriving, they correspond to the programming operation but are not part of the loader.

    There should be unique sounds for Device Gone and another for Device Connected.

    Perhaps try uploading a simple blink with USB Serial output to confirm your Teensy is still working without any added hardware. This sketch should work and upload well - there are other steps there that may help too: Can-t-communicate-with-Teensy-3-2-through-Teensyduino

    As Paul notes "Serial" as used in that sketch is for the USB port, and takes only a single parameter, and the value doesn't matter as the USB runs at available system speed.

  6. #6
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50
    I just did blink and that worked fine, altered speed from 1000ms down to 100ms then down to 20ms, they work fine.
    I then tried to do the rainbow one, and something odd happened, but I do not know what or how and it ended up with the Teensy overheating to the extent that it was very hot to touch. I disconnected all wires. Unplugged it and then waited for it to cool down.
    I then re did blink and it worked fine.
    I did the qBlink one that defragster just linked and that worked fine, and even the Serial monitor worked fine
    I then did Rainbow from the APA102 library and it uploaded fine, but as soon as I pressed serial monitor it said "Error opening serial port 'COM3'. (Port busy)"
    I also tried a sketch of my own with the same results as the Rainbow...

    any thoughts here? Why would the monitor work for defragster's linked one but not for Rainbow?

    Thanks for the help so far guys
    Last edited by Tejkaran; 06-09-2016 at 04:53 PM. Reason: missed a 0 on the 1000

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,119
    I'd assume failed hardware or not properly connected - or something wrong in the code.

    The "Error opening serial port 'COM3'. (Port busy)" sounds like a selection or system issue with the IDE SerMon. Look for TYQT on the Forum and install that, it is more robust and reliable.

    <edit>: I updated the post I linked above with a forum link to TYQT.
    Last edited by defragster; 06-09-2016 at 06:16 PM.

  8. #8
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50
    defragster

    I installed the TYQT and honestly have no idea what it is. What is it meant to do? What is it an alternative for?
    Also what is an IDE SerMon?

    i would rather rectify whatever has gone wrong than to diverge into uncharted territory if possible...

  9. #9
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,349
    Quote Originally Posted by Tejkaran View Post
    I then tried to do the rainbow one, and something odd happened, but I do not know what or how and it ended up with the Teensy overheating to the extent that it was very hot to touch. I disconnected all wires. Unplugged it and then waited for it to cool down.
    Seems that something was wrong with your wiring. Is it possible to post a photo ?

  10. #10
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,119
    Per my post #7 and FrankB's #9 - there appears to be a hardware issue. The Teensy should not become that hot. With nothing attached. Post #6 indicated the linked blink sketch worked, so the Teensy may have survived whatever sparks or other connections were made. Maybe not so for the other attached hardware - or how it is attached - thus post #9 suggesting a photo may help.

    I quoted the error you noted: "Error opening serial port 'COM3'. (Port busy)"

    Perhaps details were missing from that post - but I assumed that was from the ARDUINO IDE trying to connect the Serial Monitor to the USB connected Teensy for Serial.print() output?

    TYQT is a another way to do that and if it sees a Teensy plugged into your computer it will show it in the device list. It defaults to an INFORMATION tab showing the device serial number and the OS Port information where it is attached. From there you click on the MONITOR tab and it will display any output from the device the same as the IDE SerialMonitor does.

    This isn't uncharted territory - it is a good step number two after powering your Teensy and seeing it BLINK - before any soldering or hardware attachment - once you upload a Serial.print() aware sketch (which the factory sketch is not) - like in post #5 - that is the next way to know the Teensy Is functional and allow Debug/diagnostic or other textual feedback from within the running sketch to report status, progress or problems.
    Last edited by defragster; 06-09-2016 at 10:39 PM.

  12. #12
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50
    I think something was wrong with the wiring hence the overheat, but I did say that I removed all wires after it happened, so after that I may well have put it right. Please see the image for the wiring in #10
    And yes, it is as you say the ARDUINO IDE trying to connect the Serial Monitor to the USB connected Teensy for Serial.print() output

    TYQT comes up and says "SetCommState()failed: a device attached to the system is not functioning"
    When i run my sketch nothing comes up in the TYQT monitor when i run my sketch, however with more simple sketches such as:

    Code:
    #include "FastLED.h"
    #define NumPixels 150        // number of LEDs in strip - count starts at 0, not 1
    #define Datapin 11           // datapin - green on apa102
    #define Clockpin 13          // clockpin - blue on apa102
    #define DataRate_Mhz 12
    CRGB leds[NumPixels];
    int r = 255, g = 255, b = 255;
    
    void setup()
    {
     FastLED.addLeds<APA102,Datapin,Clockpin,BGR,DATA_RATE_MHZ(DataRate_Mhz)>(leds,NumPixels);  //data rate is worth playing around with, if left untouched it goes mental
     
     fill_solid(leds, NumPixels, CRGB(0,0,0));  // fill all to empty
     FastLED.show();                            // clear all lights from previous entry
     delay(1000);                               // delay to initialise anything
    }
    
    void loop() 
    {  
     fill_solid(leds, NumPixels, CRGB(r,g,b));  // fill all to empty 
     FastLED.show();
     Serial.println(micros());
     delay(1000);
     
    }
    then both the Arduino IDE and the TYQT monitor bring up the time, hence it brings me to believe and ask the question, are the commands which may be causing the IDE and TYQT from corrupting the monitors? This could be really basic hence me overlooking it?

  13. #13
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,119
    When TYQT and IDE SerMon can't see the device or connect the Teensy is not functioning as a USB device - bad software, or hardware issue. It can be the computer being confused as well if Windows has decided to take a break after seeing something ODD on the USB port - caused by issues noted.

    Somehow your image did not attach for viewing in the post?

    Double check your wiring against the Teensy card according to the desired device/pin functions as you wire to the Teensy. If the hardware took a hit - it may be shorting out the Teensy when properly connected.

    <edit>: Check your setup against the linked sample - Serial.begin(9600); - is missing and the while() loop to make sure it is online before proceeding.
    Last edited by defragster; 06-09-2016 at 10:46 PM.

  14. #14
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50
    Ok

    well im going away for the weekend starting early tomorrow morning, so i can give my Teensy and Windows a break, however what I stil ldo not understand is how can it work for one sketch and not another. Im convincing myself that maybe i have written something in my code which could be causing the problem, is this possible?
    In addition I am getting a new Teensy early next week so I will try with that too.
    Something isnt quite right, so lets elminate the Teensy from the equation too I guess.

    Ill get back to you on Monday/ Tuesday with results from the new Teensy

  15. #15
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,119
    Yes, coding a "simple" memory error (or other) can take the Teensy offline and the USB will fail to be recognized/supported.

    Starting with the simple linked sketch will prove Teensy function with no attached hardware. Good luck.

  16. #16
    Member
    Join Date
    Jun 2016
    Location
    UK
    Posts
    50
    My guess is there is some sort of coding error i put in, or that as I have left it alone for a period of time it has sorted itself out. I say this because I only touched it today, after not using it for the weekend, in addition to starting the code from scratch and it is all fine now.

    Thanks for the help guys

Posting Permissions

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