I think Arduino IDE V2.3.2 causing problems may need to downgrade to Arduino 1.8.19?

paynterf

Well-known member
For the last three years I have been using joe pasquariello's code successfully for over-the-air firmware updated to my Teensy 3.5-based robot project (see this post and this post for details). The host PC (a Dell XPS15-7590 laptop running Windows 11) uses Arduino IDE 1.8.19 and Teensyduino 1.57. I recently acquired a new Windows 11 PC (Dell XPS15-7590 running Win11) and decided to use Arduino IDE 2.3.2, as it seemed simpler to install and use.

However, I have found that when I do an OTA update from my new PC to my Teensy 3.5, the program hangs on a call to the MPU6050 6DOF IMH library code. If I do an OTA update of the same firmware from my old PC everything works fine Moreover, If I do a USB upload of the same code to my Teensy 3.5 robot using either PC, everything works fine, including all the calls to the MPU6050 library code.

The only difference I can see between the two configurations is the older PC uses Arduino IDE 1.8.19/Teensyduino 1.57, and the newer one uses Arduino IDE 2.3.2 (and the matching Teensyduino setup). The code (including all the library files) is identical, as I copied them from old to new PC's as part of the changeover process, the OTA RF hardware is the same (I'm using a Wixel pair, and simply moved the PC-end Wixel connection from one PC to the other). Uploads from either PC to the Teensy 3.5 via USB work fine - the only difference is in the OTA upload configuration.

I've come to the conclusion that some difference in the Arduino IDE/Teensyduino setup is causing this problem (no idea what - but have run out of other ideas and I'm down to "after eliminating everything else, whatever is left - however unreasonable - is the answer", so I would like to downgrade Arduino 2.3.2 to Arduino 1.8.19, but am unsure how to do this. Any advice?

TIA,

Frank
 
Simply install it... I have three versions of the IDE installed on my machine.
From the arduino.cc software page:
1726085469465.png

