GSM-Forum

GSM-Forum (https://forum.gsmhosting.com/vbb/)
-   GSM Programming & Reverse Engineering (https://forum.gsmhosting.com/vbb/f83/)
-   -   Serial Port in VB .NET 2008 (https://forum.gsmhosting.com/vbb/f83/serial-port-vb-net-2008-a-688748/)

ameenudeen 06-16-2012 13:04

pls hap
 
HTML code is Off
.................................................

vivachillon 06-24-2012 17:41

thanks friend!!!!!!!!!

selular88 10-09-2012 13:49

does SerialPort in VB.Net supports wavecom?
please help me, maybe I am the one who is mistaken

Here's the at command code :
Code:

ATZ
OK
AT+CMGL="ALL"
+CMGL: 1,"REC READ","+6285289983333",,"12/10/08,11:52:20+28"
sms gateway read again and again
+CMGL: 2,"REC UNREAD","+6285289983333",,"12/10/08,12:32:24+28"
TESTING RECEIVE SMS
+CMGL: 3,"REC READ","+6285289983333",,"12/10/08,12:08:17+28"
read sms again

OK
AT+CMGD=1
OK
AT+CMGL="ALL"
+CMGL: 2,"REC READ","+6285289983333",,"12/10/08,12:32:24+28"
TESTING RECEIVE SMS
+CMGL: 3,"REC READ","+6285289983333",,"12/10/08,12:08:17+28"
read sms again

OK

AT+CGMI
 WAVECOM MODEM

OK
AT+CGMM
 MULTIBAND  900E  1800

OK
AT+CGMR
640_09gg.Q2303A 1264860 052103 11:21

OK
AT+CGSN
354056000341739

it works well on hyperterminal, but return nothing from SerialPort Class

[Shadab_M] 10-11-2012 06:43

Serial Port will support every thing based on Serial Protocol.

May be you are not sending vbCRLF with commands?

Br,
Shadab Ahmad

selular88 10-12-2012 06:59

Hai Shadab Ahmad, thanks for your reply
I used your application for modem 1206B/Q2303A

Here is the code :
Code:

Public Class Form1

    Dim comPorts As Array  'Com ports enumerated into here
    Dim rxBuff As String    'Buffer for receievd data

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'When the form loads
        'Enumerate available Com ports and add to ComboBox1
        comPorts = IO.Ports.SerialPort.GetPortNames()

        For i = 0 To UBound(comPorts)
            ComboBox1.Items.Add(comPorts(i))
        Next

        'Set ComboBox1 text to first available port
        ComboBox1.Text = ComboBox1.Items.Item(0)
        'Set SerialPort1 portname to first available port
        SerialPort1.PortName = ComboBox1.Text

        'Set remaining port attributes
        SerialPort1.BaudRate = 19200
        SerialPort1.Parity = IO.Ports.Parity.None
        SerialPort1.StopBits = IO.Ports.StopBits.One
        SerialPort1.DataBits = 8


    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'When Tx button clicked
        'Clear buffer
        rxBuff = ""

        'If port is closed, then open it
        If SerialPort1.IsOpen = False Then SerialPort1.Open()

        'Write this data to port
        SerialPort1.Write(TextBox1.Text & vbCr)

        'Pause for 800ms
        System.Threading.Thread.Sleep(800)

        'If the port is open, then close it
        If SerialPort1.IsOpen = True Then SerialPort1.Close()

        'If the buffer is still empty then no data. End sub
        If rxBuff = "" Then GoTo ends

        'Else display the recieved data in the RichTextBox
        RichTextBox1.Text = rxBuff

ends:
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        'When ComboBox1 selection is changed, we need to update SerialPort1 with the new choise
        'But only if the port is closed!

        If SerialPort1.IsOpen = False Then
            SerialPort1.PortName = ComboBox1.Text
        Else : MsgBox("Operation only valid when port is closed.", MsgBoxStyle.Exclamation, "Error")

        End If

    End Sub

    Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
        'This sub gets called automatically when the com port recieves some data

        'Pause while all data is read
        System.Threading.Thread.Sleep(300)

        'Move recieved data into the buffer
        rxBuff = (SerialPort1.ReadExisting)

    End Sub

End Class


[Shadab_M] 10-12-2012 14:26

Code:

        'Write this data to port
        SerialPort1.Write(TextBox1.Text & vbCrLf)

I hope this should work fine.

Br,
Shadab Ahmad

selular88 10-18-2012 07:13

Quote:

Originally Posted by shadab_a4u (Post 8837713)
Code:

        'Write this data to port
        SerialPort1.Write(TextBox1.Text & vbCrLf)

I hope this should work fine.

Br,
Shadab Ahmad

It works perfectly on my phone, that's okay, I'll just use phone instead of wavecom :D

btw, I also had another problem due to this project using my old phone.
Here's the list of them :
1. My Old phone doesn't support text mode (AT+CMGF only returns 0), it's just support PDU mode, can you help me to convert PDU to Text in VB? I have the code, but in javascript, feel free if anyone want for this code, I'll share it
2. I also received unknown text when I use AT+CMGL="READ", here is the result :
Code:

+CMGL: 6,"REC READ","6281xxxxxx",,"2012/10/18 12:32:58+28"
050003DA0202403119481D6EFFE8F2743BBC0ECFD12E

I'm sorry for sharing nothing here, this is my first project with VB.Net
Thanks for anyone that can help for this problem

gsmator 10-19-2012 13:30

Its not complicated. Whats really complicated, its to use concatenated sms in via pdu!

selular88 10-21-2012 09:42

2 Attachment(s)
Yes, it's not easy to concatenating long sms.

I attached 2 files (in .rar and .zip format), pdu-JS.zip successfully decode / encode pdu code, but max 160 characters, the other one Sample.rar includes pdu decoder / encoder, and concatenate long sms, but I think it's not working (returns wrong results)

can anyone please help me to test this code?
feel free to download this file, thank you

siaobukol 10-01-2013 14:15

i am using vb2008 and AT comands for sending and reading SMS messages on a SmartBroadband Stick with a simcard on it...
sometimes im having problems sending SMS due to lack of signal
i think i have to validate first the Signal before sending SMS
how do i do that??
i tried to execute AT commands and show the output on a message box upon detecting the signal and the result on executing that command is "NO CARRIER"
meaning the program doesnt detect the simcard if it is smart or globe etc..
can someone please help me with this problem??
i can't detect the signal strenght becoz the program can't detect the network service provider of my simcard

eyestrain 10-03-2013 06:24

Quote:

Originally Posted by [Shadab_M] (Post 8837713)
Code:

        'Write this data to port
        SerialPort1.Write(TextBox1.Text & vbCrLf)

I hope this should work fine.

Br,
Shadab Ahmad

this is old but its very useful
I always use vbCrLf as a new line and i never use it this way and thanks for that shadab,
I know vbCrLf is a Carriage Return and Line Feed which i use in making a new lines like " & vbCrLf & "
now its like i can diffentiate vbCrLf to vbNewLine :D

anil.prajapati 11-06-2013 04:43

1 Attachment(s)
i have problem when creating sample project

how to define the SerialPort1

http://forum.gsmhosting.com/vbb/atta...1&d=1383709391

brainh4ck3r 07-28-2014 16:35

Thank you so much for tutorials posted here, :D

mrjuba 10-10-2014 14:42

is available for delphi ???

hien1001 10-27-2014 03:18

how to send sms ends after entered the following signs > that can not press ctrl + z
thanks


All times are GMT +1. The time now is 14:31.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
- GSM Hosting Ltd. - 1999-2023 -

Page generated in 0.16591 seconds with 7 queries

SEO by vBSEO