0

I am a beginner in learning AT commands and windows programming.

I prepared a code just to read the Serial no of a Nokia phone in VB 2010 as

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SerialPort1.Open()
        SerialPort1.WriteLine("AT")
        SerialPort1.WriteLine("AT+CNUM")
        TextBox1.Text = SerialPort1.ReadLine()
        SerialPort1.Close()

    End Sub
End Class

Unfortunately, it is not working, no error message.

Port I selected is COM which I verified through device manager. Baud rate set as 9600. If anybody can help, Please.......

Thanks

KenD
  • 5,280
  • 7
  • 48
  • 85

1 Answers1

0

0) open read before write, try switch:

SerialPort1.Open()
TextBox1.Text = SerialPort1.ReadLine()
SerialPort1.WriteLine("AT")
SerialPort1.WriteLine("AT+CNUM")
SerialPort1.Close()

1) send \r (\r\n) -- end of string

2) use command with view resultats:

call (ATD<number>);
busy (ATH);
response call (ATA) -- for view this 2 commands to call from phone to modem;
other (blink/switch off radio/play tone)

disclaimer: VB don't know, i'm using python on Linux; sorry for my dirty english.

freuser
  • 1
  • 1