Serial Monitor issue

Status
Not open for further replies.

Srendi

Member
Hey,
I already found some forum threads with issues with the serial monitor. But after some hours, I was not able to fix this problem.

So my problem is, I don't receive any data in the serial monitor. I tried it with many ways, but nothing helps.

I tried it with the serial monitor example from teensy(http://www.pjrc.com/teensy/tutorial3.html), does not work.
I also tried to change the USB Type to `Raw HID`(Should work according to a forum post.), but this does not work either.

Simple code I tried to use:

Code:
void setup()   {                
  Serial.begin(38400);
}

void loop()                     
{
  Serial.println("Hello World");
  delay(1000);
}

Serial monitor:
Bild_2021-06-03_193905.png

Hardware:
Teensy 4.0
A USB Cable connected with 3.0. I don't have 2.0

Software:
OS: Windows 10
Arduino 1.8.15
Libraries: Arduino pre-installed libraries, nothing more.

I'm new to teensy and this forum, sorry if I miss anything!
English is not my mother language, sorry if anything is hard to understand
 
Hi Srendi,

You may want to select your COM port from the upper "Teensy Ports", like this:

Untitled.png

From your serial monitor snapshot it looks like you selected your COM port from the lower "Serial ports".
The latter is usable but I just found out that you need to close and reopen the serial monitor again after uploading your new code. Otherwise the serial monitor stays offline.

Hope this helps,
Paul
 
Indeed the upper Teenys Ports is the better interface PJRC designed to deal with T_4.x's higher speed.

Version not noted? ... Unless you have TeensyDuino 1.54 Beta 9 that doesn't return from .begin right away - the Teensy starts running before the computer bothers to see the Teensy and that can give bad results.

In any case putting this line after the .begin may help as well to assure USB connects before printing: while( !Serial );

For a timed wait can also be while( !Serial && millis() <4000 );
 
You may want to select your COM port from the upper "Teensy Ports", like this:

I don't have these teensy ports, see: Bild_2021-06-04_165947.png
I wonder why

Version not noted?

I used 1.8.15 with TeensyDuino 1.54 Beta 9. But now I use arduino 1.8.13 with TeensyDuino 1.53 because I thought, the beta version could be buggy.

In any case putting this line after the .begin may help as well to assure USB connects before printing: while( !Serial );

For a timed wait can also be while( !Serial && millis() <4000 );

Thank you for the tips!
And thank you guys for the help. I hope anyone can tell me, why the ports are not showing up.
 
The 'beta' of TD 1.54 is very stable - it is just a long term WIP, and if there are issues they need to be pointed out to get fixed.

Paul might say what might result in 'Teensy Ports' not showing when the selected device is a Teensy 4.0. Perhaps check TaskMan for 'orphaned' teensy_ports.exe in the Background processes if not under the 'Java(TM) Platform...'

This view seen here with 3 Teensy's online - the COM13 is a 'Dual Serial' port on the T_4.0 that is feeding the 'IDE Plotter' and it only shows under IDE's Serial ports:
td154b9_ports.png
 
Another USB port kinda works. And I manually started teensy_ports.exe.
But it disconnects after ~30 seconds, the port is away.

Here is a picture of the ports and the error in the console: Bild_2021-06-04_204311.png

I also tried it with the code snippets from defragster
 
Could you powerdown and powerup your PC for a test? [not a Windows Restart but a complete power down].
When my desktop PC was still running Windows 7, every once in a while I had to do this powercycle because Windows and/or the TI USB controller/driver got confused and the COM ports were not recognized properly.
The only way to get right again was by doing this powercycle. I even pulled the AC plug for a minute or so to make sure the power supply was completely discharged.

By the way, was does your sketch window state in the bottom-right corner?

Untitled.png

Using Windows 10, Arduino 1.8.13 & TeensyDuino 1.53.

Paul
 
Has the Teensy 4.0 been programmed yet from new? What shows if the Button is pressed?

It is Odd that Teensy_ports starts and then exits.

Win 10 System here is the new IDE 1.8.15 with the latest TD 1.54 Beta 9 and I've not seen anything like that. Perhaps remove all the Arduino installs and start fresh? I use the ZIP file and just unzip Arduino IDE to a folder and then run TeensyInstaller on that folder and then run the Arduino.exe IDE from that folderand io works without such issues.
 
I hope anyone can tell me, why the ports are not showing up.

In the small Teensy Loader window, click Help > Verbose Info. The verbose info window gives a *lot* of information (sometimes too much...) about what's really happening. In that window, the Log menu lets you save all the info to a text file. Here on the forum, if using Quick Reply click the Go Advanced button to get to the full message editor which allows you to attach a file. Then you can upload that verbose info file.

But for a blind guess, I can tell you the most common problem we see over and over on this forum is bad USB cables. The charge-only cables sold with so many products using a USB connector for power are the most common issue. A less common problem is low quality cables which work with 12 Mbit speed (used on almost all Arduino boards) but not 480 Mbit speed used on Teensy 4.0.

Teensy 4.0 has a feature to completely wipe the flash memory and write a known-good RawHID LED blink program. Press the button for 15 seconds. You'll see the red LED flash briefly when you're at the moment to release the button. It will only do the erase if you release at that moment. You'll know it's erasing because the red LED turns on bright for about a minute while it slowly wipes the flash chip. When it's done, you'll see the orange LED blinking again. If you get to that point, you can be sure your Teensy 4.0 is programed to talk RawHID. Then clicking the Tools > Ports menu should show it as a HID device in the upper Teensy Ports part, and nothing in the Serial Ports (because HID isn't serial). If you get all the way to this point, where the orange LED is blinking after the wipe+restore and you still see nothing in Tools > Ports, that's a sure sign you have a charge-only or otherwise defective cable. RawHID should always be detected and shown in the menu because all versions of Windows have HID drivers always installed (otherwise your USB keyboard & mouse wouldn't work).
 
that's a sure sign you have a charge-only or otherwise defective cable. RawHID should always be detected and shown in the menu because all versions of Windows have HID drivers always installed (otherwise your USB keyboard & mouse wouldn't work).

Yeah, tried it with another cable fixed the issue. Thanks to everyone who helped me!
 
I now have another issue with the teensy and the adafruit MPL3115A2. When I try, to use Adafruit_MPL3115A2#begin, the teensy port closes. With an arduino uno, everything works fine.

I connected the SDL pin with pin 18 and the SCL pin with pin 19.

When i remove begin(), the teensy port stays open.

There is no error in the console.
Verbose info: https://pastebin.com/kk4Gs3Mh

My code:
Code:
#include <Adafruit_MPL3115A2.h>

Adafruit_MPL3115A2 baro = Adafruit_MPL3115A2();

void setup() {
  Serial.begin(38400);
  while (!Serial) ; //wait for serial port open
  Serial.println("Adafruit_MPL3115A2 test!");
  if (! baro.begin()) {
    Serial.println("Couldnt find sensor");
    return;
  }
}

void loop() {
  Serial.println(baro.getTemperature());
  delay(250);
}
 
Status
Not open for further replies.
Back
Top