Go Down

Topic: Arduino Eclipse Plugin <Update> (Read 70 times) previous topic - next topic

eaman


eaman
Sorry but I had missed your post on the wiring.c.
I've checked the code and it seems that F_CPU has not been defined. This define is given with the compile command you can see that in the eclipse console.

Thanks for the note, I've added the F_CPU flag in my Makefile and I've made a step forward, but my compile still doesn't work. As it is an issue probably related to my OS (Debian Sid) and command line environment (not Eclipse) I started a new thread:
-  http://arduino.cc/forum/index.php/topic,84916.0.html

Thanks again for your advice.

Jantje

drapal
Thanks for your input. I made a new version 1.1.5 which I prereleased (I can't test it myself so I don't want to take the risk to release it)
You can get the prerelease version in eclipse with the standard update feature when you add following location to the update sites "http://www.baeyens.it/eclipse/prerelease"
I tested the library import. I have no problems on windows. I have updated the faq page with information on how to find out more about the problem http://www.baeyens.it/eclipse/Arduino%20eclipse%20plugin%20FAQ.htm#errorLog
I hope this can help you out.
Can you let me know whether this new version works fine o mac os?
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

drapal

Jantje,

The 1.1.5 version works great for me on the Mac - thanks so much.

After posting yesterday, I figured out my issue with the library import function - I was making it much more complicated than it really was.  It's working fine for me.

Thanks for the great tool!

aBoogieman

Hi Jantje,

Thank you for all your work on this great plugin! I installed the new version, configured (per your instructions on the first page of this thread), created a project, and it just worked. This is cool! 8)

It seems very complete to me, except that I don't know if there is a Serial Monitor window, or equivalent. I found the "Target Management" project. Is that the best option that you know of? (I'm sure I could just use Putty, or something, too. It would just be nice to have it within Eclipse.)

Oh, one quirk that I noticed. But I expect this is part of the AVR plugin. I can hit Ctrl-B to build the project, but then if I click the AVR icon to upload, sometimes it says, "No AVR project selected". That seems funny, because Ctrl-B knew which one was selected and it just built with the AVR toolchain. Right now, I'm not sure how to reproduce that, other than to say that it happens sometimes when I open a workspace and do the build/upload right away. Please let me know if you'd like more information and I'll document the steps required.

BTW, I plan to write a blog post about this, but first I want to make a little more progress on our current project. (Mjolnir - which is also open-source.) It will definitely be a favorable post!

Thanks again,
Leland...
Everything: http://sites.google.com/site/aboogieman/
Hackerspace: http://section9.choamco.com
Music: http://SoundCloud.com/aboogieman

Jantje

Drapal
Thanks for the feedback. I'm a bit busy now so I will not be able to release this soon. In the mean time I made some other changes so 1.1.5 will never become  real release. I'm still fighting this update site feature.

aBoogieman
I'm happy to hear you like the plugin.
I also noticed this strange "project not found" behavior. I happened to be looking at the code to find the project because I needed it to find the active project when doing an import. 1.1.6 will have the project to import to filled in automatically.
As to the serial monitor the home page eclipse.baeyens.it states
Quote
There is no serial monitor in this project. Use the IDE one or any one of your choice
. I use the IDE because I also get the com port from there. I'll have a look at the "Target Management" project though.

Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Jantje

Leland
I have been watching the differences in behavior of the build and the upload button.
When I can build but not upload I see the build builds all projects. In other words the build has no active project so he builds all projects. In this case the behavior seems correct because there is no single sketch to upload (the plugin can not upload all projects).
If you see incorrect behavior please try to reproduce and let me know how you would like it to work.
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

avenue33


The 1.1.5 version works great for me on the Mac - thanks so much.


The 1.1.5 worked fine for a plain sketch and a sketch with an external=user library.

However, when I tried to use the internal=supplied with Arduino library Wire.h, I had to import it manually digging into /Applications/Arduino.app/Contents/Resources/Java/libraries.

What is the parameter in charge of internal=supplied with Arduino libraries?

Jantje

Avenue33
I do not understand your remark.
First of all there is no code/configuration or whatever that makes a distinction between internal and external libraries.
The only thing is that when you import a library the default folder is pointing to the subfolder of the arduino IDE delivered libraries.
The import does actually very little. What it does is:

  • Create a link folder to the selected folder in the selected project (this is very similar to the eclipse default import)

  • Add the folder (and subfolders) to the include path

  • Add the folder and subfolders (excluding ?xamples) to the source path


You have to add <library>.h to the code yourself. (as is indicated in <your project name>.h)
There is no validation or whatever on the code. You could even import an existing IDE folder containing a sketch this way (you have to delete the 2 created files in the project to avoid compile conflict)
I just tried the wire library and it works fine on my system. To be able to use the functionality you need to include wire.h as you can see below
Code: [Select]
// Only modify this file to include
// - function definitions (prototypes)
// - include files
// - extern variable definitions
// In the appropriate section

#ifndef test_H_
#define test_H_
#include "WProgram.h"
//add your includes for the project test here
#include "wire.h"

//end of add your includes here
#ifdef __cplusplus
extern "C" {
#endif
void loop();
void setup();
#ifdef __cplusplus
} // extern "C"
#endif

//add your function definitions for the project test here




//Do not add code below this line
#endif /* test_H_ */


