TTN Uno and serial on pins 0 and 1

OK, this has me stumped.
In order to debug a TTN Uno sketch involving a number of sensors and (of course) Lora I’m trying to use the serial TX/RX pins (pin0 and 1) on the board. I can’t get it to work.
So, I’ve stripped the sketch and sensors (zero) down the bare minimum.
Basically, I program via USB and then power via a USB power brick and monitor on pins 0 and 1 with a USB to serial TTL converter and putty.
If I try this with a Uno R3, it works fine (I see the serial comms in putty).
If I try this with the TTN Uno, I get nothing.

Is there something special I need to be doing to get serial out of these pins on a TTN Uno?

Code

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

void loop()
{
  int i = 0;
  
  while (true)
  {
    Serial.print("Message #");
    Serial.println(i);
    i++;
    delay(5000);
  }
}

The TTN “uno” is no sort of “uno” at all, it’s actually more or less a “leonardo”

That would mean that “Serial” is the USB emulated UART, while the actual hardware UART is probably something like “Serial1”

Hi,
thanks for replying.

I know the TTN Uno is more Leonardo and I’ve swicthed between the two in the Arduino IDE when compiling for each board.

Looking at the Leonardo, it seems to suggest the USB serial port is also available on pins 0 and 1. However, it doesn’t seem to work for me.

On the TTN Uno, Serial1 is I believe, the serial interface to the Lora module.

Just wondering if I’ve managed to break my pin0/1 I/Os. I did try to use them as outputs when driving LEDs (while also having Serial outputs).

Do you have a ground on the serial connection to the “Uno/Leonardo”?

Yes, it’s grounded fine. Same as for the Uno.

@cslorabox is onto something though.
Arduino - ArduinoBoardLeonardo says Serial1 is for the pin0/1 TTL O/P
However, I’m also sure that is the lora serial interface.
TheThingsNetwork examples in the IDE all have
#define loraSerial Serial1
#define debugSerial Serial

Should I chance Serial2 ??

Taking a squint at the schematic, it occurs to me that pins 0 & 1 are not, as Obi Wan would say, the serial port you are looking for.

The debug serial port that is “Serial” is actually running over USB as a CDC comms device. Pins 0 & 1 are Serial1 which are used to the connection to the RN2483.

So you’ll need to setup a SoftwareSerial on the pins of your choice.

Thank you @descartes

After my last post I was starting to wonder if those pins were connected to the lora serial rather than the ‘console’ serial. When I originally tried to monitor the serial with my original (sensors + lora) I did see some corrupted chars. So that will be the lora comms.
Bother. I’m trying to debug a program when it’s powered from the power socket via an auto-power switch triggered by an RTC, hence serial via USB isn’t suitable (with its integral power).

Can you link me to the schematic. The TTN Uno ‘documentation’ seems light on serial detail (at least in the docs I’ve found. Even a pinout of the TTN Uno appears to be impossible to find.

SoftwareSerial?? More Googling :slight_smile:

Free pass on not finding this via Google as it’s in a non-obvious Github user name: GitHub - TheThingsProducts/uno: The Things Uno

SoftwareSerial is ‘built-in’ to the Arduino core libraries so it’s in the official docs. Tell it which two pins, don’t run it too fast and it’s all the same as a real serial port.

1 Like

Most definitely NOT. The USB “serial” interface does not exist anywhere as an actual asynchronous serial “UART” stream, it is emulated ONLY.

On the TTN Uno, Serial1 is I believe, the serial interface to the Lora module.

Plausible. If the documentation confirms that is the case it would mean that there would be no UART available for other purposes.

In that case your options would be to use the USB tunneled scheme by claiming the data at the USB host only, using “software serial”, or not trying to do whatever you were hoping to do with a serial stream at all.

Thanks again.
And yes, I’ve been there before. A long time ago.
Must Google harder.

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