I have an Raspberry pi 3 and i am trying to read, and eventually to write, from an RoMeo BLE through Bluetooth. The arduino ide identifies the device in port /dev/ttyS0 and when i try to access Serial Monitor i get either nothing or the pi crashes. Also when i tried to read from Mono Develop i got the following error
And again the Raspberry crashes.Unhandled Exception:
System.IO.IOException: No such file or directory
at System.IO.Ports.SerialPortStream.ThrowIOException () [0x00000] in <filename unknown>:0
at System.IO.Ports.SerialPortStream..ctor (System.String portName, Int32 baudRate, Int32 dataBits, Parity parity, StopBits stopBits, Boolean dtrEnable, Boolean rtsEnable, Handshake handshake, Int32 readTimeout, Int32 writeTimeout, Int32 readBufferSize, Int32 writeBufferSize) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream:.ctor (string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
at System.IO.Ports.SerialPort.Open () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort:Open ()
at SerialTest.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: No such file or directory
at System.IO.Ports.SerialPortStream.ThrowIOException () [0x00000] in <filename unknown>:0
at System.IO.Ports.SerialPortStream..ctor (System.String portName, Int32 baudRate, Int32 dataBits, Parity parity, StopBits stopBits, Boolean dtrEnable, Boolean rtsEnable, Handshake handshake, Int32 readTimeout, Int32 writeTimeout, Int32 readBufferSize, Int32 writeBufferSize) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPortStream:.ctor (string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
at System.IO.Ports.SerialPort.Open () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort:Open ()
at SerialTest.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
I admit i'm just starting to program with Raspberry and in general use Linux for my programming so i would appreciate any help.
My mono develop code
Sorry for the long post.using System;
using System.IO.Ports;
namespace SerialTest
{
class MainClass
{
public static void Main (string[] args)
{
SerialPort sp = new SerialPort ("/dev/ttyS0", 9600, Parity.None, 8, StopBits.One);
sp.Open ();
do {
string result = sp.ReadLine ();
Console.WriteLine (result);
} while (true);
}
}
}
Edit: The port is /dev/ttyS0.