arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.32k stars 394 forks source link

Missing support for external tools / plugins #58

Open szerwi opened 3 years ago

szerwi commented 3 years ago

Describe the solution you'd like I would like to propose support for external tools / plugins which are compatible with Arduino IDE. Ex. https://github.com/me-no-dev/arduino-esp32fs-plugin or https://github.com/me-no-dev/EspExceptionDecoder If it is already supported, how can I use tools in Pro IDE? If it is not supported yet, are there any plans for implementing that?

Describe the problem

There is no support for extending the capabilities of Arduino IDE via external tools/plugins. This is a feature parity mismatch with Arduino IDE 1.x.

To reproduce

  1. Follow the instructions to install the "Arduino Pico LittleFS Filesystem Uploader" plugin: https://github.com/earlephilhower/arduino-pico-littlefs-plugin#installation
  2. Start Arduino IDE 2.x
  3. Open the Tools menu.

🐛 The expected "Pico LittleFS Data Upload" menu item is missing.

Expected behavior

Support for extending the capabilities of Arduino IDE via external tools/plugins equivalent to the system provided by Arduino IDE 1.x.

Arduino IDE version

Original report

2.0.0-beta.1

Last verified with

2.0.2

Operating system

All

Operating system version

any

Additional context

Additional reports

Related

Issue checklist

ubidefeo commented 3 years ago

@szerwi we have long had this in our list, but the pre-existing tools are built on Java and the new IDE is built on Electron. In order to implement tools, we should offer entry points for those and developers should follow guidelines to write such tools in JS, or make them binary executables that could be launched. We're not there yet, but this particular instance, the ESP exception decoder, is one of the most used tools out there :)

szerwi commented 3 years ago

@ubidefeo Thanks for the reply. Do you mean that ESP exception decoder is one of the most used tools in Arduino IDE? Is there any way to run ESP exception decoder outside Arduino IDE and use it together with Pro IDE?

ubidefeo commented 3 years ago

@szerwi we don't have any stats/numbers, there aren't many tools available, but I know that one is widely used to make sense of stack output dumped into the serial when the ESP crash. You cannot use those tools outside of the Java IDE, they are made in Java and built to leverage the Tools system in the Java IDE

igrr commented 3 years ago

Hi, I'd like to mention that for the ESP-specific plugins, we are open to rewriting them in any language required for integration with Arduino IDE v2.0.

We are also open to some more limited or localized plugin functionality. For example, for the exception decoder it would be sufficient if we could add a core-specific "filter" tool which could take serial data from stdin and annotate with any additional information, and send that to stdout. The IDE could then launch this process in the background.

If some direction is given by the Arduino team, we can also contribute PRs to support these features.

ubidefeo commented 3 years ago

Thank you @igrr We're really happy to see this comment. We'll discuss this internally to figure out what's the best plan of action and get back to you. Right now we don't have an API for plugins, but it's been in our bucket-list for a while. I need to talk to the team to see if we can leverage a VS Code Extension kind of workflow to get started, give us some time to talk this. Thanks again 🙏🏼

rsora commented 3 years ago

This is actually an "IDE 2.0 vs IDE 1.x" feature parity item, I re-arranged the title and the labeling 🐱

PaulStoffregen commented 2 years ago

Just want to chime in, that Teensy needs this functionality for a tool which manages keys for code security.

sec

I'm can rewrite in whatever language and API are needed...

roberttidey commented 2 years ago

As I believe this is still to be added I put together a temporary standalone method for doing ESP8266 exception decoding.

https://github.com/roberttidey/NodeESPExceptionDecoder

This uses the same type of method used in the java decoder, but moved into javascript to run under node.

mrWheel commented 2 years ago

Also the esp8266/esp32 data upload tools (spiffs and LittleFS) are missing. Without them using/testing the 2 rc5 IDE is useless for me :-(

igrr commented 2 years ago

@ubidefeo @per1234 Congrats on reaching the Arduino IDE 2.0 release milestone!

I wanted to check if you could give any direction with regards to this issue? As I mentioned in https://github.com/arduino/arduino-ide/issues/58#issuecomment-945764907, Espressif is willing to contribute this functionality, since it's the main hurdle for our users in migrating to Arduino IDE 2.0. Any suggestion from you would be really valuable.

JimDrewGH commented 2 years ago

2.0 is really unusable until we can have "data" folders that can be stored on a ESP device.

ckuethe commented 2 years ago

And the exception decoder. My terrible workaround is to keep 1.8.19 as a parallel installation for when I do need those external tools.

Also, 2.0 was only just released, so I understand the authors of the various plugins and tools waiting until an actual release was available before deciding to spend time redesigning their plugins for the new IDE. Just look at how much stuff changed in the release candidates.

JimDrewGH commented 2 years ago

Any progress on this?

acamu commented 2 years ago

Hi , Any update on this case. Because it is a lack for the ESP familly :)

