Go Down

Topic: Arduino Serial Monitor (Ubuntu 10.04 64bit) (Read 13203 times) previous topic - next topic

IAmCorbin

Hello,

I am just getting started with Arduino development and am having a difficult time getting it  to interface with Java. I am using Eclipse and trying to read serial data. I just noticed that I am getting the same error in Eclipse that I am getting in arduino IDE

I had been using the serial monitor in the IDE without a problem, that is up until I executed this command:
Code: [Select]
stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts

as directed at:  arduino.cc/playground/Interfacing/LinuxTTY

and was then able to read the serial output of the arduino via the terminal with: tail -f /dev/ttyUSB0
but at this point I noticed that I was no longer able to use the serial monitor in the IDE. This whole time I had been using arduino-0018 installed via the ppa. I tried downloading arduino-0021 and am getting the same errors, I tried the 64 bit and the 32 bit and also tried copying RXTXcomm.jar and librxtxSerial.so from rxtx2.2pre2 release into arduino-00xx/lib/

Here is what I'm stuck on:
Code: [Select]
corbin@skillTop:/usr/local/share/arduino-0021$ ./arduino
Experimental:  JNI_OnLoad called.
WARNING:  RXTX Version mismatch
     Jar version = RXTX-2.2pre1
     native lib Version = RXTX-2.1-7
RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyUSB0
Binary sketch size: 2476 bytes (of a 30720 byte maximum)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f77df047462, pid=2020, tid=140152811636496
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK 64-Bit Server VM (19.0-b09 mixed mode linux-amd64 )
# Derivative: IcedTea6 1.9.2
# Distribution: Ubuntu 10.04.1 LTS, package 6b20-1.9.2-0ubuntu1~10.04.1
# Problematic frame:
# C  [librxtxSerial.so+0x6462]  read_byte_array+0x52
#
# An error report file with more information is saved as:
# /usr/local/share/arduino-0021/hs_err_pid2020.log
#

The IDE crashes at this point right as I press the serial monitor button.

anyone have any ideas?

mrtaylor

#1
Jan 23, 2011, 10:47 am Last Edit: Jan 23, 2011, 10:54 am by mrtaylor Reason: 1
Quote
I had been using the serial monitor in the IDE without a problem, that is up until I executed this command:

When I unplug the usb cable and then plug it back in my arduino switches to a different port.

Do a stty -F /dev/ttyUSB0 -a (change to correct port).  Here is a copy of what mine looks like.

Quote
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke



IAmCorbin

#2
Jan 23, 2011, 06:37 pm Last Edit: Jan 23, 2011, 06:38 pm by IAmCorbin Reason: 1
My Arduino always connects to /dev/ttyUSB0

Here is what I get:
Code: [Select]
corbin@skillTop:~$ stty -F /dev/ttyUSB0 -a
speed 57600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^A; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig -icanon iexten -echo -echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke


could the 57600 baud be what is throwing me off, since in the code I am connected to serial at 9600?

pluggy

If you unplug and reconnect quickly it will tend to allocate it a different port number.  Leaving it for a minute or two generally means it will reconnect to the same port.  
http://pluggy.is-a-geek.com/index.html

IAmCorbin

no matter how fast I disconnect-reconnect it just reattaches to ttyUSB0
Code: [Select]
[ 2412.040322] ftdi_sio 7-1:1.0: device disconnected
[ 2413.070028] usb 7-1: new full speed USB device using uhci_hcd and address 9
[ 2413.276512] usb 7-1: configuration #1 chosen from 1 choice
[ 2413.284433] ftdi_sio 7-1:1.0: FTDI USB Serial Device converter detected
[ 2413.284464] usb 7-1: Detected FT232RL
[ 2413.284467] usb 7-1: Number of endpoints 2
[ 2413.284470] usb 7-1: Endpoint 1 MaxPacketSize 64
[ 2413.284472] usb 7-1: Endpoint 2 MaxPacketSize 64
[ 2413.284474] usb 7-1: Setting MaxPacketSize 64
[ 2413.286120] usb 7-1: FTDI USB Serial Device converter now attached to ttyUSB0


mrtaylor

Quote
speed 57600 baud;

It would not hurt to try. You can always change it back.

mrtaylor

Quote
no matter how fast I disconnect-reconnect it just reattaches to ttyUSB0

Your right about the port not switching, mine does not switch unless the first port is in use. ie I open the serial monitor and then do the unplug and re-plug thing.

mrtaylor

I just did a stty -F /dev/ttyUSB0 57600
and a stty -F /dev/ttyUSB0 -a

the result:
speed 57600 baud; rows 0; columns 0; line = 0;

Then I upload a sketch with a:
Serial.begin(9600);

did another stty -F /dev/ttyUSB0 -a
the result
speed 9600 baud; rows 0; columns 0; line = 0;

so i believe changing the baud rate is not going to help.  Time to look at the other configuration options that you changed in your first post.



mrtaylor

my stty option -noflsh is different from your first post

mrtaylor

#9
Jan 24, 2011, 08:42 am Last Edit: Jan 24, 2011, 09:11 am by mrtaylor Reason: 1
[edit]try running arduino as root[/edit]

if that does not work:
Let try do something really simple first upload the code:

Code: [Select]

void setup() {
   Serial.begin(9600);
}

void loop() {
   Serial.println("looping");
}


second: without unpluging the usb cable, execute the command:
screen /dev/ttyUSB0 9600

third: let us know what happens


Go Up