Hey,
I would like to update the Arduino software using the USB Interface with Java.
I look for code examples in Java using the RXTX library.
Has anybody an idea where i can find some ?
thx ExLoop
Hey,
I would like to update the Arduino software using the USB Interface with Java.
I look for code examples in Java using the RXTX library.
Has anybody an idea where i can find some ?
thx ExLoop
You need to emulate AVRDude.
You can call the Arduino IDE from the command line and, presumably, could call it from Java. This demo uses a little bit of Python to enable you to compile and upload from Geany.
If you prefer a complete DIY (hair-shirt) solution you could write a Java program to do what the Arduino IDE does. If you switch on VERBOSE mode it will list all the commands. Note that the IDE is itself written in Java.
You might wish to consider using JSSC which is newer than RXTX.
...R
thx very much. This is what I was looking for, but the Arduino IDE needs a graphical Environment
I will use it with a raspberry pi and look for a command line based solution.
Do you have any ideas where to find some ?
ExLoop
ExLoop:
thx very much. This is what I was looking for,...snip...
Do you have any ideas where to find some ?
At first you said it was "what I was looking for"
Then you say "where to find some"
I'm confused.
Have you looked at the demo I linked to ?
...R
Yes i can understand the confusion
The funcionality is exacly what i was looking for but i need it without
a graphical Interface. The command window needs a GUI and this is too ressource consuming.
Thank you for the demo link. I look to it. But with it i have the GUI solution.
Now i look for a tool with the same funcionalaty as in your demo, but without the need of a GUI
ExLoop
There is no GUI in the link I gave you - unless you consider the Geany editor to be a GUI.
I think you should be able to do with Java what my example does with Python. It opens a file, looks for certain stuff in it and then calls the Arduino command line.
...R
The Arduino IDE is on my Raspberry Pi correctly configured.
when I try this command:
arduino --upload /path/to/my/ino/file.ino
I get this Exception:
Exception in thread "main" Java.long.ExceptionInInitializerError
at processing.app.Base.main(Base.java:113)
Caused by: Java.awt.HeadlessException:
No X11 Display variable was set, but this program performed on Operation which requires it.
at sun.awt.HeadlessException.getMenuShortcutKeyMask(HeadlessToolkit.java:234)
I start the GUI (X-Server) and the Exception doesn't appear. So the IDE still needs a GUI in the Commandline mode.
Do you have a solution for this problem ? I have no idea.
ExLoop
ExLoop:
Do you have a solution for this problem ? I have no idea.
Sorry. Neither do I. (What's wrong with starting X-server?)
If you insist on not using X-server I guess you need to figure out the calls to AVRDUDE without using the Arduino IDE as I mentioned in Reply #2.
...R
Thank you very much for your help.
I got this via AVRDude an ProcessBuilder
Thank you !
ExLoop