Skip to content

Opening example with .pde file extension fails silently #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
lmtanco opened this issue Sep 28, 2021 · 9 comments
Closed
3 tasks done

Opening example with .pde file extension fails silently #518

lmtanco opened this issue Sep 28, 2021 · 9 comments
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@lmtanco
Copy link

lmtanco commented Sep 28, 2021

Describe the problem

If the example for a library has .pde file extension, Arduino IDE will silently fail to open it.

To reproduce

  1. Use Library Manager to install version "1.1" of the "TimerOne" library from Library Manager
  2. Select Examples > TimerOne > Interrupt

🐛 The example doesn't open. There is no communication of a problem.

Expected behavior

Arduino IDE opens all valid example sketches, regardless of whether they use a deprecated file extension.

Arduino IDE version

2.0.0-beta.11

Operating system

  • macOS
  • Windows

Operating system version

  • Windows 10
  • macOS (not stated)

Additional context

On the Arduino forum, user in0 has reproduced the error on Windows and provides additional info:

I can reproduce it. You can see the problem when run from the command line:

root ERROR Request cloneExample failed with error: ENOENT: no such file or directory, rename 'c:\Users\<user name>\AppData\Local\Temp\.arduinoIDE-unsaved2021827-16716-11heo0w.vdua\Interrupt\Interrupt.pde' -> 'c:\Users\<user name>\AppData\Local\Temp\.arduinoIDE-unsaved2021827-16716-11heo0w.vdua\Interrupt\Interrupt.ino'

It's trying to rename the sketch in the temporary folder rather than in its true path under the library installation.

I don't have this problem with a standalone sketch using the .pde file extension.

Additional Reports

Workaround

Rename the example sketch to use the .ino file extension.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@lmtanco lmtanco added the type: imperfection Perceived defect in any part of project label Sep 28, 2021
@per1234 per1234 added the topic: code Related to content of the project itself label Sep 28, 2021
@ubidefeo
Copy link

ubidefeo commented Oct 5, 2021

hi @lmtanco
Thank you for the kind words :)

This issue is in our backlog, but since more and more 3rd party developers are updating their libraries and examples to comply with specifications, we gave it very low priority.
The .pde extension for Arduino has been long deprecated, and we feel that if we leave it as is nobody will care to bring their Sketch code into 2021 and beyond :)

I have created a PR to Paul with the extensions updated.
PaulStoffregen/TimerOne#54

Thank you

@per1234 per1234 changed the title Arduino IDE 2.0 beta silently fails if library example has .pde extension Opening example with .pde file extension fails silently Dec 7, 2021
@mrkylegp
Copy link

I have this issue in 2.0.2. Can't open a .pde example for the PCM library. Very frustrating.

@KurtE
Copy link

KurtE commented Dec 2, 2022

Just checked again, with yesterday's daily build (after 2.0.2) and still has issue.

This time with the Radiohead library.

@mrkylegp
Copy link

mrkylegp commented Dec 2, 2022

@KurtE Yep, it's very frustrating. Not exactly an upgrade IMO since several of the libraries I use have .pde files that wont open and the developers aren't going to be updating these libraries again. I'm back to using the older IDE for now.

@nbourre
Copy link
Contributor

nbourre commented Mar 21, 2023

My suggestion would be to detect if the library's examples are using the obsolete format, if so ask the user if he would like to upgrade them.

@wh201906
Copy link
Contributor

wh201906 commented May 2, 2023

I think this has been fixed in commit 0ab2826.
In the code before this, the copy() will rename the .pde into .ino, but it will try to access the new file with the old .pde extension, so it fails.
I have tested this bug on v2.1.0 and it was fixed.

@lmtanco
Copy link
Author

lmtanco commented Sep 29, 2023

Apologies for not closing this before.

This works perfectly now (v2.2.1). Even if the example has .pde extension, it will open it, then it will ask the user if they want to change its extension.

Tested on macOS Apple Silicon Ventura 13.4 (screenshot) and Windows 11.

image

@drf5n
Copy link

drf5n commented Feb 20, 2024

This is broken in IDE 2.3.2.

For example, try opening the:

File/Examples/AccelStepper/Bounce example that refers to this file on my Mac:

/Users/drf/Documents/Arduino/libraries/AccelStepper/examples/Bounce/Bounce.pde

Using the workaround for a differential test, rename your Random.pde to Random.ino within its library directory and the Arduino IDE will open it as usual.

For example:

/Users/drf/Documents/Arduino/libraries/AccelStepper/examples/Random/Random.ino

...functions as expected.

Tested on MacOS Sonoma 14.2.1 on Apple Silicon M2

image

No screen shot of the silent failure.


I find these other .pde files in my libraries:

libraries % find . -name "*.pde" -print
./TinyWireM/examples/Tiny85_Temp_LCD_RTC/Tiny85_Temp_LCD_RTC.pde
./TinyWireM/examples/Tiny85_Temp_LCD/Tiny85_Temp_LCD.pde
./TinyWireM/examples/Tiny85_Temp/Tiny85_Temp.pde
./Adafruit_BMP085_Unified/examples/sensorapi/sensorapi.pde
./AccelStepper/examples/MultipleSteppers/MultipleSteppers.pde
./AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde
./AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde
./AccelStepper/examples/Blocking/Blocking.pde
./AccelStepper/examples/ProportionalControl/ProportionalControl.pde
./AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde
./AccelStepper/examples/MotorShield/MotorShield.pde
./AccelStepper/examples/DualMotorShield/DualMotorShield.pde
./AccelStepper/examples/Quickstop/Quickstop.pde
./AccelStepper/examples/MultiStepper/MultiStepper.pde
./AccelStepper/examples/Overshoot/Overshoot.pde
./AccelStepper/examples/Bounce/Bounce.pde
./AFMotorDrawbot/examples/MotorParty/MotorParty.pde
./AFMotorDrawbot/examples/MotorTest/MotorTest.pde
./AFMotorDrawbot/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde
./AFMotorDrawbot/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde
./AFMotorDrawbot/examples/StepperTest/StepperTest.pde
./FreqMeasure/examples/Serial_Output/Serial_Output.pde
./FreqMeasure/examples/LCD_Output/LCD_Output.pde
./LiquidCrystal_I2C/examples/HelloWorld/HelloWorld.pde
./LiquidCrystal_I2C/examples/CustomChars/CustomChars.pde
./LiquidCrystal_I2C/examples/SerialDisplay/SerialDisplay.pde
./FrequencyTimer2/examples/Test/Test.pde
./Adafruit_LED_Backpack_Library/examples/custom_character/customgen/customgen.pde
./NXPMotionSense/OrientationVisualiser/OrientationVisualiser.pde
./FreqCount/examples/Serial_Output/Serial_Output.pde
./FreqCount/examples/LCD_Output/LCD_Output.pde

testing a few of these, I find they fail as well.

@drf5n
Copy link

drf5n commented Feb 20, 2024

See #2377 for 2.3.2 issue

@arduino arduino locked as resolved and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

9 participants