Hey guys,
I have Huawei Modem, which has predloaded SMS send/receive facility. I want to develope a same application which could send/receive messeges. Can anyone tell me where should i start for it. I want to integrate this SMS facility in my application.

Dani AI

Generated

Two practical ways to integrate SMS into a VB.NET app that uses your Huawei USB modem: talk to the modem directly over its virtual COM port (AT commands) or put a local SMS gateway/daemon between your app and the modem (HTTP / DB / SMPP front end). and were pointing you toward COM-port libraries; hinted at the gateway pattern (insert-into-SMS‑queue). Direct control gives full realtime control but means handling AT/PDUs/encoding and driver quirks; a gateway (Gammu, Kannel, commercial products) simplifies queuing, retries and integration. (learn.microsoft.com)

Quick, practical checklist to get started with the direct approach (what most people build first):

  • Confirm which COM port(s) the modem exposes in Device Manager and close any vendor UI that might “hold” the port.
  • Use .NET’s SerialPort to open the modem port and test with AT → expect OK.
  • Use text mode (AT+CMGF=1) for simple Latin text or PDU mode for raw/Unicode work, and send with AT+CMGS (finish body with Ctrl+Z/ASCII 26).
  • To receive, use AT+CNMI / AT+CMGL / AT+CMGR or poll memory.
  • Be aware some Huawei “HiLink” devices default to network (RNDIS/NCM) mode and hide serial ports; switching modes or using vendor AT^SETPORT commands may be required. (tech-invite.com)

Minimal VB.NET skeleton to explore the COM-port path (expand with proper error handling, timeouts, and response parsing):

Dim p As New IO.Ports.SerialPort("COM4", 115200, IO.Ports.Parity.None, 8, IO.Ports.StopBits.One)
p.NewLine = vbCr
p.Open()
p.WriteLine("AT")
Threading.Thread.Sleep(200)
Dim r = p.ReadExisting()
If r.Contains("OK") Then
  p.WriteLine("AT+CMGF=1")          ' text mode
  Threading.Thread.Sleep(100)
  p.Write("AT+CMGS=""+1234567890""" & vbCrLf)
  Threading.Thread.Sleep(100)
  p.Write("Hello from VB.NET" & Chr(26))  ' Ctrl+Z to send
End If
p.Close()

If reliability, queueing, or many simultaneous sends are required, evaluate a gateway (Gammu/Kannel or a commercial server) and point your app to its HTTP/DB API rather than the COM port. For protocol details see the .NET SerialPort documentation and the SMS AT‑command spec (3GPP TS 27.005). (learn.microsoft.com)

Recommended Answers

All 4 Replies

Thanks for your help Minimalist. But I need a little more light on this topic. Anyway thanks a lot for your help.

If your issue is still alive, this code example can be useful:

Imports System
Imports System.Data
Imports System.Data.SqlClient

Public Class Form1

    Private Sub bSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bSend.Click
        Try
            Dim myConnection As New SqlConnection("Server=.\SQLEXPRESS;User ID=ozekiuser;" _
            & "password=ozekipass;Database=ozeki;Persist Security Info=True")


            Dim mySqlQuery As String = "INSERT INTO ozekimessageout (receiver,msg,status) " _
            & "VALUES ('" & tbReceiver.Text & "', '" & tbMessage.Text & "', 'send');"

            Dim mySqlCommand As New SqlCommand(mySqlQuery, myConnection)

            'mySqlCommand.ExecuteNonQuery()

            myConnection.Open()

            mySqlCommand.ExecuteNonQuery()

            myConnection.Close()


        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
End Class

(Source: How to send SMS messages from VB.net using an SQL database)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.