Thanks

alastaira commented 2 years ago

And the exception decoder. My terrible workaround is to keep 1.8.19 as a parallel installation for when I do need those external tools.

Also, 2.0 was only just released, so I understand the authors of the various plugins and tools waiting until an actual release was available before deciding to spend time redesigning their plugins for the new IDE. Just look at how much stuff changed in the release candidates.

It's my understanding that plugin authors are not "waiting" to update their modules to support the new IDE; it's that v2.x does not (currently) expose any of the requisite hooks to allow it to be extended. It's functionality that's missing, not stability.

me-no-dev commented 2 years ago

It's my understanding that plugin authors are not "waiting" to update their modules to support the new IDE; it's that v2.x does not (currently) expose any of the requisite hooks to allow it to be extended. It's functionality that's missing, not stability.

That is exactly the situation we are in :) I am sure that the Arduino IDE team is working on this

froussel commented 1 year ago

Hello me-no-dev Thank you for the plugin esp32 sketch data upload which works well with a wemos lolin32 lite for example in 1.8.19 but not with an esp32-S2 wemos s2 mini

Arduino : 1.8.19 (Windows 10), Carte : "ESP32S2 Dev Module, Enabled, Disabled, Disabled, Internal USB, Enabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 921600, None, Disabled"

Le croquis utilise 863258 octets (65%) de l'espace de stockage de programmes. Le maximum est de 1310720 octets.

Les variables globales utilisent 42572 octets (12%) de mémoire dynamique, ce qui laisse 285108 octets pour les variables locales. Le maximum est de 327680 octets.

esptool.py v4.2.1

Serial port COM7

Connecting...

Chip is ESP32-S2FNR2

Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V1

Crystal is 40MHz

MAC: 7c:df:a1:96:86:46

Uploading stub...

Running stub...

Stub running...

Changing baud rate to 921600

Changed.

Configuring flash size...

Flash will be erased from 0x00001000 to 0x00004fff...

Flash will be erased from 0x00008000 to 0x00008fff...

Flash will be erased from 0x0000e000 to 0x0000ffff...

Flash will be erased from 0x00010000 to 0x000e2fff...

Compressed 14624 bytes to 10157...

Writing at 0x00001000... (20 %)

Writing at 0x00001c58... (40 %)

Writing at 0x000027a1... (60 %)

Writing at 0x000032ad... (80 %)

Writing at 0x00003c50... (100 %)

Wrote 14624 bytes (10157 compressed) at 0x00001000 in 0.5 seconds (effective 217.5 kbit/s)...

Hash of data verified.

Compressed 3072 bytes to 128...

Writing at 0x00008000... (100 %)

Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.2 seconds (effective 160.6 kbit/s)...

Hash of data verified.

Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)

Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.2 seconds (effective 368.2 kbit/s)...

Hash of data verified.

Compressed 863648 bytes to 574599...

Writing at 0x00010000... (0 %)

Writing at 0x0001158a... (0 %)

Writing at 0x00012061... (1 %)

Writing at 0x00013728... (1 %)

Writing at 0x00014c4c... (1 %)

Writing at 0x00016335... (2 %)

Writing at 0x00017b72... (2 %)

Writing at 0x0001956d... (2 %)

Writing at 0x0001aef6... (3 %)

Writing at 0x0001c6e5... (3 %)

Writing at 0x0001dc9f... (3 %)

Writing at 0x0001ecd2... (4 %)

Writing at 0x000209d6... (4 %)

Writing at 0x00022608... (4 %)

Writing at 0x000235ba... (5 %)

Writing at 0x000248c3... (5 %)

Writing at 0x0002635d... (6 %)

Writing at 0x000276aa... (6 %)

Writing at 0x00028532... (6 %)

Writing at 0x000297dc... (7 %)

Writing at 0x0002ad63... (7 %)

Writing at 0x0002cb0d... (7 %)

Writing at 0x0002f17d... (8 %)

Writing at 0x000327b5... (8 %)

Writing at 0x00034519... (8 %)

Writing at 0x00035656... (9 %)

Writing at 0x000366f0... (9 %)

Writing at 0x000371e6... (9 %)

Writing at 0x00037be1... (10 %)

Writing at 0x000385b2... (10 %)

Writing at 0x0003906f... (11 %)

Writing at 0x00039bf2... (11 %)

Writing at 0x0003a77d... (11 %)

Writing at 0x0003b27c... (12 %)

Writing at 0x0003bec0... (12 %)

Writing at 0x0003cb53... (12 %)

Writing at 0x0003d6f4... (13 %)

Writing at 0x0003e059... (13 %)

Writing at 0x0003ea71... (13 %)

