Hello,
I have communicated with devices in the past via .net and serial port communication, I'm working on communicating with this GRPS shield and trying to follow the instructions at http://www.seeedstud...re_installation I'm not having any luck communicating with the shield over serial. The device is powered, and per the instructions is connecting to the GSM network. I can control the device via pin 9 and power on and off in my application.
When I try to use the driver at http://netduino2seed...ew/19515#311098 and when I try to simply communicate to get an "OK" back from the shield i'm not having any luck. Based on the information in the shields WIKI I would expect to get an "OK" back based on my AT Command of "AT+CMGF=1r"
My jumpers are like the below here.
To simplify things, I ended up just trying to write it myself below(source code below), does anyone have ideas?
public static string output = ""; static SerialPort serialPort; public static void Main() { // write your code here string portName = SerialPorts.COM1; int baudRate = 19200; Parity parity = Parity.Odd; int dataBits = 8; StopBits stopBits = StopBits.One; serialPort = new SerialPort(portName, baudRate, parity, dataBits, stopBits); serialPort.Open(); System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); byte[] bytesToSend = encoder.GetBytes("AT+CMGF=1r"); serialPort.Write(bytesToSend, 0, bytesToSend.Length); serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived); while (true) { Thread.Sleep(100); // wait a bit so we get a few bytes at a time... } } static void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { byte[] bufferData = new byte[20]; serialPort.Read(bufferData, 0, 20); char[] charArray = System.Text.UTF8Encoding.UTF8.GetChars(bufferData); for (int i = 0; i < charArray.Length - 1; i++) { if (charArray[i].ToString() == "r") { //output += charArray[i]; Debug.Print(output); output = ""; } else { output += charArray[i]; } } }