No serial with Teensy 3.1

Status
Not open for further replies.

martin69

Member
Hello everyone,

I've got a problem with my brand new Teensy 3.1, on OSX 10.9.4
I'm trying to get it to output serial data, using the classic :

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

void loop() {
  printf("Hello World");
  delay(250);
}

The thing is, I'm having the same problem as in this thread :
http://forum.pjrc.com/threads/26406-Teensy-3-1-serial-on-OSX-can-t-see-any-serial-device

I cannot see it as a serial device, so inside Arduino I can't even open the serial monitor to check if it's outputting serial data.
Uploading sketchs works, but auto-reboot doesn't, I have to manually press the reset button every time, which is pretty strange.


My end goal is to integrate it in a larger application (which already works), where Processing computes stuff and sends data to multiple Teensys. This program works perfectly well with three devices (all Teensy 3.0), and I just want to boost it to five devices, which is why I bought two additional Teensy (3.1 this time)
For all the Teensy 3.0, I can see their Serial port the normal way (/dev/tty.usbmodem11231 and the likes). My Processing code uses the names of the teensies to differentiate between them, so I'd like to get the 3.1 to behave the same way as the 3.0, and have them show up as /dev/tty
Can't the Teensy 3.1 be used for a drop-in replacement of Teensy 3.0 ?

Thanks for all the help

Martin
 
I tried your code. It causes Windows to think my Teensy 3.1 malfunctioned and it ceases to be recognized by the USB driver.

I changed it to this:
Code:
void setup() {
  Serial.begin(38400);
}

void loop() {
  //printf("Hello World\n");
  Serial.println("Hello World");
  delay(250);
}

Now it works fine. My guess is printf makes some assumptions somewhere about where it is supposed to ouput to. Like stdout needs to be set maybe? I don't use printf on the Teensy so I don't have a fix.
 
Oops, copy paste error, the code I was trying was indeed the one with Serial.println
I'm having the exact same result : Teensyduino manages to send to program to the Teensy, but it doesn't show up either as a serial device.

And I still can't open the serial monitor, since no serial device is actually recognized inside Mac OSX

I'm not sure this problem is code-related, the code I want to use works with no problem on the Teensy 3.0 (I don't think it'd be useful to post it here), all my Teensy 3.0 show up as /dev/tty once I plug them in (always have), but the Teensy 3.1 are not recognized.
Any info regarding this ?
 
Check to see if "USB Type" is set to "serial" in the "Tools" toolbar menu.

Might want to check other things too like "Board" is set to Teensy 3.1 and not Teensy 3.0 and stuff like that.

That is my only other guess on this.
 
Yep, USB Type is set to Serial, and the selected board is Teensy 3.1

Just a question for all mac users (though I guess it should be like that on other OS too) : when you connect a Teensy 3.1 loaded with a sketch using Serial, do you see it coming up as a /dev/tty device ?
 
The example code I'm running is the blink with an added Serial println

Code:
const int ledPin = 11;

void setup() {
  Serial.begin(57600);
  Serial.println("Hello");
  // initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);
}


void loop() {
  digitalWrite(ledPin, HIGH);   // set the LED on
  delay(200);                  // wait for a second
  digitalWrite(ledPin, LOW);    // set the LED off
  delay(200);                  // wait for a second
  Serial.println("Looping");
}

Again, to load this code, after clicking the "load" on the Arduino program, my computer gets no response and nothing is sent, but when I force a reset (with the button), the code is indeed loaded, and the LED starts blinking.
But nothing can be observed on the serial monitor, as no serial port shows up (apart from tty.Bluetooth-Modem and tty.Bluetooth-Incoming-Port)
 
couple of things:
  1. what CPU speed are you using?
  2. what teensyduino version?
  3. post the exact sketch you are using.

The reason i got into this thread I have noticed with 1.20 RC2, at least this is the one I,ve tested that if you have blank sketch i.e.:
Code:
void setup() {


}


void loop() {


}
that USB will not enumerate. It's similiar to the issue on this thread but it enumerates if I just add some code. I'm looking into why now but wondering if anyone has noticed this also.

oh ya i'm using OSX 10.9.
 
@duff,
Yes, I have seen that on Windows. If you have an empty loop() it will not show up as a USB device. Add a delay or some Serial.println and it shows up just fine as a serial device.
 
Alright !
Your question just solved my problem :)
Guess it was another case of "now that was stupid"...

The CPU Speed I had set up was 16 MHz, because I was previously doing some stuff with a lot of Arduino Nanos - I had forgotten about this, but the setting stayed when I started to work again with the Teensys.
My code would upload, and seemingly work (at least it blinked) - but it appears that when set up with very low CPU speeds, the USB doesn't work. Now I'm back at 96 MHz, and everything works !
Thanks !
 
@duff,
Yes, I have seen that on Windows. If you have an empty loop() it will not show up as a USB device. Add a delay or some Serial.println and it shows up just fine as a serial device.

Hmmm it's not just OSX issue, Its got to be something to do with USB intialization, but i'd say its kinda annoying!
 
Yep, USB Type is set to Serial, and the selected board is Teensy 3.1

Just a question for all mac users (though I guess it should be like that on other OS too) : when you connect a Teensy 3.1 loaded with a sketch using Serial, do you see it coming up as a /dev/tty device ?

On Mac OS-X, it shows up as 2 devices, which Apple names /dev/cu.usbmodem###### and /dev/tty.usbmodem######.

Here's a screenshot that might help show what you'll see when things are working correctly.

macscreen.png
(click for full size)

For use in other non-Arduino software, usually the "cu." device is best. Some programs have trouble using the "tty." version.
 
Status
Not open for further replies.
Back
Top