I am trying to do serial communication between Ubuntu 12.04 and a JY-MCU bluetooth serial module connected to an Arduino.
I created this configuration in /etc/bluetooth/rfcomm.conf
rfcomm0 {
bind yes;
device 00:12:11:19:08:54
channel 1;
comment "Linvor Bluetooth Module";
}
I can use putty to communicate with the serial port / dev / rfcomm 0, and this works fine.
However, despite many attempts, I just donโt see how to create a serial port in processing that works in any way.
For instance:
println(Serial.list());
nothing output.
If I do:
String portName = "/dev/rfcomm0";
myPort = new Serial(this, portName, 9600);
println(myPort);
I see this on the monitor:
processing.serial.Serial@1712651
But if I then call:
myPort.write('9');
I get an exception:
java.lang.NullPointerException
at processing.serial.Serial.write(Serial.java:572)
...
I do not understand why this fails. I follow all the instructions from Tom Igoe's โMaking Things Talk,โ but that just doesn't work the way he says ...
Any help would be great!
Thank,
Bean