Writing at 0x0003f54e... (14 %)

Writing at 0x0003ffa8... (14 %)

Writing at 0x00040bd8... (14 %)

Writing at 0x00041798... (15 %)

Writing at 0x00042485... (15 %)

Writing at 0x00043084... (16 %)

Writing at 0x00043be6... (16 %)

Writing at 0x000448b5... (16 %)

Writing at 0x0004540a... (17 %)

Writing at 0x00045d7b... (17 %)

Writing at 0x00046708... (17 %)

Writing at 0x000470f5... (18 %)

Writing at 0x00047cf2... (18 %)

Writing at 0x00048799... (18 %)

Writing at 0x000491b8... (19 %)

Writing at 0x00049cf6... (19 %)

Writing at 0x0004a9b1... (19 %)

Writing at 0x0004b495... (20 %)

Writing at 0x0004bfa5... (20 %)

Writing at 0x0004cb56... (20 %)

Writing at 0x0004d67d... (21 %)

Writing at 0x0004e11a... (21 %)

Writing at 0x0004eb7f... (22 %)

Writing at 0x0004f558... (22 %)

Writing at 0x0005010c... (22 %)

Writing at 0x00050b6a... (23 %)

Writing at 0x000515f0... (23 %)

Writing at 0x0005200e... (23 %)

Writing at 0x00052a3c... (24 %)

Writing at 0x00053499... (24 %)

Writing at 0x00053f54... (24 %)

Writing at 0x00054a2b... (25 %)

Writing at 0x000554c3... (25 %)

Writing at 0x00055f33... (25 %)

Writing at 0x00056955... (26 %)

Writing at 0x000573d3... (26 %)

Writing at 0x00057ece... (27 %)

Writing at 0x00058879... (27 %)

Writing at 0x000591d0... (27 %)

Writing at 0x00059bc9... (28 %)

Writing at 0x0005a537... (28 %)

Writing at 0x0005af18... (28 %)

Writing at 0x0005bbb0... (29 %)

Writing at 0x0005c53b... (29 %)

Writing at 0x0005cf65... (29 %)

Writing at 0x0005d91f... (30 %)

Writing at 0x0005e2d1... (30 %)

Writing at 0x0005ec26... (30 %)

Writing at 0x0005f618... (31 %)

Writing at 0x0005ff70... (31 %)

Writing at 0x00060975... (32 %)

Writing at 0x000613c6... (32 %)

Writing at 0x00061d59... (32 %)

Writing at 0x000627ac... (33 %)

Writing at 0x00063135... (33 %)

Writing at 0x00063afb... (33 %)

Writing at 0x00064536... (34 %)

Writing at 0x00064f7b... (34 %)

Writing at 0x000659a2... (34 %)

Writing at 0x000663a3... (35 %)

Writing at 0x00066d98... (35 %)

Writing at 0x00067732... (35 %)

Writing at 0x00068128... (36 %)

Writing at 0x00068a9b... (36 %)

Writing at 0x0006941e... (37 %)

Writing at 0x00069ee2... (37 %)

Writing at 0x0006a8d6... (37 %)

Writing at 0x0006b1ef... (38 %)

Writing at 0x0006bb44... (38 %)

Writing at 0x0006c5d0... (38 %)

Writing at 0x0006cfc4... (39 %)

Writing at 0x0006d976... (39 %)

Writing at 0x0006e359... (39 %)

Writing at 0x0006ed43... (40 %)

Writing at 0x0006f6ff... (40 %)

Writing at 0x000701f5... (40 %)

Writing at 0x00070bad... (41 %)

Writing at 0x00071551... (41 %)

Writing at 0x00071e84... (41 %)

Writing at 0x000727ad... (42 %)

Writing at 0x000731a1... (42 %)

Writing at 0x00073b54... (43 %)

Writing at 0x00074674... (43 %)

Writing at 0x0007511a... (43 %)

Writing at 0x00075b9f... (44 %)

Writing at 0x000765c9... (44 %)

Writing at 0x00076fba... (44 %)

Writing at 0x00077961... (45 %)

Writing at 0x00078325... (45 %)

Writing at 0x00078cca... (45 %)

Writing at 0x00079609... (46 %)

Writing at 0x00079fe7... (46 %)

Writing at 0x0007aa2f... (46 %)

Writing at 0x0007b4da... (47 %)

Writing at 0x0007bf06... (47 %)

Writing at 0x0007c9c6... (48 %)

Writing at 0x0007d379... (48 %)

Writing at 0x0007ddbf... (48 %)

Writing at 0x0007e802... (49 %)

Writing at 0x0007f369... (49 %)

Writing at 0x0007fe0d... (49 %)

Writing at 0x00080a6a... (50 %)

Writing at 0x000813de... (50 %)

