Cmd error while connecting to blynk-cloud

Hi there,

I’m fairly new to Blynk and teensy. I’ve some experience with Arduino nano, uno and pro mini. For my new project i’d like to utilize a teensy 3.2, because of its capabilities and its form-factor. I took the teensy 3.2, because the specs told me, that it is capable of powering the esp01. In order to flash the ESPI used a dedicated serial-programmer.

But I’ve tried for hours to get the Blynk Blink and Blynk Push Data examples running and everything I was trying, I always get an “Cmd error” early after communication start. My app says ‘wasn’t online yet’. My ESP01 is connected to my local wifi. I can successful send pings to the IP shown in the log.

I flashed firmware of the ESP to

AT version: 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb) compile time:May 20 2016 15:06:44

as recommended at .

As far as I understand the log output, the ‘cmd error occurs’, when trying to send my auth-token (XXX) to the blynk-cloud.

I don’t think there is a problem in the serial communication, because the initial log output seems to me the two devices (teensy and esp01) can talk to each other.

I’ve already read a ton of posts here. I’ve already changed bauds to higher and lower values, but now I run out of ideas…

The Wiring:

    Power Supply over Teensy-USB-Port

    Teensy Pin  -->  ESP Pin
    GND           -->  GND    
    0 (RX1)       -->  TXD
    1 (TX1)       -->   RXD 
    3.3V            -->   Vcc   --> CH_PD         

The log output:


    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Teensy 3.2/3.1

[4810] Connecting to YYY

[7914] AT version: 11 2016 18:09:56)

SDK version:1.5.4(baaeaebb)

compile time:May 20 2016 15:06:44


[11057] +CIFSR:STAIP,""


[11057] Connected to WiFi

[21149] <[1D|00|01|00] XXX

[31184] Cmd error

[46293] <[1D|00|01|00] XXX

[56328] Cmd error

The sketch:

  Download latest Blynk library here:

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials:
    Sketch generator: 
    Blynk community:  
    Follow us:        

  Blynk library is licensed under MIT license
  This example code is in public domain.

    It's very tricky to get it working. Please read this article:

  This example shows how value can be pushed from Arduino to
  the Blynk App.

  BlynkTimer provides SimpleTimer functionality:

  App project setup:
    Value Display widget attached to Virtual Pin V5

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#define PIN02 2

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXX";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YYY";
char pass[] = "ZZZ";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 19200

ESP8266 wifi(&EspSerial);

BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, millis() / 1000);
void setup()
  // Debug console
  pinMode(PIN02, OUTPUT);
  // Test Output on Pin
  for (int i =0; i <4; i++) {
    digitalWrite(2, HIGH);
    digitalWrite(2, LOW);

  // Set ESP8266 baud rate

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
//  timer.setInterval(1000L, myTimerEvent);

void loop()
//; // Initiates BlynkTimer

There is a warning while compiling:

BlynkSimpleShieldEsp8266.h:45:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if ( < len) {

Try changing g this to…

Blynk.begin(auth, wifi, ssid, pass, "", 8080);


Thx @PeteKnight , but did not helped :frowning:

I’ve tried to connect the ESP to Serial3, I’ve even installed a local blynk-server installation and tried to connect to it. Still the same behavior: It still does not connect to the blynk server.
I can see in the monitor of my router, the ESP ist logged into my Wifi. I can ping the IP given to ESP.

Strange behavior: I’ve tried to put some debug println ( Serial.println("End of setup"); ) statements in my code, but nothing is printed to my monitor? Does blynk block Serial?

Is there a way to enable more debug info? Where can I find a documentation of the blynk debug output?

I’m getting frustrated :roll_eyes:

I’ve just re-read your wiring description and lo0okled-up the Teensy pinouts and it seems that you have a wiring error.

This tells Blynk that you are using the Teensy’s second serial port (Serial = first port, Serial1 = second port etc, for communication with the ESP-01.

However, you’ve said that your ESP-01 is connected to the first serial port…

You should be using pins 7 & 8 to connect to your ESP-01.

However, if you had it mis-wired then I don’t think that you’d see the Blynk output that you posted, so I assume that you’ve tried a variety of combinations and has posted the output from a configuration that was different to what you’ve shared above.


Once I had a wrong wiring. This gave the message ‘ESP8266 not found’