I typically download the zip file install. You then unzip where ever you want it. And then run it from there. This way
you can install multiple versions each with their own version of Teensyduino.... However TD releases < X (don't remember which one) will
have issues with IDE 2 installs, in that it will use the Version 2 stuff (board manager stuff)...
 
so I would like to downgrade Arduino 2.3.2 to Arduino 1.8.19, but am unsure how to do this. Any advice?

Easy. Just download the 2 installers (on both sites, scroll down as the newer stuff is at the top of each page). Run Arduino 1.8.19 installer first. Then run the Teensyduino 1.59 installer. If you went with the default location in Arduino's installer, the Teensyduino should fine it automatically.

Do not use Boards Manager to install Teensy as you would with Arduino 2.3.2. You must download the Teensyduino 1.59 installer from the PJRC web page. Before IDE version 2, the Boards Manger didn't have enough capability for Teensy. That's why we always published special installers for every Arduino version.

The old Arduino IDE had a special "portable mode" which you could activate by creating a folder. It makes that copy of Arduino IDE completely self-contained, not sharing settings or data with any others. If you do this before running the Teensyduino installer, it will notice portable mode and install accordingly. If you want to keep a copy of the old IDE around and not risk having it mess with another other installed copies, the portable mode might be useful.

Sadly, they didn't continue portable mode in Arduino version 2. Many people have requested it and the Arduino developers have made clear it will not happen. But it definitely is part of Arduino 1.8.19.
 
When using IDE 2.x.x, you can choose which version of the Teensy "board package" you install. This board package is equivalent to TeensyDuino. Do you know which version you installed? You said you are using TeensyDuino 1.57 on your old PC with IDE 1.8.19, but I wonder if you might be using a newer version, either 1.58 or the latest 1.59, on the new PC?

I'm pretty sure it's still the case that if you compile with IDE 1.8.19 and some version of TeensyDuino on computer A, and IDE 2.x and the SAME version of Teensy board package on computer B, you will get identical hex files. If you go to the board manager on 2.3.2 and click on the Teensy item, it should show you which version you have installed. If it's not 1.57, you could "downgrade" to 1.57 and try that.
 
Joe,

It's 'Teensy (for Arduino 2.0.4 or later), version 1.59.0. The downgrade options are 1.58.2, 1.57.3, 1.56.2. Is it the '1.57.3' that I want?

TIA,

Frank

PS: Love your OTA code - been using it successfully for almost three years now!
 
I'm not sure, but if I understand correctly, 1.57.3 would be Beta #3 of 1.57, and not the release version. I still use IDE 1.8.19, so I'm not very familiar with the 2.x stuff. You should probably wait for someone else to reply.

Once you get back up and running, if there is a difference based on which board package you use, and that is somehow affecting FlasherX, we can try to figure out why and fix it.
 
Yes. In Boards Manager, 1.57.3 is Teensyduino 1.57.

The ".3" means it's the 4th time it's been packaged for Boards Manager (we started with ".0"). It's still the same 1.57 version.

Over the last year or so Arduino CLI / IDE has made changes which prompted me to repackage the files. The most recent was the ability to run a pre_uninstall script. I believe Arduino CLI had this for a while but Arduino IDE 2.3.0 was the first to support it. At that time, I repackaged all existing versions to include the pre_uninstall script. Today the script does only 1 thing, which is tell Teensy Loader to quit. This tiny action makes a big difference on Windows, because if Teensy Loader is still running its .EXE file can't be deleted when the package is uninstalled (which happen when you upgrade or downgrade to a different version). Then later after you've installed a different version, Arduino CLI / IDE sees both the new version and part of the old version, and it handles that scenario very badly. The "precompile_helper: file does not exit" we used to hear reported regularly on this forum turned out to be the consequence, because Arduino was getting confused and using the newly installed version but then trying to run programs from the old location where most but not all files were deleted.

One of the others was the change to ZSTD compression. It's exactly the same data, but the files are .TAR.ZST rather than .TAR.BZ2. ZSTD decompresses faster on all plaforms, but it makes a particularly large improvement on Windows (still not nearly as fast as Linux and MacOS which have much more efficient filesystems) where the OS needs more CPU to process the many tiny files.

I don't recall what the others were, but they're minor changes in the packaging where you're still getting the same 1.57 version delivered.
 
OK, in Arduino 2.3.2 'Boards Manager, changing from 1.59.0 to 1.57.3 did the trick. I was able to successfully upload my program to Teensy 3.5 via Joe's wonderful OTA code, and it no longer hangs up.

The downgrade process in Boards Manager was simple - just uninstalled 1.59.0 and then installed 1.57.3.

Just as a wild-assed guess, I suspect this has something to do with a difference in wire libraries. The code hangs when attempting to communicate with a MPU6050 module on Wire0 (default wire port). Let me know if I can do anything to help the troubleshooting process.
 
One of the other changes I recall, but the details of when and which specific versions are now pretty distant and hazy memory, involved changes to the device discovery protocol. The protocol specifies a way for additional info about discovered devices to be communication to Arduino CLI, and for lines in the boards.txt / platform.txt file to allow matching that extra metadata up with the list of possible boards. Arduino CLI is supposed to turn this into Arduino's "FQBN" format and communicate it to Arduino IDE.

Early on teensy_discovery implemented this extra metadata for the USB type. But neither Arduino CLI nor Arduino IDE implemented it, so it just went unused. Later Arduino CLI implemented its part of the protocol. But Arduino IDE had a terrible bug where it got very confused when Arduino CLI gave it extra FQBN info about connected devices. So teensy_discovery was updated to not send that extra metadata. All the packages at that time got their last digit incremented. Even though teensy_discovery is actually a separate download and their JSON spec doesn't even allow different versions (why, I don't understand) to get the new teensy_discovery update to everyone who suddenly found Teensy wasn't detected properly by the then-new IDE release, the package version number had to be incremented.

Later when Arduino fixed that bug in the IDE, I again updated teensy_discovery. Fortunately the protocol has Arduino CLI / IDE announce its version, so I was able to add code which only sends the USB Type metadata when it's communicating with the newer versions which can handle it. Again, package version numbers were incremented, even though the packages didn't have even 1 byte change, it was only the device discovery utility. As a result, with the newer IDE if you have programmed a Teensy with any of the non-default USB Type options, when you select if from the IDE's drop-down list of detected devices, the Tools > Board, Tools > Port, and Tools > USB Type menus all update to match the detected hardware. Someday I'll find a way to put more info into the USB descriptors and update teensy_discovery to send more metadata as it detects your Teensy. But the USB Type was initially the only one that can be easily detected with the USB descriptors we have today.

