Ubuntu 12.04 と Arduino に接続された JY-MCU Bluetooth シリアル モジュールの間でシリアル通信を実行しようとしています。
この構成を /etc/bluetooth/rfcomm.conf に作成しました
rfcomm0 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device 00:12:11:19:08:54
# # RFCOMM channel for the connection
channel 1;
# # Description of the connection
comment "Linvor Bluetooth Module";
}
パテを使用して /dev/rfcomm0 シリアル ポートと通信でき、これは完全に機能します。
ただし、多くの試みにもかかわらず、Processing でシリアル ポートを作成する方法がまったくわかりません。
例えば :
println(Serial.list());
何も印刷しません。
私が実行した場合:
String portName = "/dev/rfcomm0";
myPort = new Serial(this, portName, 9600);
println(myPort);
モニターにこれが表示されます:
processing.serial.Serial@1712651
しかし、次に電話すると:
myPort.write('9');
例外があります:
java.lang.NullPointerException
at processing.serial.Serial.write(Serial.java:572)
...
なぜこれが失敗するのか理解できません。Tom Igoe の「Making Things Talk」のすべての指示に従っていますが、これは彼の言うようには機能しません...
どんな助けでも素晴らしいでしょう!
ありがとう、
ボブ