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:
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:
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.
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.
no matter how fast I disconnect-reconnect it just reattaches to ttyUSB0
[ 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
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.