Invalid HW cmd:Error

i try a prog with terminal and then he gave me [19] Blynk v0.3.1
[520] Connecting to D-LinkDS
[5641] IP: 192.168.0.101

OK
[5671] Connected to WiFi
[13339] Ready (ping: 1135ms).
[54849] Invalid HW cmd: v
[132291] Ready (ping: 213ms).
@Dmitriy
@vshymanskyy

[19] Blynk v0.3.1
[520] Connecting to D-LinkDS
[7625] IP: 192.168.0.101

OK
[7656] Connected to WiFi
[16267] Ready (ping: 1138ms).
[51371] Invalid HW cmd:
+IPq

Please provide more info. What hardware setup do you use? (models, connectio type, sketches, etc)

Please give a meaningful name for the topic. Thanks.

the sketches is working but is in serial monitor say that. i put terminal.flush(); and the dont show any more... i dont try to see if it rezov the problem but is working.

Please post your code. This way we have to imagine what happens and that just doesn’t work :wink:

//int const lumsus=6;
//int const lumjos=5;
//int const lumstg=10;
//int const lumdre=11;

int o=0;
int prog=0;
int const faderat=5;
int const dl=200;
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_SoftSer.h>
#include <BlynkSimpleShieldEsp8266_SoftSer.h>

#include "SoftwareSerial.h" 
SoftwareSerial EspSerial(51, 53); // RX, TX

ESP8266 wifi(EspSerial);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "92680b781ff9441a85c3ab1d798a2114";
WidgetTerminal terminal(V11);
void setup()
{
  
  pinMode(6,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(11,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(13, OUTPUT);
  Serial.begin(9600);     // Set console baud rate
  delay(10);
  EspSerial.begin(9600);  // Set ESP8266 baud rate
  delay(10);
  Blynk.begin(auth, wifi, "D-LinkDS", "07439846705a");
}
void fade()
{
  for(int i=0;i<=255;i=i+faderat)
    {
      Blynk.run();
      digitalWrite(6,i);
      digitalWrite(5,i);
      digitalWrite(10,i);
      digitalWrite(11,i);
    }
   for(int i=255;i>=0;i=i-faderat)
    {
      Blynk.run();
      digitalWrite(6,i);
      digitalWrite(5,i);
      digitalWrite(10,i);
      digitalWrite(11,i);
    }
}
void cilic()
{
  for(int i=1;i<=16;i=i+1){
      digitalWrite(5,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(5,LOW);
      digitalWrite(10,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(10,LOW);
      digitalWrite(6,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(6,LOW);
      digitalWrite(11,HIGH);
      delay(dl);
      digitalWrite(11,LOW);
    }
   for(int i=1;i<=16;i=i+1){
    Blynk.run();
      digitalWrite(11,HIGH);
      delay(dl);
      digitalWrite(11,LOW);
      digitalWrite(6,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(6,LOW);
      digitalWrite(10,HIGH);
      delay(dl);
      digitalWrite(10,LOW);
      digitalWrite(5,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(5,LOW);
    }
    
  }
  void necunoscut1()
  {
  int rando=random(4);
if(rando+1==1){digitalWrite(5,HIGH);
      delay(dl);
      digitalWrite(5,LOW);}
else
  if(rando+1==2){
    digitalWrite(10,HIGH);
      delay(dl);
      digitalWrite(10,LOW);}
      else
      if(rando+1==3){
        digitalWrite(6,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(6,LOW);
      }
      else
        if(rando+1==4){
          digitalWrite(11,HIGH);
      delay(dl);
      Blynk.run();
      digitalWrite(11,LOW);
        }

  }
int necunoscut2(){

int rando=random(4);
rando=rando+1;
if(rando==1)fade();
else
if(rando==2)cilic();
else
if(rando==3)necunoscut1();
else
if(rando==4)necunoscut2();
}
BLYNK_WRITE(V11){
  if(String("stop")==param.asStr())
    {prog=0;terminal.println("oprit") ;terminal.flush();}
   else
    if(String("pr1")==param.asStr())
        {prog=1;terminal.println("Fade") ;terminal.flush();}
    else 
        if(String("pr2")==param.asStr())
        {prog=2;terminal.println("Ciclic") ;terminal.flush();}
        else
        if(String("pr3")==param.asStr())
       { prog=3;terminal.println("Necunoscut") ;terminal.flush();}
        else
        if(String("pr4")==param.asStr())
       { prog=4;terminal.println("Random") ;terminal.flush();}
        else
        if(String("pr5")==param.asStr())
        {prog=5;terminal.println("NORMAL") ;terminal.flush();}
        }
    
   


void loop()
{
  Blynk.run();
  if(prog==0)
        {
         digitalWrite(5,LOW);
          digitalWrite(6,LOW);
          digitalWrite(10,LOW);
          digitalWrite(11,LOW); 
        }
        else
  if(prog==1)
    fade();
   else
   if(prog==2)
    cilic();
    else
      if(prog==3)
        necunoscut1();
        else
        if(prog==4)
        necunoscut2();
        else
        if(prog==5);
        {
 digitalWrite(5,HIGH);
 digitalWrite(6,HIGH);
 digitalWrite(10,HIGH);
 digitalWrite(11,HIGH); 
        }
}

First, I think there is an error here:

 for(int i=0;i<=255;i=i+faderat)
    {
      Blynk.run();
      digitalWrite(6,i);
      digitalWrite(5,i);
      digitalWrite(10,i);
      digitalWrite(11,i);
    }

You are trying to do PWM, so you have to use analogWrite

Your code looks a bit messy and incomplete to be honest. In your fade routine there is no waiting, so it will fly through the loop with immense speed. I’m sure the outcome of that will not look like how you want it.

All the Blynk.run() statements are over the top I think. You probably gonna have a problem with too many commands sent.

Can you keep things simple and start with what you want without Blynk? That way you can at least confirm your code does what you want it to do.

1 Like