No Serial Port Name Defined

Status
Not open for further replies.

agrizzle

Member
Hi, I'm relatively new to all the arduino / teensy things and unsurprisingly I've ran into a snag. I'm following the instructions on the Serial input output tutorial and when I try to open the Serial monitor it's coming up as no serial port name defined.
Specs Windows 8.1
Arduino 1.6.6
Teensy 3.2

I have gone in to the teensyduino and tried to update the serial information that way, but it didn't do anything. Any help on getting the port to recognize would be greatly appreciated.
 
are you running a program on the teensy that has serial.begin(x) for USB->serial? If not, you'll see this issue.
 
If you're following a tutorial for regular Arduino, the one thing that's different on Teensy is you upload first. You do *not* need to select the port to upload. Uploading is done using HID protocol, not serial, so the upload process finds your Teensy automatically (or it asks you to press the button, if your Teensy isn't communicating).

After you upload, wait just a few seconds for your computer to detect the serial port. Then use the Tools > Ports menu, and with the port selected, you should be able to open the serial monitor window.
 
As far as the serial.begin(x) I don't believe I am. I'm using the arduino software, but I'm following the teensyduino on here, but once I get home I will try the communicate with teensy and see if that fixes it.
 
Arduino users are accustomed to the ever-present COM port/serial port. That is a hardware implemented USB<->serial.
The USB<->serial in the Teensy 3.x is not hardware based. It is done in the Teensy software, but that software creates the virtual serial (USB) port only if your program (or one of the demos) uses serial.begin() to cause the USB serial port to be activated due to the code for serial.begin(). So, the Teensy 3 shipped with a running blinky LED has no serial.begin(). You have to download one of the demos, as a newbie. See link in post #3 here.

This is the #1 FAQ on Teensy 3. It would be great if PJRC would include a printed top n FAQs with all boards shipped. Just a half-page of paper.
 
Last edited:
So I followed the instructions on defragsters link. However it's still showing no serial port name defined. Would having it plugged into a front panel usb make any difference versus plugging into the back panel usb? And I am using the Serial.begin(38400);
 
I am having problems myself to receive Serial.println from Teensy 3.6 (Win 7 - 1.6.11 - 1.30)

I can use the sketch "Hello World" and receive the message with no problems, but with the code below, I receive nothing from Teensy 3.6. Nevertheless, when using Teensy 3.2, it works as a charm.

suggestions?

Code:
#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

//#define SDssPin 53    //arduino mega
const int chipSelect = BUILTIN_SDCARD;

#define N_STRIPS     8
#define ARM_LENGTH   57
#define STRIP_LENGTH 456
  
int NPPin[N_STRIPS] = {0,1,2,3,4,5,6,7};

int ColorSeq = NEO_GRB;

int BitstreamFreq = NEO_KHZ400;     //ws2811

int r = 0;
int g = 0;
int b = 0;

int frameDelayMicroSec = 200;
int brightness = 100;

byte x;

Adafruit_NeoPixel strip[N_STRIPS] = {Adafruit_NeoPixel(ARM_LENGTH, NPPin[0], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[1], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[2], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[3], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[4], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[5], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[6], ColorSeq + BitstreamFreq),
                                     Adafruit_NeoPixel(ARM_LENGTH, NPPin[7], ColorSeq + BitstreamFreq)};

File dataFile;


void setup() {
  Serial.begin(9600);
  InitStrips();
  setupSDcard();
}


void loop() {  
  SendFile("calli3.bmp");
}

void InitStrips(){
  for (int i = 0; i < N_STRIPS; i++){
    strip[i].begin();
    strip[i].show();
  }
}
void setupSDcard() {
//  pinMode(SDssPin, OUTPUT);
  while (!SD.begin()) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}


uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = getGamma(readByte()) / (101 - brightness);
  b = getGamma(readByte()) / (101 - brightness);
  r = getGamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.
  byte stripOffset;
  for (int y = imgHeight; y > 0; y--) {
    //int bufpos = 0;
    stripOffset = 0;
    unsigned long antMillis = millis();
    for (int x = 0; x < ARM_LENGTH; x++) {
      for (stripOffset = 0; stripOffset < N_STRIPS; stripOffset++) { 
        uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + ((x+stripOffset*ARM_LENGTH) * 3))) ;
        dataFile.seek(offset);
  
        getRGBwithGamma();
        
        strip[stripOffset].setPixelColor(x, r, b, g);  
      }
    }
    for(stripOffset = 0; stripOffset < N_STRIPS; stripOffset++){
      strip[stripOffset].show();  
    }
    delayMicroseconds(frameDelayMicroSec);
    Serial.println(millis()-antMillis);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte getGamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}
 
Status
Not open for further replies.
Back
Top