Trouble with Sparkfun SAMD21 Mini breakout Serial USB port

Hello everyone. I was hoping the community could help me out. I'm not sure what I'm doing wrong. I'm having trouble trying to send a command from a Linux Debian 12 computer to a Sparkfun SAMD21 Mini Breakout via serial monitor.

This Sparkfun board is connected to a few relays that simulate button presses on a separate device. Here is my current sketch.

When I try this using the Serial Monitor on Arduino IDE on my Windows laptop it works fine.
I see the "Please Press 1 to Generate PIN" message. When I press "1" and then "Enter" I get the "Success" message sent back to me and the relays are successfully triggered.

I'm trying to reproduce this, using a linux Debian 12 device to send the command. I'm trying to use the program "screen" to send the command "1" from the Linux computer through the USB-C connector on the Sparkfun SAMD21 Mini breakout. From what I've found online this is the closest Linux program to Serial Monitor.

When I log into my linux device via ssh I can see that the Sparkfun Mini Breakout is "ttyACM0." I then use the command "screen /dev/ttyACM0 115200." I had set my baud rate to 115200 in my sketch.

However it doesn't seem to do anything. I just see a blinking cursor. I don't even get the "Please press 1 to Generate PIN" message fromt eh Mini breakout. What's odd is that I tried something similar with an old Arduino UNO and I was able to send it this command using screen from my linux device.

Here's the link to Sparkfun's website explaining the serial USB port works on the SAMD21 Mini breakout. I notice that they mention that the "the Serial USB port isn't broken out on the Mini Breakout." I'm not sue what this means. Would this prevent me from sending it a command using screen from a linux device? Thanks for your help guys.

Please edit your post to display code using code tags, using the <code> editor button. Do not post pictures of code or text.

You need to add a line to your code as follows, to give the system time to establish a connection before the code prints something.

SerialUSB.begin(115200);
while(!SerialUSB) delay(1);

I've never heard of "screen" but there are plenty of linux terminal programs that work fine. I usually use GTKterm. It will act like a terminal program, sending characters as you type, not like the Arduino serial monitor, where you enter a line of data and hit a "send" button.

This comment:

Also, the SerialUSB port isn't broken out on the Mini Breakout. If you want to use the pins 0/1 serial port, you'll need to replaceSerialcalls withSerial1.

means that you need a UART serial USB adapter connected to pins 0 and 1 to send and receive serial data to/from a linux USB port, using Serial1.read(), Serial1.print(), etc.

There are many suitable USB serial adapters, such as the FTDI Friend, or something like this one from Pololu.

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