Go Down

Topic: Serial stops returning data. java.io.IOException: Device not configured in write (Read 5625 times) previous topic - next topic


Now the Mega and the Uno have different schemes for creating the "serial" connection to the PC through the USB connection,  and this hardware
difference is something I don't really understand or care about but it does have some implications.

If there is some aspect of that difference which is causing some low-level nastiness in how the serial communication is being handled by java at the PC end,    then that is really a nasty problem which is not going to be easy to fix.   And if you do figure it out,  you'll be acclaimed.

Had another look at that writeArray() stuff and it is kind of low-level and obscure.

Here's another bad idea.   Instead of using the USB interface which is on the Mega,   try using a USB-to-serial interface cable and try connecting it directly to the serial connection which is on pins 14-19 on the Mega.   And even better,  use one of the Serial2, Serial3 etc on the Mega chip which has nothing to do with the on-board USB converter chip.   

See if you still get the problem.

And one final bad suggestion.   See if you can pinpoint if it crashes,  when you are trying to send data to , or from,  the PC.   Try slowing down your messaging process,  so you can observe when it happens.


Good (though stomach turning) advice. Here is the (overdue) error message in its entirety:

java.io.IOException: Device not configured in writeArray
   at gnu.io.RXTXPort.writeArray(Native Method)
   at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1171)
   at processing.serial.Serial.write(Serial.java:521)
   at processing.serial.Serial.write(Serial.java:544)
   at this_time_we_feel.sendCoordinates(this_time_we_feel.java:210)
   at this_time_we_feel.draw(this_time_we_feel.java:203)
   at processing.core.PApplet.handleDraw(PApplet.java:1631)
   at processing.core.PApplet.run(PApplet.java:1530)
   at java.lang.Thread.run(Thread.java:637)


I've been able to get rid of this issue by switching to an Uno and using a Mac with OSX 10.8.2. Was using OSX 10.6.8. Anywho. No more IOException.

Go Up