Writing at 0x00081d10... (50 %)

Writing at 0x000826ab... (51 %)

Writing at 0x000830d5... (51 %)

Writing at 0x00083baa... (51 %)

Writing at 0x00084513... (52 %)

Writing at 0x00084ed6... (52 %)

Writing at 0x0008581f... (53 %)

Writing at 0x000861fe... (53 %)

Writing at 0x00086c33... (53 %)

Writing at 0x000875eb... (54 %)

Writing at 0x00087fbe... (54 %)

Writing at 0x0008892e... (54 %)

Writing at 0x000892a2... (55 %)

Writing at 0x00089c30... (55 %)

Writing at 0x0008a5f5... (55 %)

Writing at 0x0008afd9... (56 %)

Writing at 0x0008ba49... (56 %)

Writing at 0x0008c449... (56 %)

Writing at 0x0008cdfd... (57 %)

Writing at 0x0008d90b... (57 %)

Writing at 0x0008e3b5... (58 %)

Writing at 0x0008ee72... (58 %)

Writing at 0x0008f955... (58 %)

Writing at 0x000903a2... (59 %)

Writing at 0x00091365... (59 %)

Writing at 0x00091f02... (59 %)

Writing at 0x00092aa8... (60 %)

Writing at 0x0009360d... (60 %)

Writing at 0x00094063... (60 %)

Writing at 0x00094ab4... (61 %)

Writing at 0x000954f0... (61 %)

Writing at 0x00095f06... (61 %)

Writing at 0x000969cc... (62 %)

Writing at 0x00097454... (62 %)

Writing at 0x00097f03... (62 %)

Writing at 0x0009899e... (63 %)

Writing at 0x000993c8... (63 %)

Writing at 0x00099d5e... (64 %)

Writing at 0x0009a7ff... (64 %)

Writing at 0x0009b1db... (64 %)

Writing at 0x0009bbab... (65 %)

Writing at 0x0009c594... (65 %)

Writing at 0x0009cfc3... (65 %)

Writing at 0x0009daf1... (66 %)

Writing at 0x0009e4f6... (66 %)

Writing at 0x0009eec2... (66 %)

Writing at 0x0009f7f6... (67 %)

Writing at 0x000a0202... (67 %)

Writing at 0x000a0b9b... (67 %)

Writing at 0x000a14fc... (68 %)

Writing at 0x000a1f35... (68 %)

Writing at 0x000a28df... (69 %)

Writing at 0x000a32e5... (69 %)

Writing at 0x000a3cdd... (69 %)

Writing at 0x000a46ff... (70 %)

Writing at 0x000a505d... (70 %)

Writing at 0x000a5a68... (70 %)

Writing at 0x000a648a... (71 %)

Writing at 0x000a6e68... (71 %)

Writing at 0x000a7957... (71 %)

Writing at 0x000a83cc... (72 %)

Writing at 0x000a8de9... (72 %)

Writing at 0x000a9799... (72 %)

Writing at 0x000aa149... (73 %)

Writing at 0x000aaad4... (73 %)

Writing at 0x000ab4aa... (74 %)

Writing at 0x000abede... (74 %)

Writing at 0x000ac879... (74 %)

Writing at 0x000ad288... (75 %)

Writing at 0x000addef... (75 %)

Writing at 0x000ae871... (75 %)

Writing at 0x000af2df... (76 %)

Writing at 0x000afd13... (76 %)

Writing at 0x000b0828... (76 %)

Writing at 0x000b12dc... (77 %)

Writing at 0x000b1d0a... (77 %)

Writing at 0x000b270c... (77 %)

Writing at 0x000b30c6... (78 %)

Writing at 0x000b3b14... (78 %)

Writing at 0x000b4534... (79 %)

Writing at 0x000b5094... (79 %)

Writing at 0x000b5b27... (79 %)

Writing at 0x000b65f9... (80 %)

Writing at 0x000b7040... (80 %)

Writing at 0x000b7aed... (80 %)

Writing at 0x000b84dc... (81 %)

Writing at 0x000b8f9a... (81 %)

Writing at 0x000b9a08... (81 %)

Writing at 0x000ba47b... (82 %)

Writing at 0x000bb0c4... (82 %)

Writing at 0x000bbdca... (82 %)

Writing at 0x000bcb36... (83 %)

Writing at 0x000bd5eb... (83 %)

Writing at 0x000be14a... (83 %)

Writing at 0x000beb59... (84 %)

Writing at 0x000bf5dc... (84 %)

Writing at 0x000c01ab... (85 %)

Writing at 0x000c0c17... (85 %)

Writing at 0x000c1670... (85 %)

Writing at 0x000c20f1... (86 %)

Writing at 0x000c2bdb... (86 %)

Writing at 0x000c36d6... (86 %)