Please be aware that eclipse is a complex environment and the eclipse plugin in contrast to the Arduino IDE assumes C C++ knowledge. There is a section in the faq that deals with this http://www.baeyens.it/eclipse/Arduino%20eclipse%20plugin%20FAQ.htm#benefitIDE

If you think there is a genuine problem; please be more precise on what the problem is. What is your console output? If a dialog box appears; please add a screenshot. If you are not precise in the problem description I can not help you out.
Best regards
Jantje

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Jantje

Avenue33
There is a problem related to the eclipse plugin and the wire library in Arduino. I created a post that explains the problem and proposes a fix here http://arduino.cc/forum/index.php/topic,86344.0.html
You can apply the fix in your environment.

Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

avenue33

Jantje,

Thank you for your answers.


About Importing libraries -- Menu File > Import, Select Arduino > Import an Arduino library in the current project,

First time, the window rightly points to /Applications/Arduino.app/Contents/Resources/Java/libraries --called internal libraries

Now, I go to my own libraries at /Users/avenue33/Documents/Sketchbook/Libraries --called external libraries or user libraries-- and take the library I'm looking for.

Next time, if I want to import the Wire library inside /Applications/Arduino.app/Contents/Resources/Java/libraries, I can't go there because:
  • Wire is inside the application Arduino.app

  • Mac OS X doesn't consider Arduino.app as a folder but as an application

  • Mac OS X doesn't allow to go inside an application --except with the file browser Finder through the contextual menu Show bundle.


This is purely Mac OS X related.
Ouvrir = Open launches the app. Afficher le contenu du paquet = Show bundle gives that:

Jantje

Avenue33
I understand the problem but I cant explain it. (I'm not related to mac  8) )
As you can see from the code below I always go back to the "internal libraries". controlLibraryPath.getText() returns the content of the dialog box and that should be empty. Therefore the path should always be set to the "internal libraries".
If there are mac experts who know how to solve this issue, please let me know.
Best regards
Jantje


Code: [Select]
@Override
public void widgetSelected(SelectionEvent event) {
final Shell shell = new Shell();
DirectoryDialog theDialog = new DirectoryDialog(shell);
if ((controlLibraryPath.getText()==null) | (controlLibraryPath.getText()==""))
{
theDialog.setFilterPath(ArduinoInstancePreferences.getArduinoPath().append( ArduinoConst.LIBRARY_PATH_SUFFIX).toString());
}
else
{
theDialog.setFilterPath(controlLibraryPath.getText());
}

String Path = theDialog.open();
if (Path!=null)
{
controlLibraryPath.setText(Path);
updateWidgetEnablements();
}
}
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

mo-seph

Hi,

Just wanted to confirm that this works on OSX! Thanks for the great work - I've been hoping someone will do this for ages!

I'd like to check whether I've understood compatibility with the Arduino editor correctly. It seems like to start working with an Arduino project which has multiple files, you need to:
* add all the .pde files to your project
* import libraries and add includes to $project.h
* in $project.h declare any global functions and externs for all global variables, and copy all #defines
* add #include "$project.h" to all .pde files

The last step means that it's not directly compatible with the Arduino editor any more, as there won't be a $project.h. Also, in order to keep the main file compatible, #defines need to be both in $project.pde and $project.h (if they are used in other files). I guess that they can get wrapped in an #ifdef

garretto

I'm trying to create a new project with a board: Arduino Mega (ATmega1280)

When I try to create the new project, I get an error:
Failed to create project test1
Path variable name cannot contain character: ).


Anyway I can modify the name of the board to take out the parenthesis?

Jantje

Garetto
The ( problem in the board name should be fixed in the latest version 1.1.6 released earlier this week.

mo-seph
read this article http://arduino.cc/en/Hacking/BuildProcess it will give you a better understanding on the compatibility.

The first thing to realize is that we talk about code compatibility. This means that both the IDE and Eclipse can compile the same code.
The second thing to ask is do you want
compatibility from Arduino IDE to eclipse.
or Eclipse to arduino IDE
or Arduino IDE from and to Eclipse (both directions)

Because the Arduino IDE provides functionality at the level of code preprocessing it is very hard to guaranteed 100% compatibility from the Arduino IDE to Eclipse. It is not my intention to add this preprocessing functionality to the plugin. (However if someone else wants to do it I don't care)
Because of this: when I talk about compatibility I talk about compatibility from Eclipse to Arduino only.
Because Eclipse has "less capabilities" code from Eclipse compiles as such in the arduino IDE.
BUT
Shakespeare already stated a lang time ago "There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy". 8)
So there is more than code only. There are also libraries, include paths and library paths.
When you import an Arduino library in Eclipse with the plugin the include path and library paths are changed for you.
When you compile Eclipse code in the Arduino IDE you need to provide this info to the Arduino IDE.
Luckily the Arduino IDE provides "more source functionality". Therefore a simple include of the header file of the library in the pde/ino file is enough to overcome this problem. It has to be the pde/ino file due to a short coming in the Arduino IDE.
Because this "extra" include (you already need to include the library header to use the functionality) is harmless in the Eclipse IDE you can have 100% compatible code.
You can have the IDE and eclipse "point" to the same folder so you do not have to move code around.

I hope this makes it clearer
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

julius59

Hi,

I get an error too regarding the name in 1.1.6 :

Naming my project "test_arduino1.0", while importing an arduino lib :
"Failed to import library
Path variable name cannot contain character: .. "

Otherwise, good job !

Go Up