Skip to content
Advertisement

Serial Communication with Arduino using Java RXTX in linux

I am trying to connect Arduino using java program and it gives out error when sending data from the pc to arduino from a serial-connection and the program crashes

JavaScript

And these are my initialization methods and send methods for serial

Initialization of Serial Connection

JavaScript

Sending data via Serial Connection

JavaScript

Serial connection close method

JavaScript

Advertisement

Answer

Well after messing around found a solution,It seems to be

This right in here written for Raspberry pi caused it… Commenting it out solved problem…

JavaScript

Still don’t know what exactly the problem is…

Advertisement