Writing at 0x000c41b5... (87 %)

Writing at 0x000c4c91... (87 %)

Writing at 0x000c56e0... (87 %)

Writing at 0x000c6219... (88 %)

Writing at 0x000c6dd0... (88 %)

Writing at 0x000c8320... (88 %)

Writing at 0x000c8e93... (89 %)

Writing at 0x000c9d6b... (89 %)

Writing at 0x000cc506... (90 %)

Writing at 0x000cd244... (90 %)

Writing at 0x000cdc16... (90 %)

Writing at 0x000ce5af... (91 %)

Writing at 0x000cf4e2... (91 %)

Writing at 0x000d0bde... (91 %)

Writing at 0x000d15bd... (92 %)

Writing at 0x000d23a6... (92 %)

Writing at 0x000d32cf... (92 %)

Writing at 0x000d592d... (93 %)

Writing at 0x000d65c9... (93 %)

Writing at 0x000d7235... (93 %)

Writing at 0x000d7e1e... (94 %)

Writing at 0x000d890b... (94 %)

Writing at 0x000d925d... (95 %)

Writing at 0x000d9bf1... (95 %)

Writing at 0x000da5c7... (95 %)

Writing at 0x000dafdb... (96 %)

Writing at 0x000db911... (96 %)

Writing at 0x000dc2da... (96 %)

Writing at 0x000dcc62... (97 %)

Writing at 0x000dd6a5... (97 %)

Writing at 0x000de22c... (97 %)

Writing at 0x000dec83... (98 %)

Writing at 0x000df82b... (98 %)

Writing at 0x000e0592... (98 %)

Writing at 0x000e1137... (99 %)

Writing at 0x000e1b54... (99 %)

Writing at 0x000e25f5... (100 %)

Wrote 863648 bytes (574599 compressed) at 0x00010000 in 27.7 seconds (effective 249.6 kbit/s)...

Hash of data verified.

Leaving...

Hard resetting via RTS pin...

[SPIFFS] data   : F:\arduino 2022 10\arduino-1.8.19\portable\sketchbook\_projets\voilier autonome\EMailSenderEsp32GMailSPIFFSAttachTest\data

[SPIFFS] start  : 2686976

[SPIFFS] size   : 1472

[SPIFFS] page   : 256

[SPIFFS] block  : 4096

/logo.jpg
/data.txt
/parcours6.gpx
[SPIFFS] upload : C:\Users\admin\AppData\Local\Temp\arduino_build_458815/EMailSenderEsp32GMailSPIFFSAttachTest.spiffs.bin

[SPIFFS] address: 2686976

[SPIFFS] port   : COM7

[SPIFFS] speed  : 921600

[SPIFFS] mode   : dio

[SPIFFS] freq   : 80m

[SPIFFS] data   : F:\arduino 2022 10\arduino-1.8.19\portable\sketchbook\_projets\EMailSenderEsp32GMailSPIFFSAttachTest\data

[SPIFFS] start  : 2686976

[SPIFFS] size   : 1472

[SPIFFS] page   : 256

[SPIFFS] block  : 4096

/logo.jpg
/data.txt
/parcours6.gpx
[SPIFFS] upload : C:\Users\admin\AppData\Local\Temp\arduino_build_458815/EMailSenderEsp32GMailSPIFFSAttachTest.spiffs.bin

[SPIFFS] address: 2686976

[SPIFFS] port   : COM7

[SPIFFS] speed  : 921600

[SPIFFS] mode   : dio

[SPIFFS] freq   : 80m

esptool.py v4.2.1
Serial port COM7
Connecting...
Traceback (most recent call last):
  File "esptool.py", line 34, in <module>
  File "esptool\__init__.py", line 1004, in _main
  File "esptool\__init__.py", line 646, in main
  File "esptool\__init__.py", line 895, in get_default_connected_device
  File "esptool\loader.py", line 631, in connect
  File "esptool\loader.py", line 572, in _connect_attempt
  File "esptool\loader.py", line 435, in sync
  File "esptool\loader.py", line 351, in command
  File "serial\serialutil.py", line 372, in timeout
  File "serial\serialwin32.py", line 222, in _reconfigure_port
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'Un p�riph�rique attach� au syst�me ne fonctionne pas correctement.', None, 31)
[8312] Failed to execute script 'esptool' due to unhandled exception!
SPIFFS Upload failed!

esptool.py v4.2.1
Serial port COM7
Connecting....

A fatal error occurred: This chip is ESP32-S2 not ESP32. Wrong --chip argument?
SPIFFS Upload failed!
alastaira commented 1 year ago

Hello me-no-dev Thank you for the plugin esp32 sketch data upload which works well with a wemos lolin32 lite

