SerialError.Frame

Hi

I’m trying to connect my Fez Panda II with my Sm5100b gsm unit. But i just cant get the connection going cause i keep getting SerialError.Frame errors. Here are some snippets of what i’m doing. And the error keeps occurring on the line following the write command.

SerialPort gsmSerailPort = new SerialPort(Serial.COM1, 9600, Parity.None, 8, StopBits.One);
gsmSerailPort.Handshake = Handshake.None;
gsmSerailPort.Open();

byte[] OutBuffer = System.Text.Encoding.UTF8.GetBytes(cmd + endline);
gsmSerailPort.Write(OutBuffer, 0, OutBuffer.Length);

The Sm5100b does work at 9600 as i have tested it on my Arduino Mega successfully.

Any help would be greatly appreciated.
Winston

Are you sure there is no RS232 on one side but not the other?
Did you check your power source?

Hi Gus.

Uhmmm what go you mean RS232 on one side but not the other? And then how would i check the power source?

I think Gus means an RS232 level convertor.

Is this what you are using? http://www.sparkfun.com/products/9607

Connect a power source to your FEZ or use a powered USB hub.

Yes, thats the exact one.

Ok, i’m sorry that i have to ask so many questions but i’m really just a software developer. The electronics are new to me. How should i connect the external power source. How many volts and to which pins? Could i just connect the fez board via usb and then also plug a 9V battery on the power socket?

You are fine, do not worry about questions :slight_smile: If you just told us what you using then things would have been much easier.

Do you have a 9V power pack? plug it into your FEZ. Yes you can do that while USB is connected.

I know you are software guy but for other reading this. Look here and you will see that the shield depends on the Vin power so power pack is required (USB power doesn’t make it into the shield) http://www.sparkfun.com/datasheets/DevTools/Arduino/cellular%20shield-v12.pdf

Ok I connected a 9V 1000mA adapter and it seems that i’m getting DataReceived events and a lot of Frame errors. When i read the data from the serial port as follows, the buffer is filled with 0’s and NewText is “”?

    void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        byte[] inBuffer = new byte[serialPort.BytesToRead];
        serialPort.Read(inBuffer, 0, inBuffer.Length);
        String NewText = new String(System.Text.Encoding.UTF8.GetChars(inBuffer));
        ......

:’(

Looks like a wrong connection or baudrate issue. Maybe the unit uses autobauding and you first need to send some predefined data so it can sense it. 9600 seems slow for a gsm unit. I would have guessed 115200.

Anyway, can you point us to a datasheet that is not in chinese and tell us exactly how you connected each pin? (And/Or close-up picture of your setup)

Thank you for your reply. Yes i could give you the details. I’m using the SM5100B GSM Shield from Sparkfun [url]http://www.sparkfun.com/products/9607[/url] . That page contains all the details (AT commands etc) on the device. I just plugged it onto the Fez as they are pin compatible. For the GSM Driver i used this code [url]http://code.tinyclr.com/project/278/gsm-driver/[/url] , just changed the AT commands a bit for the SM5100B. I could also just say that i have used this same SM5100B on my Arduino Mega and it was working fine on the 9600 baud rate. Except on the Arduino i did not have to specify the parity, stop bits, data bits or handshaking. But i found that the default is 8-N-1 and no handshake. So that should not be a problem.

Hallo?

http://www.sparkfun.com/datasheets/DevTools/Arduino/cellular%20shield-v12.pdf

There are jumpers on the board to select what pins are used for UART. Make sure it is Di0 and Di1

Yes, it works as it is on the default setting. I have tested this same gsm unit on my Arduino. And it is working as it is. Just cant get it going on the Fez.

I am not sure then. I personally have tried one before and it worked so I know the shield works on FEZ. That was too long ago and I no longer have the code

I’m doubting everything that i’ve done so far, so could you just confirm this for me.

The GSM and Fez pins are aligned as follows.

GSM Rx = Fez COM1 IN
GSM Tx = Fex COM1 OUT

Does COM1 IN not mean Rx and COM1 OUT not Tx? Which means that the connection is reversed?

It just does not look right to me?

Remove the shield and place a wire from Di0 to Di1 (loop-back) and see if you receive what you send.

I would connect GSM RX to FEZ COM1 OUT and GSM TX to FEZ COM1 IN

Hope you didn’t blew up the outputs.

I have the same problem,
I bought the sim300C and with the computer I can communicate but when I want to connect on my Fez domino I can’t recived any message.

This is my board: http://foto.freehostz.info/image/grande/8e34809bee03a464341f76451f43018b.jpg.jpeg ( I removed the com plug and I solder some wires )

This is the connection with COM CABLE on my computer http://foto.freehostz.info/image/grande/f319f1b053be45d2a3a831d5bd59635a.jpg.jpeg only the TX, RX and Ground and that works!

This is the result on my terminal: http://foto.freehostz.info/image/grande/a2af131e70e267eea68b2b0af9ef4a5e.jpg.jpeg

This is the connection on my fez domino, RX => COM1 TX , TX => COM1 RX http://foto.freehostz.info/image/grande/f9f47895641558578cfd8de5671ed1b8.jpg.jpeg

I have a camera with connection RX and TX and that work on COM1 but my SIM300C doesn’t works!

WHY??!??!? I can’t understand where is my problem :S

You are connecting RS232 levels (±12V) to your FEZ. I am afraid you may have damaged your FEZ but I hope not.

I don’t think so because with LinkSprite JPEG Color Camera I can take the pic