BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk Terminal does not show the reply from arduino

blynk terminal does not show the data or reply from the Arduino, even i uploaded the example available in Blynk examples. so i added the serial print, so it shows on serial but not on tha Blynk app.

#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); 
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
char auth[] = "f4b1b8ee6a0b4ad4af0602b04b3afe1d";
WidgetTerminal terminal(V1);
BLYNK_WRITE(V1)
{

  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"
  if (String("Marco") == param.asStr()) {
    terminal.println("You said: 'Marco'") ;
    terminal.println("I said: 'Polo'") ;
    Serial.println("you said marco") ;
    Serial.println("i said polo") ;
  } else {

    // Send it back
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
  }

  // Ensure everything is sent
  terminal.flush();
}
BLYNK_WRITE(V2)
{int pinValue = param.asInt();
Serial.println(pinValue);
}
void setup()
{

  DebugSerial.begin(9600);

  Serial.begin(9600);
  Blynk.begin(Serial, auth);
}
void loop()
{
  Blynk.run();
}

Guess you didn’t read all those directions you had to delete in order to put your question in this topic :wink: … I fixed your code formatting for you this time.

OH Wait!!.… also, if you are using an Android phone… there is a bug (still not fixed @BlynkAndroidDev :wink: ) wherein the terminal defaults to Black text on Black background… so everything is working, you just can’t see it :stuck_out_tongue:

image

Just click on the Text button to fix it…

image

PS, you can also simply send data with a Blynk.virtualWrite(V1, "Print this on the Terminal") command. In many ways it works much better then the dedicated terminal commands… try it out.

2 Likes

yes i know the trick u told in android, and i also tried the Blynk.virtualWrite method but still no display

nice catch! me too have this “high contrast” text sometimes :slight_smile:

it is as visible as 2 black cats fighting in a tunnel, or 2 polar bears fighting in a snowstorm…

i’ve changed the topic to issues and errors…

1 Like

@wanek This OP’s issue is unlikely a bug topic (assuming colours were changed :wink: ) I already changed it from that to a normal “help topic”’… I use terminal in a few different projects and it works perfectly fine… And already tagged a developer about the text (and in other topics as well).

@waqar665 Lets focus on what other (if any) examples and code you have tried.

When you enter text into the terminal input and press enter, do you see what you typed mirrored back, preceded by the > ?

Can you try a simple input repeater example

//===== Terminal Input =====
BLYNK_WRITE(V1) // Terminal Input Function
{
  String Termtext = param.asStr();
  Blynk.virtualWrite(V1, "You typed "+Termtext );
}

@GunnerTechTools it would be fixed in the next release,)

1 Like

Just switch it to Blynk green on Blynk green… if you need a bug, make it a promotional one :stuck_out_tongue:

1 Like

I wonder… is the Terminal Widget one of those that needs a server connection from the device? As this OP is using a BT/BLE library.

Gunner the code u sent works when its just ur code, when i put it in my code it does not work.
look at the code here. Waqar and maxi are integer i assigned, and the Waqar which has virtual does not sent the reply to the app, while the maxi one which i assigned a command for serial do show its reply in Arduino ide software in laptop.

BLYNK_WRITE(V4)
{ if (param.asInt()==waqar)
{ Blynk.virtualWrite(V1, "hi waqar");
}
 
 else if (param.asInt()==maxi) 
{Serial.println(param.asInt());
  Serial.println("max how r u");}

Again… format your posted code properly.

Blynk - FTFC

And terminal text needs parameter as string, not integer.

param.asStr()


http://docs.blynk.cc/#blynk-firmware-virtual-pins-control

image


gunner the integer is just an input, if the statement is correct the terminal has to write what ever it is told,
and i didn’t understand what are you saying about the format thing,
on ur code i write the same as my code,look, but it works in yours and not in mine,

BLYNK_WRITE(V1) // Terminal Input Function
{
  String Termtext = param.asStr();
  Blynk.virtualWrite(V1, "hi waqar");

in my code i also wrote “hi waqar” as in yours

Read this…

@waqar665 your last piece of code was serial.print() did you mean to put terminal.print()?

If you did you also need terminal.flush().

We would need to see your buggy code to fix it.

ohh i got what u r saying, so did u got my question?

But you are missing the part the parrots the text you typed…

Yours…

Blynk.virtualWrite(V1, “hi waqar”);

Mine…

Blynk.virtualWrite(V1, "You typed "+Termtext );

i don’t want to see the text i sent, i just send a code. if it verifies it will give me reply "hi waqar so the last string in ur code should be removed

I was using that as an example… I don’t know what you want to send to your terminal :stuck_out_tongue_winking_eye: But you would send it as a “string” or variable.

look that’s the code i did changing in urs and it still works

{
  String Termtext = param.asStr();
  Blynk.virtualWrite(V1, "hi waqar");

but mine is 

```BLYNK_WRITE(V4)
{ if (param.asInt()==waqar)
{ Blynk.virtualWrite(V1, "hi waqar");
}

but the mine one does not work.. look at the command it is the same but ur works in simple project and mine one not

Also… your quotation marks look strange (compared to my copy pasted code)…

Blynk.virtualWrite(V1, "You typed "+Termtext );

… are you using the quotation key?

image