Terminal long string disconnection issue

Hello,

My project is to get a string from terminal & to dispaly it to the serial monitor. Everything works fine with short strings. Whenever i tried to send long string say more than 100 characters, string received but blynk app got disconnected. Issue persists till i do a power refresh. One more issue i noticed that blynk library returns status regarding AT+CIPSEND,AT+CIPMUX etc. to serial monitor. How to disable these as they are slowing down my serial process. Any help would be appreciated.

More details please… what hardware device are you using and can you show your sketch please.

When posting code, please follow the “format” procedure as shown in the Welcome Topic:

I am using esp8266 01 with arduino uno. Sorry, for some reason i can’t post the whole code, but i am posting terminal part here

BLYNK_WRITE(V2)
{



  //delay(1000);
  if (mssg == true && (String("NL") != param.asStr()) ) //for new entry
  {
    message = param.asStr();
    //delay(1000);
    mssg = false;
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
  }
  if (String("NL") == param.asStr())  //NL(flag) for new line entry
  {
    message = "";

    terminal.println("Enter Data") ;
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
    mssg = true;
   

  }






  terminal.flush();



}

Hiii, I’ve raised this issue previously in Need Help with My Project section but later i’ve moved this topic to Issues section. Please help me whether it’s an issue or my code problem. Once again, my problem is to get a string from terminal & to dispaly it to the serial monitor. Everything works fine with short strings. Whenever i tried to send long string say more than 100 characters, string received but blynk app got disconnected. Issue persists till i do a power refresh. One more issue i noticed that blynk library returns status regarding AT+CIPSEND,AT+CIPMUX etc. to serial monitor. How to disable these as they are slowing down my serial process. Any help would be appreciated.

Hardware: Arduino Uno & Esp 8266 12 & 01 (Tested on both modules)
Software: Arduino 1.6.5 & latest blynk update

Part of code for terminal reception

BLYNK_WRITE(V2)
{



  //delay(1000);
  if (mssg == true && (String("NL") != param.asStr()) ) //for new entry
  {
    message = param.asStr();
    //delay(1000);
    mssg = false;
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
  }
  if (String("NL") == param.asStr())  //NL(flag) for new line entry
  {
    message = "";

    terminal.println("Enter Data") ;
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
    mssg = true;
   

  }






  terminal.flush();



}

Also, please tell me if there is requirement of timer becoz in short string it works like a charm and also how to use timer in terminal widget while receiving strings.

I thought this had been discussed in detail because I remember producing a sketch for large strings using the alphabet twice. So 52 characters and not the 100 characters you refer to but it turns out that was a totally unrelated subject.

I’ll answer the easy question first regarding commands being sent to Serial Monitor. You will probably have the following line towards to top of your sketch:

#define BLYNK_PRINT Serial

If you comment this out it will stop sending Blynk commands to Serial Monitor.

I will try to check the 100 characters issue but it will have to be with the ESP in standalone mode as I don’t do any of that shield malarkey.

Your issue is not reproducible on a Mega with Ethernet.

Presumably you have the following global declarations:

bool mssg = true;  // used in Terminal
String message;    // used in Terminal

I added this as the last line of the V2 function:
Serial.println(message);

Entering the alphabet 4 times (104 characters) it writes it back to Terminal and sends it to Serial Monitor as expected.

I have the baud rate set at 115200 but presumably you have 9600 for the super slow shield system.

the issue that @Costas refers to, was with me, and the root cause of problem was that i used the old 2.3 esp arduino core. after upgrading to 2.4, everything worked ok. you can try this too.

but anyway, the super slow 9600 baud alone is suficcient to produce those crashes, probably because of some esp watchdog timers running out.
you should do some timestamps printout to monitor this.

1 Like

The OP is using an Uno with an ESP so they are restricted to 9600 or perhaps a little faster but not much more.

Also they don’t have any Arduino core on the ESP just the AT firmware.

Timestamps is a good idea for debugging though.

but wouldn’t be better to use esp as master and uno as slave? than probably wouldn’t need to sand any strings at all between the 2 hw…

Yes in my book if it’s a true IOT project then ESP as master is almost always best but the OP hasn’t stated what their project does.

My final project is to display it on p10 led display module and i am using dmd2 library. Thanks for your suggestion. Let me implement your suggestions and see the results.

That doesn’t really tell us what the project is. From the limited information provided it doesn’t sound like a true IOT project, more a local project that you want to use the nice Blynk interface with.

Ha, that sounds like most of my projects as well :stuck_out_tongue:

@a_uno And I have merged both of your topics back into the original… please don’t create multiple topics on same issue. Thanks.

First of all it’s not a local project. My complete project is to get string from app and to display it on dmd display and it seems that the culprit is dmd2 library. Also there is no #define BLYNK_PRINT Serial in the code. Still getting AT+CIPSEND=1,27 like messages at line ending.

It’s a necessity to use esp 8266 01 as a shield while using dmd display p10 interfacing (SPI). Any solution to use esp 8266 as a standalone with p10 module?

How have you established this?

I’ve checked without dmd2 library. It’s getting the long string. It disconnects, but connects again. I am able to send new strings.

I don’t know what this is supposed to do but why did you choose to ignore all the advice regarding timers?

This routine is for scrolling text received on the display board. I am restricted to use this routine to get desired output. Actually delay(200); is responsible for scrolling speed. This is the least amount to make display visible.

As per the docs, use a timer.

Which part of the code to be required in timer subroutine?
Can you please elaborate becoz i am a little bit confused in how to use timer for string reception via terminal?