-1

I'm currently developing a programm with Java to interact with an Arduino module. Now in Windows, it's running pretty well so far (I receive what I expect; I can work with the data), but in Linux (Ubuntu in my case); it's like the opposite. I installed Arduino and rxtx-java packages.

When I tried to use the Arduino program to connect to the Arduino board, I had to set a softlink on the ACM module to some serial or USB module. For example,

ln -s /dev/ttyACM0 /dev/ttyS99

Otherwise it won't even show up in the list in the Arduino program. So what I did then was starting the serial monitor tool (Ctrl + Shift + M) and sent it my start sequence waiting for an answer. It worked without a problem there (it was binary data so I couldn't verify if it was correct, but I got an answer at least).

The next thing I did was trying to do the same with my program, so the Arduino was connected to the PC, the softlink was set correctly, the device listed along with two normal COM-ports I have in my PC in my program, and I tried to connect, but it didn't work.

No error, no nothing, simply no answer of the board. After I waited a couple of minutes, it still didn't do anything, so I disconnected it from the PC, and then I got an array of zero-bytes as the answer.

What could cause this kind of problems and how would I fix it?

Thanks for your help Volker

PS: the program is a jar file with all libraries/dependencies included

EDIT: Hardware is an Arduino UNO Board Model R3,and on windows i'm using Arduino 1.0 to program it

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Volker Mauel
  • 514
  • 3
  • 21

2 Answers2

0

If you installed from the Ubuntu packages you're bound to have problems. I tried this first myself only to find that there are serious issues. I would recommend downloading the most recent version of the IDE arduino-1.0-src.tar.gz.

You'll notice it's the source, I think you'll like it better that way. Or you can get the repository from Git, you'll find that information plus how to build the IDE in Building Arduino, Steps for First Time Setup. Besides the fact that the Ubuntu distribution version is buggy, it's also like old, big time.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
macduff
  • 4,655
  • 18
  • 29
0

Your symlink to /dev/ttyACM0 is double dubious:

  • Disconnecting+reconnecting or powering off+on might change the number of the dev.
  • ttyACM usually refers to modems, not to plain USB-serial converters like that used by Arduino (at least those with the FT232 chip). I would expect something like ttyUSB0. For those you also would not need a symlink.
A.H.
  • 63,967
  • 15
  • 92
  • 126
  • ttyACMXX is my Arduino,if i disconnect the board, it vanishes and as soon as i reconnect the board,it will be available again,so it is the arduino for sure – Volker Mauel Feb 27 '12 at 06:55
  • 1
    @VolkerMauel: The different naming is "interesting". Please add some info to your question (i.e. not here in the comments): First: What Arduino variant and version are you using? Please provide a link to that relevant page with photos. Second: What SW version of the IDE are you using? – A.H. Feb 27 '12 at 08:17