Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

how to get processing on Linux to communicate via rfcomm

$
0
0
Hi,

I'm looking for a way to get a Processing script to read and write on /dev/rfcomm port (bluetooth). It is simply a serial protocol but the following code fails:

  1. import processing.serial.*;
  2. Serial myPort; 
  3. void setup() {
  4.   println(Serial.list());  // this returns nothing
  5.   String portName = "/dev/rfcomm0";
  6.   myPort = new Serial(this, portName, 9600);  // this causes a null pointer exception
  7.   println(myPort);
  8.     myPort.write('x');
  9. }

I can connect to /dev/rfcomm0 via PuTTY and communicate with no problem...

Any ideas would be great!
Thanks,
Bob

Viewing all articles
Browse latest Browse all 1768

Trending Articles