<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=12&amp;t=18175&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-04-18T07:55:14+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=18175&amp;mode</id>
<entry>
<author><name><![CDATA[grzeniu 73]]></name></author>
<updated>2017-04-18T07:55:14+01:00</updated>
<published>2017-04-18T07:55:14+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18175&amp;p=187343#p187343</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18175&amp;p=187343#p187343"/>
<title type="html"><![CDATA[Re: Moduł SIM800]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18175&amp;p=187343#p187343"><![CDATA[
Tu na forum masz bardzo dobry poradnik obsługi Uart w Bascom. Jeżeli zastosujesz się do rad tam zawartych to gwarantuje Ci,ze odczytasz i wyślesz smsy bez najmniejszego problemu. Nie dawno bawiłem się sim900 i na drugim uarcie komunikacja z androidem i wszystko hula. Nie będę tu na nowo tego przepisywal,bo w tamtym temacie jest krok po kroku wszystko wyjaśnione.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1519">grzeniu 73</a> — 18 kwi 2017, o 07:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[slawek3000]]></name></author>
<updated>2017-04-16T09:46:54+01:00</updated>
<published>2017-04-16T09:46:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18175&amp;p=187253#p187253</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18175&amp;p=187253#p187253"/>
<title type="html"><![CDATA[Moduł SIM800]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18175&amp;p=187253#p187253"><![CDATA[
Witam,<br /><br />mam mały problem z modułem SIM800 (działa prawidłowo z terminalem) <br />napisałem taki program do wysyłania i odbierania sms-ów , cześć odpowiedzialna za wysyłanie działa tylko z odbiorczą mam problem <br />chodź tutaj jak podłącze FT232 pomiędzy prockiem, a modułem i wyślę komendę z terminala to procesor obierze prawidłowo komendę i wyśle sms-a<br />[syntax=basic4gl]'informacja że nadszedł nowy sms o numerze 23  +CMTI: &quot;SM&quot;,23<br />'polecenie o odebraniu sms o numerze 23         at+cmgr=23<br />'odebrany sms +CMGR: &quot;REC READ&quot;,&quot;+48&quot;,&quot;&quot;,&quot;17/03/25,17:04:26+04&quot; STATUS<br />$regfile = &quot;m644pdef.dat&quot;<br />$crystal = 16000000<br />$hwstack = 32<br />$swstack = 32<br />$framesize = 128<br />$baud = 19200<br />Config Serialin = Buffered , Size = 128<br />Enable Interrupts<br />Echo Off<br />Dim Rx_cmd As Byte , Ric As Byte<br />Dim Command As String * 254 , Ioval_prec As String * 21 , Cmdsend As String * 21 ,<br />Dim Temp_sms As String * 15 , Nr_sms As String * 2 , Temp_command As String * 100<br />Dim Ramka As String * 254<br />Dim Komunikat As String * 100<br />Dim Numer_telefonu As String * 9<br /><br /> Declare Sub Receive_sms_message<br /><br />Waitms 250<br /><br /><br /><br />Command = &quot;&quot;<br />Ric = 0<br />Rx_cmd = 0<br /><br />'Do<br />'   Rx_cmd = Ischarwaiting()<br /><br />'   If Rx_cmd = 1 Then<br />'      Rx_cmd = Waitkey()<br />'      Ric = 1<br />'      Command = Command + Chr(rx_cmd)<br />'      Waitms 1<br />'   Else<br />'      If Ric = 1 Then<br />'         Ric = 0<br />'         If Mid(command , 1 , 5) = &quot;IOCHK&quot; Then<br /><br />'            Waitms 250<br />'            Print &quot;TNN&quot; ; Chr(13)<br />'            Waitms 1<br /><br />'         End If<br />'         Command = &quot;&quot;<br />'      End If<br />'   End If<br /><br />'Loop<br /><br /><br />Command = &quot;&quot;<br />Ric = 0<br />Rx_cmd = 0<br />Print &quot;AT&quot; ; Chr(13)                                        '<br />Waitms 100<br />Print &quot;AT+CMGF=1&quot; ; Chr(13)<br />Waitms 100<br />Print &quot;AT+CMGD=&quot; ; 20<br />Wait 2<br />Do<br />     Call Receive_sms_message<br /><br /><br /><br />Loop<br /><br /> Sub Receive_sms_message<br /><br /><br />   Rx_cmd = Ischarwaiting()<br /><br />   If Rx_cmd = 1 Then<br />      Rx_cmd = Waitkey()<br />      Ric = 1<br />      Command = Command + Chr(rx_cmd)<br />          Waitms 500<br /><br />   Else<br />      If Ric = 1 Then<br />         Ric = 0<br /><br /><br />        Temp_sms = Mid(command , 2 , 4)<br />               Print Temp_sms<br />        If Temp_sms = &quot;CMTI&quot; Then<br /><br />                 Nr_sms = Mid(command , 13 , 2)             'sprawdza czy jest nowy sms +CMTI: &quot;SM&quot;,23<br /><br /><br />             Print &quot;AT+CMGF=1&quot; ; Chr(13)<br />             Print &quot;AT+CMGR=&quot; ; Nr_sms ; Chr(13)<br />               '<br />            Elseif Temp_sms = &quot;CMGR&quot; Then                   'działa z terminala<br />                Waitms 25<br />                Print Command<br />                   Temp_command = Mid(command , 61 , 6)     '36 na innym terminalu odczyt sms w tym przypadku&quot;STATUS&quot;<br /><br /><br />                  If Temp_command = &quot;STATUS&quot; Then<br /><br />               Komunikat = &quot;JEZELI WIDZISZ TEGO SMS TO ZNACZY,ZE DZIALA odbior sms-a i nadawanie&quot;<br />               Numer_telefonu = &quot;123456789&quot;<br />               Print &quot;AT&quot; ; Chr(13)                         '<br />               Waitms 100<br />               Print &quot;AT+CMGF=1&quot; ; Chr(13)<br />               Waitms 100<br />               Print &quot;AT+CMGS=&quot; ; Chr(34) ; Numer_telefonu ; Chr(34) ; Chr(13)<br />               Waitms 100<br />               Print Komunikat ; Chr(26) ; Chr(26) ; Chr(26)<br />               Waitms 100<br /><br />                  End If<br /><br /><br />            Waitms 1<br /><br />        End If<br />         Command = &quot;&quot;<br />            Print &quot;AT+CMGD=&quot; ; Nr_sms                       'kasowaie sms-a<br />      End If<br />   End If<br />End Sub[/syntax]<br /><br />więc chcąc sprawdzić czy moduł SIM800 działa prawidłowo czy wysyła do procesora dane by ten je mógł przetworzyć wgrałem mu krótki program <br /><br />[syntax=basic4gl]$regfile = &quot;m644pdef.dat&quot;<br />$crystal = 16000000                                         ' used crystal frequency<br />$baud = 19200                                               ' use baud rate<br />$hwstack = 32                                               ' default use 32 for the hardware stack<br />$swstack = 10                                               ' default use 10 for the SW stack<br />$framesize = 40                                             ' default use 40 for the frame space<br />Echo Off<br />'first compile and run this program with the line below remarked<br />Config Serialin = Buffered , Size = 200 , Bytematch = 65<br /><br />'when BYTEMATCH=ALL is used the label called is Serial0ByteReceived<br /><br />Dim Nm As String * 100<br />Dim Odczyt As String * 100<br />'the enabling of interrupts is not needed for the normal serial mode<br />'So the line below must be remarked to for the first test<br />Enable Interrupts<br /><br /> Print &quot;AT&quot; ; Chr(13);<br />Do<br />   'get a char from the UART<br /><br />   If Ischarwaiting() = 1 Then                              'was there a char?<br />      Nm = Inkey()<br /><br />        Print Nm ;<br />                                                     'print it<br />   End If<br /><br />                                                     'wait 1 second<br />Loop<br /><br /><br />'when the specified byte is received the following label is called<br />'in this case A is checked<br />Serial0charmatch:<br />Return[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=988">slawek3000</a> — 16 kwi 2017, o 09:46</p><hr />
]]></content>
</entry>
</feed>