Arduino CLI And IDE now Released - Teensy Supported!

Thanks. Added it to my list of severe (for Teensy platform) issues I'm watching.

Looking at that list, almost all the issues have been fixed since January. Hopefully soon we can get more people actually using IDE 2.0, which can lead to reporting the non-severe usability issues.
 
@Paul I also referenced the new issue in post #1 of this thread.

@Paul and @PerT and ... - One thing that I am curious about, is with the daily builds for the IDE. Does it only pick up new things that are checked into the arduino-ide project or does it also pick up other changes to projects like arduino-cli?

The reason I ask, is for example one of the issues was closed as resolved by PR into the CLI (1755 closed by change 1758 in cli). Which was pulled in about 4 hours ago. So would this go into the next daily build, or probably only when we see a Pull into the IDE? My guess is the later.

I have not picked up any new daily builds since RC7 as that was the marking it as rc7 was the last change to the IDE project... But should we?

EDIT: Looks like another IDE one just got merged. which should fix the NO boards issue :D
Closed #1036 as completed via #1045.
 
would this go into the next daily build, or probably only when we see a Pull into the IDE? My guess is the later.
You guessed correctly. The version of Arduino CLI that will be used by the Arduino IDE build is defined here:

https://github.com/arduino/arduino-.../arduino-ide-extension/package.json#L156-L159