So that's the long version of why these last digits have increased. It's all been stuff where the package is still the same code and files, but something about the Arduino software changed and the packages had to be rebuilt and the version bumped so people could see the update.
 
Last edited:
One of the other changes I recall, but the details of when and which specific versions are now pretty distant and hazy memory, involved changes to the device discovery protocol. The protocol specifies a way for additional info about discovered devices to be communication to Arduino CLI, and for lines in the platform.txt file to allow matching that extra metadata up with the list of possible boards. Arduino CLI is supposed to turn this into Arduino's "FQBN" format and communicate it to Arduino IDE.

Early on teensy_discovery implemented this extra metadata for the USB type. But neither Arduino CLI nor Arduino IDE implemented it, so it just went unused. Later Arduino CLI implemented its part of the protocol. But Arduino IDE had a terrible bug where it got very confused when Arduino CLI gave it extra FQBN info about connected devices. So teensy_discovery was updated to not send that extra metadata. All the packages at that time got their last digit incremented. Even though teensy_discovery is actually a separate download and their JSON spec doesn't even allow different versions (why, I don't understand) to get the new teensy_discovery update to everyone who suddenly found Teensy wasn't detected properly by the then-new IDE release, the package version number had to be incremented.

Later when Arduino fixed that bug in the IDE, I again updated teensy_discovery. Fortunately the protocol has Arduino CLI / IDE announce its version, so I was able to add code which only sends the USB Type metadata when it's communicating with the newer versions which can handle it. Again, package version numbers were incremented, even though the packages didn't have even 1 byte change, it was only the device discovery utility. As a result, with the newer IDE if you have programmed a Teensy with any of the non-default USB Type options, when you select if from the IDE's drop-down list of detected devices, the Tools > Board, Tools > Port, and Tools > USB Type menus all update to match the detected hardware. Someday I'll find a way to put more info into the USB descriptors and update teensy_discovery to send more metadata as it detects your Teensy. But the USB Type was initially the only one that can be easily detected with the USB descriptors we have today.

So that's the long version of why these last digits have increased. It's all been stuff where the package is still the same code and files, but something about the Arduino software changed and the packages had to be rebuilt and the version bumped so people could see the update.
Thanks for doing all that work Paul - I have definitely benefitted over the last several years, as I have used T3.2's and T3.5's in many of my projects. In particular, my current 4WD robot uses two T3.5's and a T3.2; one of the T3.5's is the main controller, the T3.2 handles detection and homing for an IR beam emitted by my charging station, and the other T3.5 manages a 7-element array of VL53L1X distance sensors.
 
I have attached the .HEX files from both the working version (with Teensyduino 1.57) and the non-working one (Teensyduino 1.59) if that helps
 

Attachments

  • WallE3_Git.ino_hex_with_1_57.zip
    303.9 KB · Views: 23
I have attached the .HEX files from both the working version (with Teensyduino 1.57) and the non-working one (Teensyduino 1.59) if that helps
Any chance you can try with both 1.57 and 1.59 on Arduino 1.8.19. That would clear up whether it is an Arduino 2.x.x or a Teensyduino 1.59 problem. You could also try Teensyduino 1.60b1 which has just been made available.
 
So I have Arduino 1.8.19/Teensyduino 1.57 on my older PC, and it works fine with OTA - so that combination is covered. How do I go about replacing Teensyduino 1.57 with 1.59 on that PC? I did a search for 'Teensyduino' on that PC and found only Teensyduino.txt in C:\Program Files(x86)\Arduino\lib. 'Teensyduino.txt' contents is just '1.57'.

Will downloading/installing Windows XP / 7 / 8 / 10 / 11 Installer from https://www.pjrc.com/teensy/td_download.html overwrite my current 1.57 setup? If so, and it turns out that 1.59 prevents proper OTA operation, how do I revert to 1.57? Can I simply copy the entire C:\Program Files (x86)\Arduino folder to a safe spot and then replace that entire folder to revert 1.59/1.60b1 back to 1.57?

I didn't see a link for Teensyduino 1.60b1. I'll be happy to try it as well, but I have the same question as above regarding a downgrade path back to 1.57 if necessary

