arduino / ArduinoCore-megaavr

Arduino Core for the ATMEGA4809 CPU
103 stars 62 forks source link

Arduino Nano Every no Serial Communication after Start #102

Closed NelsonIg closed 3 years ago

NelsonIg commented 3 years ago

Hey everyone,

I try to communicate with the Arduino Nano Every through the serial usb port. This works fine when using the Arduino Serial Monitor. But if I use a different monitor/device, the arduino nano every will not respond. Only after first connecting the arduino serial Monitor with the Arduino Nano Every, it works fine.

So how can i communicate to the Arduino Nano Every right after start without connecting it first to the Serial Monitor of Arduino.

sample code:

void setup() {
  Serial.begin(9600);

}
int incomingByte = 0; // for incoming serial data
void loop() {
  // send data only when you receive data:
  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();

    Serial.write(incomingByte);
    Serial.write(incomingByte);
  }
}

here a related forum post link

Thanks in advance!

thomome commented 3 years ago

I probably encountered the same bug. Since the Arduino SerialMonitor has dtr enabled by default, the Arduino Nano Every auto-resets and works properly. But with dtr disabled nona4809.serial.disableDTR=true in boards.local.txt I am not able to get the serial port communicating on any other baudrate than 115200 (default of the firmware?)

@NelsonIg If you have control of dtr in your monitor/device, you could try to enable it or switch to 115200 baudrate as a workaround.

Since I don't have control over baudrate and dtr of the client, I would be very grateful for a fix.

NelsonIg commented 3 years ago

Thank you. This helped! Don't know how this wasn't answered before