@froussel - I think you posted this in the wrong place - this thread is concerning missing support for plugins in the Arduino IDE v2.0. Did you mean to create an issue for https://github.com/me-no-dev/arduino-esp32fs-plugin ?

Gord1 commented 1 year ago

Being able to upload files to the ESP8266 still doesn't work in IDE V2 :( Version: 2.0.2 Date: 2022-11-17T11:52:32.665Z CLI Version: 0.29.0 [76251df9]

This makes it a non-starter for many that use ESPs :(

Does anyone know how to upload files externally outside the IDE.

Hmm I think one of the file examples there was a file upload example. That would require embedding the /edit.html file in the sketch to get to upload.

wonder99 commented 1 year ago

I just keep a pre 2.0 version of the IDE around for the data folder uploader and ESP exception tool. Unfortunate.

roberttidey commented 1 year ago

I use 2.0 exclusively now. I don't have a problem with the missing upload part as I always include the file browser / edit facility in my sketches as this makes it much easier to upload, download and maintain items in the file system such as config files and log files.

The full browser / edit facility contains a simple file uploader which is used to bootstrap the 3 or 4 files needed for browse / edit to work. If one doesn't need the full capabilities then it is possible to use just this part for simple file uploading.

To make it easier I use a base library which includes all the browser / edit code together with other facilities like OTA programming and basic wifi set up.

For the missing exception tool I use an off-line equivalent as described earlier in this issue.

Obviously it would be nice to get of this stuff directly in v2 but it is not stopping me using v2 all the time.

sprior commented 1 year ago

@roberttidey I'd be curious to see that base library if you've shared it somewhere.

The other thing I've found to be more difficult than expected is there is no obvious way I've found to check if the filesystem has already been formatted on boot. If it was already formatted I want to just use what's there, but if not then format it. Haven't found a way yet.

roberttidey commented 1 year ago

This is my base support library

https://github.com/roberttidey/BaseSupport

For the filesystem, begin() should return true if formatted and false if not. Check the initFS routine in the basesupport library

podaen commented 1 year ago

@igrr I just discoverd that arduino for the esp is using an 23year old c version by default in the platform.txt. No wondering you having some problems to impliment it. It can be as high as 18years later...

podaen commented 1 year ago

@igrr if you set over to linux payload for the arduino IDE, than you can use plugins that are java based and evrything mixed together.

me-no-dev commented 1 year ago

I just discoverd that arduino for the esp is using an 23year old c version by default in the platform.txt. No wondering you having some problems to impliment it. It can be as high as 18years later...

What do you mean by that? What is 23 years old? This discussion is about the possibility to add plugins, like that Java based ones to the new IDE 2.x

podaen commented 1 year ago

It's probably not related to this. It's me that have a lot of issues by the default settings.

I have the plugin works linux payload. So thats for sure!

igrr commented 1 year ago

That sounds unrelated to the topic of this issue. I think the arduino-esp32 project will switch from -std=gnu99 to -std=gnu17 in the upcoming 3.0 release, but this can be discussed/tracked on the arduino-esp32 project issue tracker, not here.


On the topic of this issue, I have recently found that it is already possible to load Theia plugins from a profile directory: https://github.com/arduino/arduino-ide/blob/2a55ddd757aeba1a88a5fa12d290c2b3bebf6d69/electron/build/scripts/arduino-ide-electron-main.js#L7.

What we are missing now to implement plugins like the file uploader and exception decoder is some stable API to access information about the current sketch: source directory, build directory, FQBN, selected serial port.

dlarue commented 1 year ago

ESP-IDF devs just added operational JTAG debugging in the Arduino v2 IDE so it would be beneficial to have a way to upload to an onboard flash filesystem so developers aren't required to go back to the 1.8.x IDE just to upload HTML files to the flash.

esp32 core v2.0.6 changes

DmitryOb commented 1 year ago

Please ping me when IDE 2.x will support external tools (for file uploading), now IDE 1.8.19 more useful when you want upload files to ESP

cwysong85 commented 1 year ago

@DmitryOb I recently moved over to platform IO and everything just works.

podaen commented 1 year ago

@igrr As far as I understand it, it is based on Theia, build with electron and the machine interface is cli.

The Arduino IDE 2.x is a major rewrite, sharing no code with the IDE 1.x. It is based on the Theia IDE framework and built with Electron. The backend operations such as compilation and uploading are offloaded to an arduino-cli instance running in daemon mode. This new IDE was developed with the goal of preserving the same interface and user experience of the previous major version in order to provide a frictionless upgrade.

https://arduino.github.io/arduino-cli/0.29/

and as I search for it I found that to run Javascript in CLI, you need a Javascript interpreter.

mhama commented 1 year ago

just an idea, but how about creating a proxy app for v1 plugin, which is created from v1 Arduino IDE but without any editor features. So that the proxy app can load and execute v1 plugins. The proxy app communicates with v2 IDE to get some needed informations. So that v1 plugins can work alongside v2 IDE.

me-no-dev commented 1 year ago

@mhama v1 plugins are written in Java. Supporting them would be going backwards IMHO

Tanathy commented 1 year ago

Same issue here and first time I checked the IDE 2.0 (I have the version of 2.0.4). No external tools, nor portable support. Literally new IDE bound to 1 computer and I am unable to deal with ESP32 and ESP8266 boards with the IDE 2.0.

roberttidey commented 1 year ago

Yes, The external tools like exception decoder are not there, but the support for ESP32 and ESP8266 development definitely is there. I use both those all the time. For me the tools is not a big deal as I have my own exception decoder and I never use the IDE file upload as I always include that intrinsically in each app which I find much more convenient.

Same issue here and first time I checked the IDE 2.0 (I have the version of 2.0.4). No external tools, nor portable support. Literally new IDE bound to 1 computer and I am unable to deal with ESP32 and ESP8266 boards with the IDE 2.0.

kittaakos commented 1 year ago

Originally posted by @frank26080115 at https://github.com/arduino/arduino-ide/issues/2066#issuecomment-1544483496:

Please implement a method by which files from the <sketch_folder>/data can be uploaded to the ESP8266 or ESP32's SPIFFS memory. In IDE v1.x this was accomplished via https://randomnerdtutorials.com/install-esp32-filesystem-uploader-arduino-ide/ and https://github.com/me-no-dev/arduino-esp32fs-plugin

Yea I want this too, can't upgrade the IDE until this is available.

frank26080115 commented 1 year ago

oh cool, I see a pull request working on this https://github.com/arduino/arduino-ide/pull/1893 thanks @radurentea

I have no experience with node.js or electron but this pull request can be an example I learn from.

rtek1000 commented 1 year ago

Unfortunately, I'm seeing that instead of the IDE 2 expanding the number of users, with more features, this IDE without the tools already available in version 1, is pushing users away to other platforms like Vscode and Platformio.

Alternatively, you might want to try using VS Code + PlatformIO. It’s a great way to program the ESP32 boards. Here are some tutorials:

Source: https://rntlab.com/question/tools-for-arduino-ide-2-0/

Is there a new plugin available fitting into the Ar IDE 2.0 environment? If not, what options do exist as alternative? I use OTA successfully, but it takes a huge overhead to program when all you want to do is a simple test.

  1. command line tool
  2. if you by any chance also using vs code with platformio then you can use it to flash spiffs/fatfs

great idea. Which one?

spiffsgen.py

Source: https://esp32.com/viewtopic.php?p=77970

frank26080115 commented 1 year ago

I myself can totally just use a python script or even write a GUI around the python script so it's just a single click to upload the entire data folder. That's easy. But the problem is that occasionally I actually make an open source project that other people would like to replicate, and for me to write the build instructions, it's much easier to include a screenshot of a button inside the Arduino IDE rather than writing my own tutorial on how to install Python.

For now, the instructions I've published actually explicitly state to not download IDE v2 for this reason. I have a whole series of screenshots showing users how to navigate to the "previous version" section of the Arduino website. If I don't, I will end up having to answer a ton of really avoidable support requests.

rtek1000 commented 1 year ago

And on the Electron website it is written that it is easy, imagine if it was written that it was hard :broken_heart:

Electron

holgerlembke commented 1 year ago

I know I'm a bit late to the party, but at least I made an exception decoder for esp32/esp8266 that runs stand alone on Windows & is dead simple to use (I hope so).

https://github.com/holgerlembke/ESPEDfGK

Quency-D commented 1 year ago

I wrote a test plug-in with reference to GitHub - dankeboy36/esp-exception-decoder: ESP8266/ESP32 Exception Decoder Extension for the Arduino IDE. It works very well under vscode, but does not work in Arduino 2.2.1.

The main difference is that the terminal.sendText function does not work on Arduino.

As far as I know, the terminal displays only keyboard input and terminal.sendText . Now terminal.sendText cannot be used. Is there any other way for me to display data to the terminal?

Here is the link to the published test firmware, Arduino-helloworld - Visual Studio Marketplace.

import { stringify } from 'querystring';
import * as vscode from 'vscode';

class  pseudoterminalTest implements vscode.Pseudoterminal{
    readonly onDidWrite: vscode.Event<string>;
    readonly onDidClose: vscode.Event<number | void>;

    private readonly onDidWriteEmitter: vscode.EventEmitter<string>;
    private readonly onDidCloseEmitter: vscode.EventEmitter<number | void>;
    private readonly toDispose: vscode.Disposable[];

    constructor(){
        this.onDidWriteEmitter = new vscode.EventEmitter<string>();
        this.onDidCloseEmitter = new vscode.EventEmitter<number | void>();
        this.toDispose = [
            this.onDidWriteEmitter,
            this.onDidCloseEmitter,
          ];
          this.onDidWrite = this.onDidWriteEmitter.event;
          this.onDidClose = this.onDidCloseEmitter.event;
    }
    open(): void{
        this.onDidWriteEmitter.fire("open");
    }
    close(): void{

    }

    handleInput(data: string): void {
        this.onDidWriteEmitter.fire(data);
    }
}

const pty = new pseudoterminalTest();
// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

    console.log(' your extension "helloworld" is now active!');

    let disposable = vscode.commands.registerCommand('helloworld.helloworld', () => {
        const options: vscode.ExtensionTerminalOptions = {
                name: 'hello_terminal',
                pty,
                iconPath: new vscode.ThemeIcon('debug-console'),
            };
        let terminal: vscode.Terminal;
        terminal=vscode.window.createTerminal(options);
        terminal.show();
        terminal.sendText('\x1b[31mHello world\x1b[0m',true);
    });
    context.subscriptions.push(disposable);
}
dankeboy36 commented 1 year ago