Regards,

Frank
 
If you've been using Arduino IDE 2.3.2, just click Boards Manager, search for "Teensy", and then click the version number drop-down list. It should automatically have 0.60.1 now.

The beta tests start with "0" so Arduino IDE won't recommend it as an upgrade.
 
OK, I'll do that on my newer PC (using 2.3.2). And I have your link for Teensyduino 1.60b1 for my older PC. Waiting on thoughts for reversion to 1.57 on my older PC before changing anything.
 
On newer PC with Arduino 2.3.2 and Teensyduino 0.60.1, upload completes OK, but program hangs as before. Reverted back to 1.57 and confirmed proper operation. So, whatever is wrong with 1.59 is also wrong with 0.60.1 :(
 
Do you use any global C++ objects in your code that have contructors calling methods on other objects?
 
OK, I'll do that on my newer PC (using 2.3.2). And I have your link for Teensyduino 1.60b1 for my older PC. Waiting on thoughts for reversion to 1.57 on my older PC before changing anything.
The way I do it is this:
I am assuming that your current Arduino 1.8.19 (A1.8.19) has Teensyduino 1.57 (T1.57) on it.

With Windows Explorer:

Copy your C:\Program Files (x86)\Arduino and paste into C:\Program Files (x86)\
You should now get a folder called C:\Program Files (x86)\Arduino - Copy

At this point both the Arduino folders hold T1.57.

Rename the C:\Program Files (x86)\Arduino - Copy folder as C:\Program Files (x86)\Arduino - T1.57.
Now install Teensyduino 1.59 or T1.60b1.

Any Arduino compilations will now be using Teensyduino 1.59 (or T1.60b1).

If you wish to go back to T1.57, rename C:\Program Files (x86)\Arduino as C:\Program Files (x86)\Arduino - T1.59
and C:\Program Files (x86)\Arduino - T1.59 as C:\Program Files (x86)\Arduino.

As an aid to not becoming confused as to what version the current C:\Program Files (x86)\Arduino is, put an empty folder named ver T1.59 or ver T1.57 in each of the respective Ardiuno folders. That way you just have to inspect the Arduino folder to see which version of Teensyduino it is.

Picture below shows what I have done on my PC (I prefix the ver 1.59 with a so that it is always at the top.
z.png
 
The way I do it is this:
I am assuming that your current Arduino 1.8.19 (A1.8.19) has Teensyduino 1.57 (T1.57) on it.

With Windows Explorer:

Copy your C:\Program Files (x86)\Arduino and paste into C:\Program Files (x86)\
You should now get a folder called C:\Program Files (x86)\Arduino - Copy

At this point both the Arduino folders hold T1.57.

Rename the C:\Program Files (x86)\Arduino - Copy folder as C:\Program Files (x86)\Arduino - T1.57.
Now install Teensyduino 1.59 or T1.60b1.

Any Arduino compilations will now be using Teensyduino 1.59 (or T1.60b1).

If you wish to go back to T1.57, rename C:\Program Files (x86)\Arduino as C:\Program Files (x86)\Arduino - T1.59
and C:\Program Files (x86)\Arduino - T1.59 as C:\Program Files (x86)\Arduino.

As an aid to not becoming confused as to what version the current C:\Program Files (x86)\Arduino is, put an empty folder named ver T1.59 or ver T1.57 in each of the respective Ardiuno folders. That way you just have to inspect the Arduino folder to see which version of Teensyduino it is.

Picture below shows what I have done on my PC (I prefix the ver 1.59 with a so that it is always at the top.
View attachment 35766
Thanks - that's exactly what I needed!

Frank
 
Any chance you can try with both 1.57 and 1.59 on Arduino 1.8.19. That would clear up whether it is an Arduino 2.x.x or a Teensyduino 1.59 problem. You could also try Teensyduino 1.60b1 which has just been made available.
Arduino 1.8.19 with Teensyduino 1.57 - works OK
Arduino 1.8.19 with Teensyduino 1.59 - Hangs
Arduino 1.8.19 with Teensyduino 1.60b1 - Hangs.
Arduino 1.8.19 after reverting back to Teensyduino 1.57 - works OK
 
Back
Top