8000 Strange issue with Serial2 · Issue #650 · espressif/arduino-esp32 · GitHub
[go: up one dir, main page]

Skip to content
Strange issue with Serial2 #650
Closed
Closed
@viktor1970

Description

@viktor1970

Hardware:

Board: DOIT DevKit V1
Core Installation/update date: 20/sep/2017
IDE name: Arduino IDE
Flash Frequency: 80Mhz
Upload Speed: 921600

Description:

Hallo, I've a strange issue with Serial2: there's a lot of garbage sent.
Here's the screenshot

On 1st loop the data (Nextion display codes) are sent correctly ("n1.val=5" and "dim=99", both with 3 0xFF as terminator); starting from second loop there's only garbage (exceps when val=17, but there's garbage too).

Then I made only this change:
HardwareSerial Seriale(1);
Leaving same pins and (of course) same code, and it works perfectly.

There's some issue with Serial2?

Best regards

Sketch:

#include <Wire.h>
#include <Nextion.h>

HardwareSerial Seriale(2);
Nextion nex(Seriale, true);

unsigned long tm1,tm2=5;;
char bf[20];

void setup() {
  Seriale.begin(38400,SERIAL_8N1,26,27);
  Serial.begin(115200);
  tm1=millis();
}

void loop() {
 if((millis()-tm1)>2000)
 {
  Serial.printf("num: %d",tm2);
  sprintf(bf,"n1.val=%d",tm2++);
  nex.sendCommand(bf);
  if(tm2%2) Seriale.print("dim=2"); else Seriale.print("dim=99");
  Seriale.write(0xFF);
  Seriale.write(0xFF);
  Seriale.write(0xFF);
  tm1=millis();
 }
}```

### Debug Messages:

No crashes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0