Here is the link to the published test firmware

Hi, if you link the repo to the source code, I can look at it.


Update: :thread: continues at https://github.com/Quency-D/esp-network-monitor-port/issues/1.

Quency-D commented 1 year ago

@dankeboy36 I just uploaded the code, please help me take a look. https://github.com/Quency-D/esp-network-monitor-port

rdragonrydr commented 1 year ago

Quick question here - I'm very interested in having these plugins work on IDE 2.0 (I really like the code inspection), but I'm seeing VSCode plugins and similar getting mentioned as related. Are we just bundling VSCode, or porting the store/large parts of it? I really wanted to avoid all those analytics...

per1234 commented 1 year ago

Are we just bundling VSCode, or porting the store/large parts of it?

Arduino IDE 2.x is built on the Eclipse Theia IDE framework. Theia supports VS Code extensions:

https://theia-ide.org/docs/authoring_vscode_extensions/

So Arduino IDE 2.x had support for VS Code extensions all along, and in fact the stock Arduino IDE installation already makes heavy use of extensions. No additional work is needed on Arduino IDE codebase for VS Code extension support.

Even though the VS Code extension system makes it possible to do quite a lot in adding additional capabilities to Arduino IDE, in order to accomplish the equivalent to what is done in some of the Arduino IDE 1.x "plugin" tools, the extension also needs access to the Arduino-specific data known to Arduino IDE/Arduino CLI. The lack of access to such data has been the technical blocker for creating VS Code extension replacements for the Arduino IDE 1.x "plugin" tools. That missing capability was recently added: https://github.com/arduino/arduino-ide/pull/2110

