Arduino IDE and Ubuntu 20.04 serial monitor problems

I recently upgraded to Ubuntu 20.04. And all hell broke loose with my code. Or so I thought. Thought somehow all hardware went bad. None of my test/debug printouts would show up once the loop started! Tried everything I could think of, nothing. Or they would show up, then I stop pushing buttons for a split second and no more Serial output.

Eventually figured out that it wasn't my hardware. And it wasn't my code either. It was the damned IDE. For whatever reason, neither 2.3.4 nor 2.3.2 play nice with Ubuntu 20.04. The Serial monitor is the problem. It just freezes randomly. To unfreeze it, I have to change the baud rate to something other than current in the drop down menu, then I have serial output for a bit. Then it freezes again. That pretty much makes the Serial monitor absolutely and entirely useless. Which royally sucks because I am doing something COMPLICATED with I2C button interaction and I have to make sure that callbacks are tracking correctly.

Is there a fix for this? If not, has anyone had this happen when they moved to 20.04? Has anyone been able to get around this problem? The forum shows that there's something that looks similar to my issue, but I can't read German.

You seem to know a bug exists, when you looked it up on github what is the status?

I don't recall having an issue with 20.04, but that was 4 years ago. I am running 24.04 LTS with version 2.3.4 of the Arduino IDE and have no problems.

You might try using the older 1.8.19 IDE.

1 Like

I haven't looked on github. I have no idea if there is a recorded bug.

I will see if that makes a difference. Thank you.

No, unfortunately 1.8.19 will not work for me. I installed it and... it cannot support my board. I am using the Adafruit Feather RP2040.

Did you follow Adafruit's installation instructions?

Now that I know that page exists...

That is the standard Philhower 2040 boards URL. He must have had that before in order to do anything with the 2040 family.

That is correct. Since the latest v2 IDE is not working for the OP, I suggested a fallback to 1.18.

One needs to add the URL in the preferences screen in order to select the board.

This was in the way of a possible workaround.

In order to make all relevant information available to any who are interested in this subject, I'll share a link to the formal bug report submitted by @georgemichael2000:

FYI: Ubuntu 20.04 will no longer receive security updates after April 2025.

Yes, but my Ubuntu upgrade schedule is not my own. It is dictated by policies outside of my immediate control. I may be upgrading by April. Or not.

Nothing like management decisions :frowning_face:
Been there, done that.

So I installed the 1.8.9 IDE and the Raspberry PICO etc toolkit. Configured the board. And there is no serial monitor at all. I compile the sketch, just working with the basic_callback sketch from the examples, forget about my own code for a minute. I upload the sketch (which I have to do manually using sudo, because for whatever reason Ubuntu locks up external USB interfaces to read-only unless root. I have a number of policies that are not my own, so maybe that's a side effect. Anyways. As soon as I upload the complied sketch and it gets going, I try to click on "Serial Monitor" and get an error that "Board at null is not available", whatever that means, never seen that before as the 2.3.x IDE just automatically reconnects when the board gets going. So in 1.8.9 the serial monitor just plain doesn't even work, let alone randomly freeze. Or at least I don't know where the magic buttons are.

Things are more manual on 1.8. Hopefully, doing the following will get you going.

  1. Start the IDE and select Tools/Board and your board type.

  1. Now, fromTools, select Port.

Now open the serial monitor.

If you haven't already done this, you will want to add your login to the dialout group.

Okay, got the serial monitor aaaannd.... same exact problem. If I stop pressing the NeoKey buttons for like 2 seconds, the monitor freezes. If I use the pull-down menu and change the baud rate, even to the same one as it was before, basically just simply use the pull-down rate menu, the serial output starts working again. Mind you, this is a canned example, "basic_callback" it is called. Not my own code.

And no, I can't just go and upgrade my operating system because this is some kind of a strange interaction between the IDE and Ubuntu 20.04. I don't control when I upgrade my operating system. That well above my pay grade.

Here is a straightforward sketch that exercises the serial port:

uint8_t count = 0;

void setup() {
  // start serial port at 9600 bps:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

}

void loop() {
  Serial.println(count);
  count++;
  delay(1000);

}

If, with this sketch, the serial port is still causing you grief, I am out of ideas. If it works, post the code that is giving you grief.