Proposal: Have Web IDE also accept Arduino IDE Library Layout

So, as the Particle ecosystem has matured, it’s becoming easier to make a library that uses preprocessor instructions to determine if it’s on a Core, Photon, or Arduino. Would it be possible to have the Web IDE/Particle IDE also accept libraries in the folder layout that Arduino uses? Basic summary of that is code is in /src folder, examples are in /examples (for >1.5, for 1.0, code is in / and examples are in /examples)

+1 for this one, I already asked similar thing into sparkdev github
Ideally using Arduino IDE would be a great thing, ESP8266 can now be developed using Arduino IDE and it’s really cool to share same folder for libraries and just change the board type in IDE (ok I do not use IDE editor, but select board/compile/serial debug is fine from it)
Well, yes, less than spark dev to be honest, but I don’t care any settings, with Arduino 1.6.4 board manager it’s so easy to add new boards and use same thing to build on Arduino, ESP8266, and may be one day Particle :wink:

@Charly, with the DigiStump Oak announcement that they will be using the Particle Cloud instead of their own, the web IDE may very well move in that direction. This is so new that the Particle Team has not yet communicated their approach so stay tuned!

Yeah, this is a great news, because I’ve kickstarted some OAK also and sharing with same IDE as Particle is already a excellent point :wink:

I have to respectfully disagree with wanting the Particle within the Arduino IDE. Personally, I think the IDE sucks (code completion, along with automatic indenting while coding, would sure be nice), and while Atom still has some growing pains to work out, it seems like a lot better of a starting place. I mainly want more cross-compatibility so that we can push updates upstream to some of the more commonly used Arduino libraries, aka add Particle support, without breaking the existing code.

@mumblepins, one of @kennethlimcp’s has mentioned more than once that we should port the “base” Arduino libraries to the Core/Photon while keeping Arduino compatibility :smile:

1 Like

When I talk about Arduino, of course, not to edit source code file (I use sublime for that). I just would like things simple, put libraries in a folder, select the board on IDE and compile/upload from IDE. Each time I use Arduino library for Spark (I’m using spark dev, not the online IDE) it’s really a pain, I need to create subdir containing my libraries and copy files from my original Arduino Lib in my spark working dir. Then as I port the lib to Spark, I need to manage 2 version during development, Each mod I make from spark subfolder lib, I need to to copy to Arduino Lib to see if it always works on Arduino, and this is not super convenient, but I can live with this.
I played recently with Arduino ESP8266, same IDE, same lib folder, trust me, porting is much easier like this, but for sure, do not edit file with Arduino IDE :wink:

It is far from ideal, Charly - but I am able to share library source between my Arduino and Particle sketches using particle.include files. Using relative paths in the particle.include file, I reference the source in my Arduino directory structure.

I then compile and flash using the CLI.

Example output from compilation:

C:\Users\Angie\Documents\Particle\color_play>particle compile p . --saveTo firmware.bin

Compiling code for photon

attempting to compile firmware
pushing file: C:/Users/Angie/Documents/Particle/color_play/color_play.ino
pushing file: C:/Users/Angie/Documents/Particle/color_play/neopixel.cpp
pushing file: C:/Users/Angie/Documents/Particle/color_play/neopixel.h
pushing file: C:/Users/Angie/Documents/Arduino/libraries/Utils/Utils.cpp
pushing file: C:/Users/Angie/Documents/Arduino/libraries/Utils/Utils.h

Libraries v2 format will support arduino-style libraries.

@Charly @mumblepins I use the Eclipse Arduino Plugin with great success and the upcoming new version (codename Toddler) will leverage the Arduino IDE board manager and library manager but giving the whole Eclipse editing capabilities (code completion, live error checking, etc…)

I would love to see the libraries and the toolchain for :spark: Particle devices to be available in there…

I looked into this once. To do it (at least easily) you’d probably want to attempt something similar to what Teensyduino does, aka add more boards and whatnot onto the default Arduino IDE installation, as the Eclipse plugin makes use of the Arduino IDE. An easier to implement, harder to use version would be a similar setup to what’s been done with Netbeans, aka just set it up as a conventional C/C++ IDE with ARM compiler settings.

@mumblepins actually the new version of the Eclipse plugin doesn’t depend on the Arduino IDE any more :smile:. It’s still in beta and available only as nightly build, but it’s going to be Eclipse CPP + board manager + library manager.

There is a quite old thread regarding Eclipse on Windows setup (I did start it), but I wasn’t able to completely remove all the errors reported by the indexer… :unamused:

1 Like

Welp, that’s a rabbit hole I’m not going down any further. The way the Arduino IDE is setup (and also the Eclipse plugin, which uses the same sort of layout), seems like it would require quite a bit of rearranging of the firmware itself. See the arduino wiki page for more details. I think this just solidifies my dislike of the Arduino IDE. :angry: Sorry :confused:

1 Like

@mumblepins I also don’t like the Arduino IDE, no need to be sorry about that :smile: And, for what matters, I’m not strictly suggesting an integration with the Eclipse Arduino IDE, just throwing an idea in the bucket which might be explored, if it’s worth to.

We have the particle-cli, I’m just thinking about using the Arduino Eclipse Plugin as a way to call the particle-cli commands from there and expose an offline IDE