So from a technical standpoint we can close this issue as resolved. The outstanding task for Arduino is documenting:

I would like to keep the thread here very tightly focused. For less structured discussion of the subject, please feel free to create a topic on Arduino Forum. I'll be happy to participate over there:

https://forum.arduino.cc/

igrr commented 1 year ago

The outstanding task for Arduino is documenting:

The fact that adding additional capabilities to Arduino IDE by 3rd parties is possible through VS Code extensions.

Could you also consider adding the user-facing instructions for installing extensions (e.g. which directory they have to be dropped into, depending on the platform) as part of this task?

Another question I had regarding the plugins API: can the plugin developers expect that the API (vscode-arduino-api) major version will change together with the IDE major version? In other words, can we assume that no breaking changes would be introduced in the API for the v2.x branch of the IDE?

kittaakos commented 1 year ago

Could you also consider adding the user-facing instructions for installing extensions

It is a good idea to clarify explicitly. However, installing any VS Code extension in IDE2 is the same procedure as adding a custom theme. It's already documented here.

depending on the platform

All extensions should go into the same folder, independently from the platform.

can the plugin developers expect that the API (vscode-arduino-api) major version will change together with the IDE major version?

No, this is very unlikely. I doubt Arduino IDE 3.x will come soon, but we might need to apply breaking changes in the API and increment the major version. Also, there is a plan to use vscode-arduino-api outside of IDE2. However, I will keep a migration guide if breaking changes are inevitable.

igrr commented 1 year ago

It's already documented here.

I have totally missed this page, sorry about that! Indeed, it already includes everything necessary. So simply updating the page to mention "extensions" along with "themes" is enough.

independently from the platform

I just meant the specific directories where the extensions should be placed on Windows/Linux/macOS — which is already described in the page you linked, so all good.

However, I will keep a migration guide if breaking changes are inevitable.

Thanks! That plus some method for runtime API version detection would also work fine. Essentially, as a plugin author I might want to support multiple IDE minor versions (with semver-incomplatible APIs) in a single plugin package release.