Pages: [1]   Go Down
Author Topic: Arduino + processing on Ubuntu - no serial list  (Read 1524 times)
0 Members and 1 Guest are viewing this topic.
Christchurch, NZ
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a simple switch circuit on the Arduino and the following code:
Code:
int switchPin = 4;                       // Switch connected to pin 4

void setup() {
  pinMode(switchPin, INPUT);             // Set pin 4 as an input
  Serial.begin(9600);                    // Start serial communication at 9600 bps
}

void loop() {
  if (digitalRead(switchPin) == HIGH) {  // If switch is ON,
    Serial.println(1);               // send 1 to Processing
  } else {                               // If the switch is not ON,
    Serial.println(0);               // send 0 to Processing
  }
  delay(100);                            // Wait 100 milliseconds
}

On the serial monitor I see rows of 1 until I hit the switch when I get 0's.

In processing my code is:
Code:
import processing.serial.*;

import processing.serial.*;
Serial myport; // Create object from Serial class

void setup() {
println("Here is a list of serial ports:");
println(Serial.list());
println("List finished, opening port");
myport = new Serial(this, "ttyACM0", 9600);
myport.bufferUntil('\n');
}
void draw()
{
}

void serialEvent(Serial myport)
{
String inString = myport.readStringUntil( '\n' );

println(inString);
}

and what I see is:
Quote
Here is a list of serial ports:
WARNING:  RXTX Version mismatch
   Jar version = RXTX-2.2pre1
   native lib Version = RXTX-2.2pre2
List finished, opening port

Evidently, when I invoke Serial.list() the warning is printed and it returns nothing.
Then, when I hardwire in the port as ttyACM0, I still get nothing.

What is wrong?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which Arduino do you have? What version of Processing?
Logged

Christchurch, NZ
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino 1.0.1
Processing 1.5.1
Ubuntu 10.04
Logged

Christchurch, NZ
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, and Arduino Uno
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You have an Arduino 1.0.1? Is that like a UNO+ or something?
Logged

Christchurch, NZ
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You have an Arduino 1.0.1? Is that like a UNO+ or something?

No, that's the software version.

« Last Edit: May 30, 2012, 09:47:37 pm by TideMan » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Simplifying Technology For Life
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I had ran into the same issue a while back and i upgraded the RXTX library and the JDK on the machine which fixed things for me.

My initial indicators came from processing forum at
http://forum.processing.org/topic/rxtx-version-mismatch

Thanks,
Ram
Logged

Technical Evangelist/Writer,
Tenet Technetronics,
Bangalore, India
 

Christchurch, NZ
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I finally solved this problem by taking some ideas from this thread at processing:
http://forum.processing.org/topic/rxtx-version-mismatch-12-2-2012

The main point is to replace some of the files shipped with processing with the files that are shipped with Arduino.

Step 1.  In Places on Ubuntu, navigate to:
                 processing-1.5.1/modes/java/libraries/serial/library
            and rename RXTXcomm.jar to RXTXcomm.jar.old or similar
Step 1a.  Go to /linux32 and rename librxtxSerial.so to librxtxSerial.so.old
Step 1b.  Go to /linux64 and rename librxtxSerial64.so to librxtxSerial64.so.old

Step 2.  Open another Places and navigate to:
             arduino-1.0.1/lib

Step 3.   Copy Arduino's
                     RXTXcomm.jar to processing-1.5.1/modes/java/libraries/serial/library/
                     librxtxSerial.so to processing-1.5.1/modes/java/libraries/serial/library/linux32/
                     librxtxSerial64.so to processing-1.5.1/modes/java/libraries/serial/library/linux64/

This fixed it for me using:
Ubuntu 10.04
arduino-1.0.1
processing-1.5.1
Logged

Pages: [1]   Go Up
Jump to: