Arduino Uno RX Tx // avrdude: stk500_getsync() error

Hello I got a problem on using Arduino Uno board's Rx, Tx Pin.

What I'm gonna do is shadowing this below project.

https://create.arduino.cc/projecthub/taifur/lora-based-smart-city-air-quality-monitoring-3b5f1d?ref=search&ref_id=lora&offset=1

I've build the IoT sensor and upload the code and this error occured.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x2b
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x45
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x52
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x52
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x3d
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x31
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x0d
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20

When I searched the internet, there are two reasons in this error.

First is the port problem(But I checked all port related things, there are no problem)

Second is when Rx, Tx pin are used, this kind of error could be occur.
(I even confirmed when I remove the RX, Tx pin, the code got uploaded. So it is obvious
that the Rx, Tx pin is related with the error.)

But I must use the Rx, Tx pin because it's related with the lora antenna.

Is there anyway I could use the Rx, Tx pin on Arduino Uno board without the error??

(All the plans of the project and codes are posted in the link above)

Thank you for reading this and hope I could find the savor :frowning:

A 328P processor only has one UART. It's used for the USB connection with the PC. Connecting anything else to the TX pin can interfere with the upload (as you experienced).

The solution is to disconnect, upload and connect again.

Alternatives can be

  1. Use SoftwareSerial but I see a baudrate of 115200 in the code and SoftwareSerial will never work with that.
  2. Use a board with multiple UARTs like e.g. a Mega (and use e.g. Serial1) or a 32U4 based board (e.g. Leonardo) where the UART is not used for USB communication.
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.