Code:
  "arduino": {
    "cli": {
      "version": "0.23.0"
    },

So you will only see changes made in the Arduino CLI code base take effect in the Arduino IDE after the Arduino IDE developers have bumped that value.

The reason it is pinned rather than pulling in the latest build is because sometimes the Arduino IDE code needs to be adjusted for changes in Arduino CLI before it will work.

I have not picked up any new daily builds since RC7 as that was the marking it as rc7 was the last change to the IDE project... But should we?

A couple of pull requests were just merged, including the one that fixes the bug where the IDE broke if there was a wrong URL in the "Additional Boards Manager URLs" preference.

So the next nightly build will be of interest.

FYI, tester builds are also generated by the CI system for every pull request, as well as immediately after the pull requests are merged in case you don't want to wait for the nightly to try things out and assist with the testing efforts.
 
Thaks @PerT

You guessed correctly. The version of Arduino CLI that will be used by the Arduino IDE build is defined here:

A couple of pull requests were just merged, including the one that fixes the bug where the IDE broke if there was a wrong URL in the "Additional Boards Manager URLs" preference.

So the next nightly build will be of interest.

FYI, tester builds are also generated by the CI system for every pull request, as well as immediately after the pull requests are merged in case you don't want to wait for the nightly to try things out and assist with the testing efforts.

Downloaded and playing.

One thing I noticed, was I downloaded the zip file, then erased contents of the folder I had the previous nightly build in... Then I unzipped into it....

First run of the nightly build. It was sort of interesting that the sketches tab was empty. I looked through other tabs... Took awhile for boards to fill in... probably enumerating and checking for updates...
But the sketchbook tab stayed empty. But the File->Sketchbook menu had list of sketches...

I closed out the windows. I then ran it again and this time the Sketchbook tab is populated.
Never sure if this is something to report or not... Maybe it was a fluke. Did not notice any Issues on this, but maybe not the right search terms.
 
Just installed Today's daily build:

@Paul @PerT: I was looking at the Arduino issue: https://github.com/arduino/arduino-ide/issues/1051
Which has to do with the Terminal Monitor not receiving data.

I ran into that with running @defragsters MakeFiles sketch yesterday (previous days build), And yes was using the CTRL key, which I really don't like. Enter should always work as long as the input field has the keyboard focus...

Today I rebuilt an MTP sketch for debugging some SD issue... And first built with: MTP Disk
And as such the USB Port was the Teensy port USB:....
And I was not receiving any input data. like in this case hitting CTRL+<enter> should print out simple menu...
Nothing came out.

Yesterday with Defragsters sketch I then simply closed the monitor, opened up TyCommander and it worked fine, so I know the sketch was built OK.

So with todays run, I then rebuilt using USB Type: Serial + MTP
and ran. And it still failed to get input when I had the USB port to the Teensy port.

But when I selected COM60, then the sketch did receive the keyboard input.

Running Beta3 code (package manager version)
 
Just installed Today's daily build:

@Paul @PerT: I was looking at the Arduino issue: https://github.com/arduino/arduino-ide/issues/1051
Which has to do with the Terminal Monitor not receiving data.

I ran into that with running @defragsters MakeFiles sketch yesterday (previous days build), And yes was using the CTRL key, which I really don't like. Enter should always work as long as the input field has the keyboard focus...

Today I rebuilt an MTP sketch for debugging some SD issue... And first built with: MTP Disk
And as such the USB Port was the Teensy port USB:....
And I was not receiving any input data. like in this case hitting CTRL+<enter> should print out simple menu...
Nothing came out.

Yesterday with Defragsters sketch I then simply closed the monitor, opened up TyCommander and it worked fine, so I know the sketch was built OK.

So with todays run, I then rebuilt using USB Type: Serial + MTP
and ran. And it still failed to get input when I had the USB port to the Teensy port.

But when I selected COM60, then the sketch did receive the keyboard input.

Running Beta3 code (package manager version)

I noticed that as well this morning as well when I switched from the PI4 to windows to receive data using the PC. I don't remember having that issue with the PI though.
 
@PerT @Paul @mjs513 and all.

I installed today daily build as well on W10...

I started off with simple sketch:
Code:
void setup() {
  pinMode(13, OUTPUT);
  while (!Serial)
    ;
  Serial.begin(115200);
  delay(1000);
  Serial.println("Start of Echo Test");
}

void loop() {
  if (Serial.available()) {
    digitalToggleFast(13);
    Serial.print("Received:(");
    int ch;
    while ((ch = Serial.read()) != -1) Serial.write(ch);
    Serial.println(")");
  }
}

Built it for T4.1 Serial type USB. Built and programmed Teensy 4.1
If I choose the Teensy Port (Teensy 4.1 at usb:0/140000/0...)
And I type anything in serial monitor and hit <Ctrl>Enter
Nothing shows up and the LED does not change state.

If I instead choose: Teensy 4.1 at COM27 Then I do get the data... And the LED flashes.

But: If I Serial print something, then it appears like then I do receive the Serial Input... That is changed sketch to:
Code:
elapsedMillis em = 0;
uint32_t alive_count = 0;
void setup() {
  pinMode(13, OUTPUT);
  while (!Serial)
    ;
  Serial.begin(115200);
  delay(1000);
  Serial.println("Start of Echo Test");
}

void loop() {
  if (Serial.available()) {
    digitalToggleFast(13);
    Serial.print("Received:(");
    int ch;
    while ((ch = Serial.read()) != -1) Serial.write(ch);
    Serial.println(")");
  }
  if (em > 5000) {
    // If I Uncomment the print below it echos???
    Serial.printf("Alive Count: %u\n", ++alive_count);
    em = 0;
  }
}

And I then on the Teensy port selection receive data after a delay until the next Serial output. No delay with COM27

I created new issue on this one: https://github.com/arduino/arduino-ide/issues/1072
 
Seems to work when I try with the latest nightly running on Linux.

screenshot.png
 
Just checked on the Pi4 as well and only one port gets enumerated as opposed to the 2 in Windows for the Teensy 4.1
Screenshot at 2022-06-17 12-06-08.png

Sketch is a bit different but same idea. Its reading a GPIO pin on the PI4 and telling me data is ready when it sees a pulse. I can check with the posted sketch but don't think it will be an issue

NOTE: the PI4 is only available for release sketches so this is using rc7
 
Looks like I can get 2 windows to talk to the same port. Seems each window has its own port selection, which is different from Arduino 1.8.x, and of course IDE 2.0 has no way to know that different pluggable monitor utilities will end up trying to access the same hardware.

screenshot.png
 
I just tried also on RPI4 with RC7 and it appeared to work OK there...

Edit: It also appears work on on MAC
 
Last edited:
Looks like I can get 2 windows to talk to the same port. Seems each window has its own port selection, which is different from Arduino 1.8.x, and of course IDE 2.0 has no way to know that different pluggable monitor utilities will end up trying to access the same hardware.

View attachment 28720

Just checked on Windows and does the same thing as you showed
 
First run of the nightly build. It was sort of interesting that the sketches tab was empty.

By "sketches tab", do you mean the "Sketchbook" view in the left side panel?:

Clipboard02.png

I closed out the windows. I then ran it again and this time the Sketchbook tab is populated.
Never sure if this is something to report or not... Maybe it was a fluke. Did not notice any Issues on this, but maybe not the right search terms.

High quality unique issue reports are always welcome.

However, the truth is that when there is a report of an issue none of the Arduino Tooling Team members can reproduce (I just did a quick check and couldn't), and even the reporting party can't reproduce, it is a bit of a non-starter because we can't really investigate the problem or validate any potential fixes for it. The chances of getting a resolution are far higher for reports of issues that can be reliably reproduced by the developers.

This may result in the reporter feeling that there was no payoff for the effort they put into making the report. My own approach is generally to scribble down a quick personal note about the thing I observed (I use the issue tracker in a private "companion" GitHub repository under my own account for this purpose). I continue to add notes to that issue if I encounter the issue again or find reports from other users about it. If it eventually reaches a state where I think it can be assembled into a viable formal report out of it, I then make the effort to write a high quality issue report.

Unfortunately, we encounter a significant number of these intermittent, environment-dependent issues with the Arduino IDE 2.x project.

Even when there is little chance of a report resulting in a resolution, it can sometimes act as a centralized location for gathering information from other occurrences of the issue, which might accumulate over time into something actionable.

Did not notice any Issues on this, but maybe not the right search terms.

I'm not aware of one off-hand, but it is also dependent on the answer to my question above about the meaning of "sketches tab".

I was looking at the Arduino issue: https://github.com/arduino/arduino-ide/issues/1051
Which has to do with the Terminal Monitor not receiving data.

I ran into that with running @defragsters MakeFiles sketch yesterday (previous days build), And yes was using the CTRL key

Then your issue is not the same as https://github.com/arduino/arduino-ide/issues/1051. That issue was exclusively about trying to use the unsupported "Enter" key to send from Serial Monitor and would not occur when using the supported "Ctrl + Enter" trigger.

Enter should always work as long as the input field has the keyboard focus...

This issue is tracked here:

https://github.com/arduino/arduino-ide/issues/572
 
However, the truth is that when there is a report of an issue none of the Arduino Tooling Team members can reproduce (I just did a quick check and couldn't), and even the reporting party can't reproduce, it is a bit of a non-starter because we can't really investigate the problem or validate any potential fixes for it.

I've felt this way many times over the years regarding the problems with Windows installations mysteriously missing 1 or more files. The most recent would be Defragster's install of Teensy package 1.56.53 on IDE 2.0.0-rc7 mysteriously missing teensy_secure.exe, even though it had all the other files from the same .tar.gz archive used by the Teensy package.

Maybe Windows Defender or some other anti-malware software is silently eating files? Or maybe Windows is simply not very reliable? Why this happens, and how to reproduce it, are complete mysteries. The problem is rare but does come up, pretty much always with Windows, where something went wrong (but no errors detected) with the software installation resulting in missing files. Reinstalling always fixes the problem. But users get no indication what's wrong, just a failed build with errors nobody understands. I guess experienced Windows users just instinctively know to try reinstalling stuff when these sorts of problems happen.

Many times I've considered adding a step with one of build process hooks to verify every file is present and has the correct size, maybe even check that all of them match a known SHA256 hash. I wonder if Arduino would consider adding this in IDE 2.0? Would be much more appropriate to do "in the background" while the user is typing or just staring at their code, rather that at a time sensitive moment like when they're waiting for the build & upload.
 
Thanks PerT,

The IDE 2 is coming along!

By "sketches tab", do you mean the "Sketchbook" view in the left side panel?:

Yes that is the area...


High quality unique issue reports are always welcome.

However, the truth is that when there is a report of an issue none of the Arduino Tooling Team members can reproduce (I just did a quick check and couldn't), and even the reporting party can't reproduce, it is a bit of a non-starter because we can't really investigate the problem or validate any potential fixes for it. The chances of getting a resolution are far higher for reports of issues that can be reliably reproduced by the developers.
As a retired developer... I totally understand. I used to triage a lot of bugs... So often times I don't like to generate an issue like this as no clue on what generated the issue and it did not
repeat.

Now Maybe it is related to the fact that Paul had just issued a new release of Teensyduino with the 1.57 Beta 3 stuff and this probably the first startup of the IDE since he had put those files up on the web... But that also may be total coincidence.

My own approach is generally to scribble down a quick personal note about the thing I observed (I use the issue tracker in a private "companion" GitHub repository under my own account for this purpose). I continue to add notes to that issue if I encounter the issue again or find reports from other users about it. If it eventually reaches a state where I think it can be assembled into a viable formal report out of it, I then make the effort to write a high quality issue report.
Good idea... I often communicate with a few other members and see if they have any idea and/or can reproduce.

Or tend to post something up here, to see if anyone chimes in to say they have seen it and/or can reproduce it.

This may result in the reporter feeling that there was no payoff for the effort they put into making the report.
There is always an interesting trade off between making it easy for people to report issues/suggestions, like wanting them to search through issues list, download a new version of the IDE... to report, especially if they already have several pending... Or they think it is so obvious someone has reported it already... Examples:

I just loaded up yesterdays daily build, and may want to change the board type so I click on the tools menu.
screenshot.jpg
Where are the boards... I dismiss the menu and load it again.
screenshot2.jpg
Oh there it is...

So then ask myself... Should I report it? ... Well seems pretty obvious so I am sure someone has already done so in the past....

Again thanks for the feedback and as I mentioned the IDE is getting more usable!
 
I've felt this way many times over the years regarding the problems with Windows installations mysteriously missing 1 or more files. The most recent would be Defragster's install of Teensy package 1.56.53 on IDE 2.0.0-rc7 mysteriously missing teensy_secure.exe, even though it had all the other files from the same .tar.gz archive used by the Teensy package.

Maybe Windows Defender or some other anti-malware software is silently eating files? Or maybe Windows is simply not very reliable?

Good morning Paul, I am pretty sure in the case that I reported, things like Windows Defender or the like was not at all related. As I use Norton, which I know @defragster hates...
Wish we were in a world where we felt we did not need such things, but... In most of the cases I have seen where maybe an installed file is removed, you should be able to go up somewhere in that security system apps, and see what files were removed or quarantined. In the past when this happened to me, the system would actually tell me file X is being quarantined...

What I have seen in the past, is often times subtle bugs are not discovered or resolved on the systems that the developers or testers don't typically use.
Or as we used to say: Eating your own dog food :D

Which is why I still use the Arduino Build process for everything and the IDE a lot of the time.

Side note: So far it looks like the issue I reported yesterday about not receiving Serial Input, appears to be with Windows. @PerT was able to reproduce, and transferred the issue to the CLI
https://github.com/arduino/arduino-cli/issues/1774#issuecomment-1159444406
And:
This tells me that the issue is not in the Arduino IDE code base. However, I'm not sure whether it is in Arduino CLI or in teensy-monitor. I'll transfer this to the Arduino CLI repo for now as that is at least closer to the correct place even if possibly not exactly it.
 
Where are the boards... I dismiss the menu and load it again.

Tried this just now on Linux. Both 2.0.0-rc7 and nightly-20220618 show the boards first time I click the Tools menu. Maybe it's a Windows only bug? Or maybe it's some sort of race condition where the computer CPU or storage speed matters?

But also noticed just opening the IDE, letting it load an example I had open previously, and then quitting with CTRL-Q causes it to ask me if I want to save changes even though I never typed any keystroke other than CTRL-Q to quit.
 
Tried this just now on Linux. Both 2.0.0-rc7 and nightly-20220618 show the boards first time I click the Tools menu. Maybe it's a Windows only bug? Or maybe it's some sort of race condition where the computer CPU or storage speed matters?

But also noticed just opening the IDE, letting it load an example I had open previously, and then quitting with CTRL-Q causes it to ask me if I want to save changes even though I never typed any keystroke other than CTRL-Q to quit.

EDIT: I meant to say, I am guessing a race condition

Yep - https://github.com/arduino/arduino-ide/issues/1026
 
IDE 2.0 often and regularly asks to save an unchanged file, even one the IDE presented on opening and never altered. KurtE noted this and has made an issue.

I've felt this way many times over the years regarding the problems with Windows installations mysteriously missing 1 or more files. The most recent would be Defragster's install of Teensy package 1.56.53 on IDE 2.0.0-rc7 mysteriously missing teensy_secure.exe, even though it had all the other files from the same .tar.gz archive used by the Teensy package.

Maybe Windows Defender or some other anti-malware software is silently eating files? Or maybe Windows is simply not very reliable? Why this happens, and how to reproduce it, are complete mysteries. The problem is rare but does come up, pretty much always with Windows, where something went wrong (but no errors detected) with the software installation resulting in missing files. Reinstalling always fixes the problem. But users get no indication what's wrong, just a failed build with errors nobody understands. I guess experienced Windows users just instinctively know to try reinstalling stuff when these sorts of problems happen.

Many times I've considered adding a step with one of build process hooks to verify every file is present and has the correct size, maybe even check that all of them match a known SHA256 hash. I wonder if Arduino would consider adding this in IDE 2.0? Would be much more appropriate to do "in the background" while the user is typing or just staring at their code, rather that at a time sensitive moment like when they're waiting for the build & upload.

Indeed that Defragster's install of Teensy package 1.56.53 on IDE 2.0.0-rc7 mysteriously missing teensy_secure.exe was resolved by a re-install of the board package. I did watch/posted console output for that re-install, but did not watch during initial install, so can't say if there was any error logged.

Update: Just installed nightly IDE 2.0 on wife's Win 10 machine.
{ disaster'ish: Popup's for approval behind the foreground Splash screen? Never completed {splash up and open app window had no body content}? Closed and restarted - then opened 'new sketch' showing, added Teensy JSON, closed to get it recognized: Do you want to save? }

As to 'teensy_secure.exe': It was installed! I navigated to the %appdata% folder and double clicked and indeed the defender system then popped up a message '... deleted for your safety' {went away before capture}
> somehow that file is not detected as 'safe'


Note: after laptop re-install I did not build or execute on Laptop machine #1 - not sure if it would get deleted again.
 
Sorry my issue: https://github.com/arduino/arduino-ide/issues/1026
maybe did not have that in title... Example files - ask to save even if no changes were made to them.

And as you mentioned, this also applies to automatically generated blank sketch... So could be new issue, but probably same one

Was poking around the issue and noticed you referenced https://github.com/arduino/arduino-ide/pull/893 which has been closed but if you scan through all the comments I noticed this:
I found the problem; it's here:

https://github.com/eclipse-theia/th...c/electron-main/theia-electron-window.ts#L125

On my installation, the currentUrl is file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/index.html?port=57442#/Users/a.kitta/Documents/Arduino/sketch_may27a, and the frontendUri is /Applications/Arduino IDE.app/Contents/Resources/app/lib/index.html. Note the incorrect URL encoding/escaping problem.

The !currentUrl.includes(frontendUri) will be true, and the default logic shortcuts the boolean evaluation, and the IDE2 does not show the dialog.

The fix is to URI encode the this.globals.THEIA_FRONTEND_HTML_PATH. It seems the space in the path is causing the issue again.

but not sure it related to the issue with example sketches that haven't been edited or if by touched also applies to whether you put the cursor in the sketch and scroll down or to coping code from example sketch to another.

EDIT: Ok have to eat my words here. Just tried just opening an example sketch and immediately close it and I get the message about saving or not. However, it does not happen if I open and close a sketch from the sketchbook.
 
Hi all,

I'm super excited about this but can't get it to run using `arduino-cli`. I installed `arduino-cli` on my machine (Arch Linux 5.15.49-1-lts) as well as the boards in the Arduino IDE: https://www.pjrc.com/teensy/td_156/package_teensy_index.json.

It's working perfectly fine in the Arduino IDE, just with the CLI I'm getting this error when trying to do basically anything:

Code:
$ arduino-cli board list
Error initializing instance: Error loading hardware platform: discovery teensy:teensy-discovery not found
Port         Protocol Type              Board Name FQBN Core
/dev/ttyACM0 serial   Serial Port (USB) Unknown             
/dev/ttyACM1 serial   Serial Port (USB) Unknown

Am I missing anything here?
 
Hi all,

I'm super excited about this but can't get it to run using `arduino-cli`. I installed `arduino-cli` on my machine (Arch Linux 5.15.49-1-lts) as well as the boards in the Arduino IDE: https://www.pjrc.com/teensy/td_156/package_teensy_index.json.

It's working perfectly fine in the Arduino IDE, just with the CLI I'm getting this error when trying to do basically anything:

Code:
$ arduino-cli board list
Error initializing instance: Error loading hardware platform: discovery teensy:teensy-discovery not found
Port         Protocol Type              Board Name FQBN Core
/dev/ttyACM0 serial   Serial Port (USB) Unknown             
/dev/ttyACM1 serial   Serial Port (USB) Unknown

Am I missing anything here?

Not sure I have not tried the CLI in a long time.. I am mainly experimenting with the IDE 2
 
Back
Top