(GSM Shield) Is it possible to use AT command without using Serial.Print/ln()?

For sending sms.
As the title said is it possible??
If it is can u give me example how to do it?
Thanks in advance.

The obvious question is why do you want to do this ? Have you got a problem with Serial.print() and Serial.println() ?

Yes.
I am interfacing my project with vb.net so I need to send data to vb.net catch that data to do something using If Else statement.

My example code:

Public Class Form2
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        SerialPort1.Open()
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        If label1.ForeColor = Color.Black Then
            label1.ForeColor = Color.DimGray
        ElseIf label1.ForeColor = Color.DimGray Then
            label1.ForeColor = Color.Red
        ElseIf label1.ForeColor = Color.Red Then
            label1.ForeColor = Color.Gray
        ElseIf label1.ForeColor = Color.Gray Then
            label1.ForeColor = Color.Black

        End If

    End Sub
    Dim temblin As String
    Private Sub Serial_Port1_Datareceived(ByVal sender As Object, ByVal e As EventArgs) Handles SerialPort1.DataReceived
        temblin = SerialPort1.ReadLine
        Me.Invoke(New EventHandler(AddressOf DoUpdate))
    End Sub

    Public Sub DoUpdate()

        If temblin = "a" Then
            label1.Text = "ALERT LEVEL!!!"
            Timer1.Start()
            Label2.Text = " Level 1 = Alert Level, Monitor the River for the possible Flood in Barangay."
            Btnimage1.BackColor = Color.GreenYellow
            Picmyimage.Image = My.Resources.nangka_plain_1
        ElseIf temblin = "b" Then
            label1.Text = "WARNING LEVEL!!!"
            Timer1.Start()
            Btnimage2.BackColor = Color.RoyalBlue
            Label2.Text = " Level 2 = Warning Level, Anouncing a Warning and Evacuation to all residence of Barangay."
            Picmyimage.Image = My.Resources.nangka_plain_2
        ElseIf temblin = "c" Then
            label1.Text = "CRITICAL LEVEL!!!"
            Timer1.Start()
            Btnimage3.BackColor = Color.Red
            Label2.Text = " Level 3 = Critical Level, Forced Evacuation of all Residence in Barangay will be implemented."
            Picmyimage.Image = My.Resources.nangka_plain_3
        End If

    End Sub

End Class

If your talking about VB then your in the wrong place!

Mark

But my main point is AT command.
I just add my vb code to make my question more understandable.

If your GSM is connected via the USB than to use Serial. End of!

Mark

UKHeliBob:
The obvious question is why do you want to do this ? Have you got a problem with Serial.print() and Serial.println() ?

Second (silly and also obvious) question - why limit yourself only to AT commands ?
Of course it it possible to replace Serial with something else - IF it is a design requirement or a school assignment, right ?
But than the request "how to do it" appears to be the real question.
I would start with setting up the systems timers to proper baud rate, than proceed with elements timing …Tx / Rx I/O selection, buffers etc.

Important is to use “blink without delay” as a guiding template.

Or you can just answer the questions and than we can get down to business, shall we?

Have fun.

Can u give me example code.
I am very new in arduino and c language as well.
Thank you very much.

Or you can just answer the questions and than we can get down to business, shall we?

At the risk of repeating myself. Why don't you want to use the Serial.print() and Serial.println() functions ?
It seems to me that if this is an assignment it is a bit advanced if you are very new to C as you say.

This project is my baby thesis.
And I am making a water level indicator...
My main problem is when I use serial.print/ln function it affects the data I received in my vb.net... for example I just need the "a" and I use serial.print/ln function to implement ATcommand it fucked up my datareceived and my if statement is not functioning well not like before using AT command.

My advice would be to stay with Serial.print()/Serial.println() and fix the real problem.
Does the data look OK if you view it in the Serial monitor ?

Thank you very much guys :slight_smile:
I got it solved.

Great, but I was going to ask - why are you using "AT commands" in first place?
I assume you know that AT commands were / are intended to control modem ( attach, dial , loopback etc.) and I just did not see modem used in your setup. Or did I missed it?
Good luck
Vaclav

Noobies94:
Thank you very much guys :slight_smile:
I got it solved.

And the problem was what ?