'bascom 1.11.7.4 $regfile = "m32def.dat" $crystal = 11059200 '$baud = 19200 $eeprom Dim Nothing As Eram Byte 'atmega32 problem Dim Pin As Eram String * 5 Dim Tel As Eram String * 12 Dim Intervalini As Eram Word Dim Eml As Eram String * 40 Dim Zerov As Eram Word 'zero temperatur Dim Ftpweb As Eram String * 40 'room for ftp server name Dim Ftpuser As Eram String * 22 'room for ftp username Dim Ftppassw As Eram String * 12 'room for ftp server pass Dim Inetuser As Eram String * 15 'room for internet account name Dim Inetpassw As Eram String * 12 'room for internet account password $data 'ram variable Dim 20ms As Byte 'rtc 50Hz Dim Seconds As Byte 'rtc sec Dim Waittimer As Word 'timeout x 20ms Dim Rtstime As Byte Dim R As String * 22 Dim S As String * 200 Dim T As String * 200 'Dim Instring As String * 10 Dim Binarydata(512) As Byte Dim Binarydatacount As Word Dim Ch As String * 1 'lowest bit is higest bit pcf8574 (pc7) Dim F7 As Bit 'bit7 pcf Dim F6 As Bit 'bit6 Dim F5 As Bit 'bit5 Dim F4 As Bit 'Bit4 Dim Cameraoff As Bit 'bit3 Dim Modemselect As Bit 'bit2 Dim Cameraaddr1 As Bit 'bit1 Dim Cameraaddr0 As Bit 'bit0 pcf Dim Pcfdata As Byte At Cameraaddr0 Overlay Dim Binarymode As Bit 'receive in binary mode Dim Rectimeout As Bit ' Dim Initcameraok As Bit 'camera initialized Dim Rtsflag As Bit Dim Bigfile As Bit Dim F0 As Bit Dim F1 As Bit Dim F2 As Bit Dim Modemready As Bit Dim Rx_char As Byte Dim Char As Byte Dim Rate As Long ' Baud rate required by the user Dim Bytvar As Byte Dim Picture As Word Dim I As Word Dim J As Word Dim K As Word Dim L As Word Dim N As Byte Ri Alias Usr.rxc ' Receptioncompleted Ti Alias Usr.txc ' Transmissioncompleted Declare Sub Pcfwrite Config Adc = Single , Prescaler = Auto , Reference = Avcc Config Timer0 = Timer , Prescale = 1024 'Takt: Quarz/1024 On Timer0 T0_int 'on interrupt Load Timer0 , 40 '50Hz (11059200/1024 /(256-16) Enable Timer0 'Timer0 overflow 'Enable Interrupts Mcusr = &H80 Mcusr = &H80 'disable JTAG Config Portc = Input 'port c as output Portc = &HFC Config Scl = Portc.0 'init i2c Config Sda = Portc.1 Ddrd = &B11111100 'PD2-7 as output pd0-1 rs232 Portd = &B11111100 Config Adc = Single , Prescaler = Auto , Reference = Avcc Admux = &B01110000 Start Adc 'run adc I2cstop 'stop i2c Rate = 19200 Gosub Setspeed Open "comd.3:19200,8,n,1" For Output As #1 Reset Modemselect Reset Cameraaddr0 'select camera addr Reset Cameraaddr1 Set Cameraoff Call Pcfwrite Enable Interrupts T = "mail@atlas.cz" Eml = T Pin = "#1234" T = "jemand.hostuju.cz" Ftpweb = T T = "jemand.hostuju.cz" Ftpuser = T T = "password" Ftppassw = T Inetuser = "" Inetpassw = "" '******************************************* Start0: 'If Pinc.4 = 0 Then : Gosub Ftptransfer : End If 'If Pinc.5 = 0 Then : Gosub Readcamera : End If Gosub Readcamera Wait 5 Goto Start0 '************************************************** Checksms: Waittimer = 10000 '1000000 cca 1,45s xtal 11059200 $timeout = 1000000 Set Modemselect Call Pcfwrite 'modem is selected Wait 1 Input S 'if anything ,kill it Print "ATV0" Input S 'wait for response 0 Gosub Modem0 'test if modem ready If Modemready = 0 Then Print #1 , "modem not ready" Return End If T = "AT+CMGL=" + Chr(34) + "ALL" + Chr(34) 'list all message Print T Input S 'response 0 or +cmgl.... Ch = Left(s , 1) If Ch <> "+" Then : Return : End If 'any massage ? Input T 'receive sms text 'Print #1 , "1odpoved na ATCMGL " ; Chr(34) ; S ; Chr(34) 'Print #1 , "2odpoved na ATCMGL " ; Chr(34) ; T ; Chr(34) Wait 1 'kill another message, only one Ch = Mid(s , 9 , 1) 'message index S = "AT+CMGD=" + Ch 'delete message 'Print #1 , T 'Wait 1 Print S Input S 'receive message deleted 'Print #1 , "odpoved na ATCMGd " ; S 'Print #1 , "zprava je" ; T ; "***" Wait 1 'Readeeprom S , &H01 S = Pin Print #1 , "pin je " ; S If Instr(t , S) = 0 Then : Print #1 , "pin nalezen" : End If I = Instr(t , S) Print #1 , "pin nalezen na " ; I Neplatnasms: Return '************************************************** Ftptransfer: 'prenos par bytu trva 20s 'Waittimer = 10000 $timeout = 1000000 'timeout 1,5 sec Binarymode = 0 'AT command mode for cameras Portd.2 = 0 'Reset Camera rts Set Cameraoff Set Modemselect Call Pcfwrite 'modem is selected Wait 1 'Input S Gosub Testresponse 'if anything ,kill it Print #1 , "AT" Gosub Testresponse Print #1 , "ATE0" Gosub Testresponse Print #1 , "ATV0" 'test modem Gosub Testresponse 'wait for response 0 may be OK Print #1 , "ATV0" 'test modem Gosub Testresponse 'wait for response 0 Gosub Modem0 'test if modem ready If Modemready = 0 Then Print #1 , "modem not ready" ' Return 'goto new init ? End If Print #1 , "AT+IPR=19200" 'test modem Gosub Testresponse 'wait for response 0 Waitms 300 Print #1 , "AT#GPRS=1" 'activate gprs '+IP: x.x.x.x 0 Gosub Testresponse T = S Gosub Testresponse '0 Print #1 , T Print #1 , S Wait 1 'tady init kamery az do prenosu obrazku Cameratransfer: Reset Cameraoff 'switch camera on Reset Modemselect 'switch serial port to camera Call Pcfwrite 'write to expander Waitms 1000 Gosub Camerainit If Initcameraok = 0 Then : Goto Camerainitfault : End If Gosub Iniwithoutflash If Rectimeout = 1 Or Initcameraok = 0 Then : Goto Camerainitfault : End If Gosub Decodephotolen Print #1 , "velikost obrazku " ; Picture If Rectimeout = 1 Or Initcameraok = 0 Then : Goto Camerainitfault : End If Gosub Preparephototransfer If Rectimeout = 1 Or Initcameraok = 0 Then : Goto Camerainitfault : End If ' camera is ready trannsfer picture 115000 Rate = 19200 Gosub Setspeed 'speed in any fall to 19200 Set Modemselect Call Pcfwrite 'switch serial to modem Waitms 100 R = Ftpuser S = Ftpweb T = Ftppassw Print #1 , "AT#FTPOPEN=" ; Chr(34) ; S ; Chr(34) ; "," ; Chr(34) ; R ; Chr(34) ; "," ; Chr(34) ; T ; Chr(34) ; ",0" Gosub Testresponse If S <> "0" Then ' goto nextcamera 'if FTP server timeout End If Print #1 , S Waitms 200 Print #1 , "AT#FTPTYPE=0" 'binary transfer mode Gosub Testresponse Print #1 , "AT#FTPTYPE=0 " ; S Waitms 200 Bytvar = Pcfdata And &H03 'take camera adress Bytvar = Bytvar Or &H30 'ascii R = Chr(bytvar) Print #1 , "AT#FTPDELE=" ; Chr(34) ; R ; ".jpg" ; Chr(34) 'Input S Gosub Testresponse Print #1 , "AT#FTPDELE= " ; S Waitms 200 '0 Print #1 , "AT#FTPPUT=" ; Chr(34) ; R ; ".jpg" ; Chr(34) '1 Gosub Testresponse Print #1 , "AT#FTPPUT " ; S Waitms 100 Rate = 115000 Gosub Setspeed Reset Modemselect 'switch serial port to camera Call Pcfwrite 'write to expander Waitms 100 If Bigfile = 0 Then Waittimer = 1500 '6kByte /4800 20ms tic 30s Else Waittimer = 10000 End If '40kByte /4800 20ms tic 200s '**************** N = 0 Binaryreceive0: Binarydatacount = 0 Rtsflag = 0 Portd.2 = 0 'start transfer on 115000 rts=0 from camera to buffer Do If Ischarwaiting() = 1 Then Rx_char = Udr ' Read received char Binarydata(binarydatacount) = Rx_char Incr Binarydatacount Decr Picture If Binarydatacount > 412 Then 'is cca + 20 characters If Rtstime = 0 And Rtsflag = 0 Then Rtstime = 5 End If Portd.2 = 1 'stop transfer, wait for max 100 character End If End If If N = 255 And Rx_char = 217 Then Exit Do 'search squence FF D9 jpg end N = Rx_char If Picture = 0 Then Exit Do 'end from decoded len If Waittimer = 0 Then Exit Do 'control for character underun If Rtsflag = 1 Then : Exit Do : End If '????????????????? Loop Rate = 19200 'switch back to modem on 19200 Gosub Setspeed Set Modemselect Call Pcfwrite Waitms 100 J = Binarydatacount - 1 For I = 0 To J Printbin #1 , Binarydata(i) Waitms 2 'giv gprs time cts not implemented Next I If Waittimer = 0 Then Goto Binaryreceive01 If Picture = 0 Then Goto Binaryreceive01 Rate = 115000 'switch back to camera on 115000 Gosub Setspeed Reset Modemselect Call Pcfwrite Waitms 100 Goto Binaryreceive0 Binaryreceive01: 'switch camera off Set Cameraoff Call Pcfwrite Portd.2 = 0 'Reset Camera rts Waitms 300 'necessary Print #1 , "+++"; 'escape character from datatransfer Gosub Testresponse Print #1 , "+++" ; S Waitms 300 Print #1 , "AT#FTPCLOSE" 'FTPtransfer end Gosub Testresponse Print #1 , "AT#FTPCLOSE" ; S Waitms 300 Nextcamera: Bytvar = Pcfdata And &H03 'take camera adress If Bytvar = 3 Then 'camera 3 transfered Reset Cameraaddr0 'select camera addr Reset Cameraaddr1 Goto Gprsend Else Incr Pcfdata 'next camera Goto Cameratransfer 'no, next End If '0 Gprsend: Print #1 , "AT#GPRS=0" 'gprs end Gosub Testresponse '0 Print #1 , "AT#GPRS=0" ; S ; " cas " ; Waittimer Wait 1 Return '************************************************** Testresponse: Waittimer = 100 '2 sec Gosub Receivestring Return '************************************************* Camerainitfault: Rate = 19200 'switch back to modem on 19200 Gosub Setspeed Set Modemselect 'back to modem Set Cameraoff 'switch camera off Call Pcfwrite Portd.2 = 0 'Reset Camera rts Waitms 100 Goto Nextcamera '************************************************* Readcamera: Binarymode = 0 'AT command mode Portd.2 = 0 'Reset Camera rts Set Cameraaddr0 'select camera addr Set Cameraaddr1 Reset Cameraoff 'switch camera on Reset Modemselect 'switch serial port to camera Call Pcfwrite 'write to expander Reset Bigfile 'big picture Waitms 1000 Gosub Camerainit If Initcameraok = 0 Then : Goto Badcamerainit : End If 'if Pinc.5 = 0 Then : Gosub Iniflash : End If Gosub Iniwithoutflash If Rectimeout = 1 Or Initcameraok = 0 Then : Goto Badcamerainit : End If Gosub Decodephotolen If Rectimeout = 1 Or Initcameraok = 0 Then : Goto Badcamerainit : End If Gosub Preparephototransfer If Rectimeout = 1 Or Initcameraok = 0 Then : Goto Badcamerainit : End If Gosub Binaryreceive 'Waitms 1000 Badcamerainit: Portd.2 = 0 'Reset Camera rts Reset Initcameraok 'Reset Camerarts Set Cameraoff Call Pcfwrite Rate = 19200 Gosub Setspeed 'speed in any fall to 19200 Return '******************************************************************************* ' Init iqp500 camera to ready state '******************************************************************************* Camerainit: Reset Rectimeout Waittimer = 250 ' x 20ms timeout ,in 10s must be initialised 'camera init + make photo + prepare photo transfer == 6sec Reset Initcameraok 'flag camera initialised 'Print #1 , "rts=1" Rx_char = Udr 'kill all character Portd.2 = 1 'rts=1 camera can send 'Goto Sortresponse1 Sendok: T = "OK" + Chr(13) 'Print #1 , T Print T Sortresponse1: Gosub Receivestring 'Print #1 , S If Rectimeout = 1 Then : Return : End If 'on first occurence rectimeout exit T = "AT&F" If S = T Then : Goto Sendok : End If T = "ATE0" If S = T Then : Goto Sendok : End If T = "AT+CMEE=1" If S = T Then : Goto Sendok : End If T = "AT^SACD=1" If S = T Then : Goto Sendok : End If T = "AT^SACD=2," + Chr(34) + "17" + Chr(34) 'AT^SACD=2,"17" If S = T Then : Goto Sendok : End If T = "AT^SACD=2," + Chr(34) + "17,00,2,IQP5 02.01" + Chr(34) 'AT^SACD=2,"17,00,2,IQP5 02.01" If S = T Then : Goto Sendok : End If T = "AT^SACD=2," + Chr(34) + "17,00,2,IQP5 01.05" + Chr(34) 'AT^SACD=2,"17,00,2,IQP5 01.05" If S = T Then : Goto Sendok : End If T = "AT^SACD=2," + Chr(34) + "17,04,2,3" + Chr(34) 'AT^SACD=2,"17,04,2,3" If S = T Then T = "OK" + Chr(13) Print T Set Initcameraok End If Return '***************************************************************************** 'init flash and make photo '***************************************************************************** 'Iniflash: 'T = "^SACD: 17,03,2" + Chr(13) 'Print #1 , T 'Print T 'Goto Sortresponse3 'Sendokflash: 'T = "OK" + Chr(13) ''Print #1 , T 'Print T 'Sortresponse3: 'Gosub Receivestring 'If Rectimeout = 1 Then : Return : End If 'on first occurence rectimeout exit ''Print #1 , S 'T = "AT^SACD=2," + Chr(34) + "17,03,OK" + Chr(34) 'AT^SACD=2,"17,03,OK" 'If S = T Then : Goto Sendokflash : End If 'T = "AT^SACD=2," + Chr(34) + "17,03,2,1" + Chr(34) 'AT^SACD=2,"17,04,2,1" 'If S = T Then : Goto Sendokflash : End If 'T = "AT^SACD=2," + Chr(34) + "17,04,2,3" + Chr(34) 'AT^SACD=2,"17,04,2,3" 'If T = S Then ' T = "OK" + Chr(13) ' Print #1 , T ' Print T ' T = "^SACD: 17,04,2,2" ' Print #1 , T ' Print T ' Goto Sortresponse3 'End If 'T = "AT^SACD=2," + Chr(34) + "17,04,OK" + Chr(34) 'AT^SACD=2,"17,04,OK" 'If S = T Then : Return : End If 'Set Rectimeout 'bad string =rectimeout 'Return '**************************************************************************** 'make photo without flash '**************************************************************************** Iniwithoutflash: Waittimer = 250 T = "^SACD: 17,04,2,1" 'Print #1 , T Print T Gosub Receivestring If Rectimeout = 1 Then : Return : End If 'on first occurence rectimeout exit 'Print #1 , S T = "AT^SACD=2," + Chr(34) + "17,04,OK" + Chr(34) 'AT^SACD=2,"17,04,OK" If S = T Then : Return : End If Reset Initcameraok 'bad string =rectimeout Return '***************************************************************************** '* decode photo len '***************************************************************************** Decodephotolen: Waittimer = 250 T = "OK" + Chr(13) 'Print #1 , T Print T Gosub Receivestring If Rectimeout = 1 Then : Return : End If 'on first occurence rectimeout exit 'Print #1 , S T = "AT^SACD=2," + Chr(34) + "17,04,2,1" + Chr(34) If S = T Then : Goto Decodephotolen : End If 'wait for AT^SACD=2,"17,04,2,2,3490,34882" If S = "" Then : Reset Initcameraok : Return : End If 'If Len S < 32 Then : Return : End If If Bigfile = 0 Then T = Mid(s , 22 , 4) Picture = Val(t) Else T = Mid(s , 27 , 5) Picture = Val(t) End If 'Print #1 , Picture T = "OK" + Chr(13) 'Print #1 , T Print T Return '***************************************************************************** ' '***************************************************************************** Preparephototransfer: Waittimer = 250 If Bigfile = 0 Then T = "^SACD: 17,01,2,1" + Chr(13) 'giv small picture Else T = "^SACD: 17,01,2,2" + Chr(13) 'giv big picture End If 'Print #1 , T Print T Gosub Receivestring If Rectimeout = 1 Then : Return : End If 'on first occurence rectimeout exit 'Print #1 , S T = "AT^SACD=2," + Chr(34) + "17,01,OK" + Chr(34) If S = T Then T = "OK" + Chr(13) ' Print #1 , T Print T Else Set Rectimeout Return End If Rate = 115000 Gosub Setspeed Gosub Receivestring If Rectimeout = 1 Then : Return : End If 'on first occurence rectimeout exit 'Print #1 , S T = "AT^SADT=1,115200" If S = T Then T = "CONNECT" + Chr(13) ' Print #1 , T Print T Else Set Rectimeout Return End If Return '***************** Manages string reception from serial line ***************** '* This sub returns the string received from serial line A,and * '* returns with timeout or . * '* * '***************************************************************************** Receivestring: S = "" 'Waittimer = 500 ' x 20ms timeout 'Reset Rectimeout Do If Ischarwaiting() = 1 Then Rx_char = Udr ' Read received char If Rx_char = 13 Then : Exit Do : End If If Rx_char <> 10 Then Ch = Chr(rx_char) S = S + Ch End If End If If Waittimer = 0 Then : Set Rectimeout : Exit Do : End If ' If timeout then set flag and exit Loop Return '**************************************************************************** ' ' '**************************************************************************** Binaryreceive: If Bigfile = 1 Then Waittimer = 4000 'cca 40kByte = 40 sec x 2 =80sec Else Waittimer = 2000 'cca 7kByte End If N = 0 'last received character Binaryreceive1: '**************************************** 'K = 0 'L = 0 Binarydatacount = 0 Rtsflag = 0 Portd.2 = 0 'start transfer on 115000 rts=0 Do If Ischarwaiting() = 1 Then Rx_char = Udr ' Read received char Binarydata(binarydatacount) = Rx_char Incr Binarydatacount Decr Picture If Binarydatacount > 412 Then 'is cca + 20 characters If Rtstime = 0 And Rtsflag = 0 Then Rtstime = 5 End If Portd.2 = 1 'stop transfer, wait for max 100 character End If End If ' If N = 255 And Rx_char = 217 Then Exit Do ' search squence FF D9 jpg end ' N = Rx_char If Picture = 0 Then Exit Do 'end from decoded len If Waittimer = 0 Then Exit Do 'control for character underun If Rtsflag = 1 Then : Exit Do : End If '????????????????? Loop J = Binarydatacount - 1 'Disable Interrupts For I = 0 To J 'Rx_char = Binarydata(i) Printbin #1 , Binarydata(i) 'Print #1, Next I 'Enable Interrupts If Waittimer = 0 Then Goto Binaryreceive2 If Picture = 0 Then Goto Binaryreceive2 Goto Binaryreceive1 Binaryreceive2: 'Portd.3 = 0 'switch camera off Set Cameraoff Call Pcfwrite Rate = 19200 'uart speed back to 19200 Gosub Setspeed Return '**************************************************************************** '***************************************************************************** T0_int: Stop Timer0 ' stop timer0 Timer0 = 40 ' reload 50Hz 11.0592MHz Start Timer0 ' restart timer0 Incr 20ms If Waittimer > 0 Then : Decr Waittimer : End If If Rtstime > 0 Then Decr Rtstime If Rtstime = 0 Then Rtsflag = 1 End If End If ' If 20ms > 49 Then ' 20ms = 0 ' Incr Seconds ' If Seconds > 59 Then : Seconds = 0 : End If ' End If Return '***************************************************************************** 'Write byte to pcf8574 expander '**************************************************************************** Sub Pcfwrite 'write flag to expander pin I2cstart I2cwbyte $40 I2cwbyte Pcfdata I2cstop End Sub Pcfwrite '********************Change speed "on fly" ************************************ '* Low level communication because BASCOM ' Input "Baud rate:" , Rate ' *UBRR = (Fosc / (16 * BaudRate)) - 1 Setspeed: Rotate Rate , Left , 4 Rate = 11059200 / Rate Rate = Rate - 1 ' *Before reprogramming serial port, transmission buffer must be emptied Waitms 1 ' Bit x chr = 8 Stop bit = 1 Parity = No ' Handshake = No Baud rate = 19200 Ucsrc = &H86 ' Initialize Serial port 8 Bit,1 Stop No Interrupt Ubrrhi = &H00 ' Set Baud Rate19200 Ubrr = Rate Return '******************************************************************************* 'modem init after power up or reset '******************************************************************************* Modeminit: $timeout = 2000000 '1000000 cca 1,45s xtal 11059200 Waittimer = 500 Set Modemselect Set Cameraoff Call Pcfwrite ' camera is deselectet and modem is connected to serial port T = "AT" + Chr(13) Print #1 , T Print T 'character are at this time "echoed" Wait 1 T = "ATE0" + Chr(13) 'no echo Print #1 , T Print T 'Wait 1 T = "ATV0" + Chr(13) 'echo is disabled, next time numeric response Print #1 , T Print T Wait 1 Rx_char = Udr Rx_char = Udr Rx_char = Udr T = "ATV0" + Chr(13) 'echo is disabled, numeric response Print #1 , T Print T Gosub Receivestring 'wait for response 0 Print #1 , S Gosub Modem0 'if response 0 then set flag modem ready T = "AT+IPR=19200" 'fix speed to 19200 Print #1 , T Print T Gosub Receivestring ' 0 Print #1 , S T = "AT+CSMS=0" 'SMS service +CSMS: 0,1,1,10 Print #1 , T Print T Gosub Receivestring 'after next init 0 T = Left(s , 1) If T = "+" Then T = S Gosub Receivestring End If Print #1 , T Print #1 , S T = "AT+CPMS=" + Chr(34) + "SM" + Chr(34) + "," + Chr(34) + "SM" + Chr(34) + "," + Chr(34) + "SM" + Chr(34) '+CPMS: 0,10,0,10,0,100 Print #1 , T Print T Gosub Receivestring T = Left(s , 1) If T = "+" Then T = S Gosub Receivestring End If Print #1 , T Print #1 , S T = "AT+CMGF=1" ' 0 Print #1 , T Print T Gosub Receivestring Print #1 , S T = "AT+CGDCONT=1," + Chr(34) + "IP" + Chr(34) + "," + Chr(34) + "internet" + Chr(34) + "," + Chr(34) + "0.0.0.0" + Chr(34) + ",0,0" 'AT+CGDCONT=1,"IP","internet","0,0,0,0",0,0 Print #1 , T Print T Gosub Receivestring ' 0 Print #1 , S S = Inetuser T = "AT#USERID=" + Chr(34) + S + Chr(34) 'AT#USERID="" Print #1 , T Print T Gosub Receivestring ' 0 Print #1 , S S = Inetpassw T = "AT#PASSW=" + Chr(34) + S + Chr(34) 'AT#PASSW="" Print #1 , T Print T Gosub Receivestring ' 0 Print #1 , S T = "AT+CMGL=" + Chr(34) + "ALL" + Chr(34) Print #1 , T Print T Input S 'Gosub Receivestring T = Left(s , 1) If T = "+" Then T = S Input S 'Gosub Receivestring Print #1 , T End If Print #1 , S Wait 1 'forgot rest of messages if anny Rx_char = Udr 'kill characters in rx buffer Reset Modemselect Call Pcfwrite Return '*********************************************************************************** Modem0: If Waittimer = 0 Then Reset Modemready Print #1 , "no echo from modem after init" Return End If If S = "0" Then Set Modemready ' Print #1 , "modem successfully initialized" Else Reset Modemready End If Return End 'end program 'GM862 after power up 'AT FROM CPU ' ATOK FROM GM862 'ATE0 ' ATE0OK 'ATV0 ' 0 'AT+CSMS=0 ' +CSMS: 0,1,1,10 'AT+CPMS="SM","SM","SM" ' +CPMS: 0,10,0,10,0,100 'AT+CMGF=1 ' 0 'AT+CMGL="ALL" or AT+CMGL="REC UNREAD" ' 0 SMS is not ' +CMGL: 1,"ALL","9900090"message#0 ' +CMGL: 1,"ALL","9900090760443529"xxx@yyy.cz:subject B: ' message#0 ' +CMGL: 1,.......#1959 TEST1# ' +CMGL: 2,.......#1959 TEST2#0 'AT+CMGS="+420..." ' >_ 'message ' +CMGS: 10 'AT ' 0 'ATD +420......; ' 0 'ATH ' 0 'ATE0 ' 0 'ATV0 ' 0 '******************************************* 'AT+CGDCONT=1,"IP","internet","0,0,0,0",0,0 ' 0 'AT#USERID="" ' 0 'AT#PASSW="" ' 0 'AT#GPRS=1 ' 0 'AT#FTPOPEN="jemand.atlasweb.cz","jemand","password",0 ' 0 'AT#FTPTYPE=0 ' 0 'AT#FTPDELE="file.txt" ' 0 'AT#FTPPUT="file.bin" ' 1 'KAHDKASFDWEGASGCSACHA '+++ 1sec sleep ' 3 'AT#FTPCLOSE ' 0 'AT#GPRS=0 ' 0