I have developed a simple application (with VS2013) to send and received text messages via a GSM modem in C# using GSM Communication Library (GSMComm). Now, I want to use it on my “raspberry pi” with the help of mono. Everything is fine, but the big problem is, I have no idea what should I use instead of (in my case) COM3 to create a gsm connection (see the code below), as I know the name of my gsm-modem’s port in Linux is “ttyUSB0”.
GsmCommMain gsmPort = null;
…
gsmPort = new GsmCommMain(“COM3”, 9600 /*baudRate*/, 300 /*timeout*/);
Any idea?!
It appears the GSMPhone
class is using a std SerialPort
class, so:
gsmPort = new GsmCommMain(“/dev/ttyUSB0”, 9600 /*baudRate*/, 300 /*timeout*/);
Ref: (old, but still valid reference) : http://www.mono-project.com/archived/howtosystemioports/
1) Assuming you have gsm-utils installed (
apt-get install gsm-utils
2) Assuming you have the proper perms to access:
sudo chmod 666 /dev/ttyUSB0
3) Assuming you can connect to that dev via a serial program, something like:
moserial
, zterm
, etc...
4) Try using statserial
to verify that dev device:
statserial /dev/ttyUSB0