Having problem sending message using gsm sim 300

Status
Not open for further replies.

tejakrishna

Newbie level 1
Joined
Oct 15, 2017
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
16
hello everyone,
I interfaced sim 300 with raspberry pi 2. when I run the code for
AT+ --response was OK.
for remaining there is no response
help me
this is the code

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import serial
import RPi.GPIO as GPIO      
import os, time
GPIO.setmode(GPIO.BOARD)    
port = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=1) # Enable Serial comm..
# Transmitting AT Commands to the Modem
port.write('AT'.encode()+'\r\n'.encode())  # '\r\n' indicates the Enter key
rcv = port.read(10)
print (rcv)
time.sleep(1)
port.write('ATE0'.encode()+'\r\n'.encode())      # Disable the Echo
rcv = port.read(10)
print (rcv)
time.sleep(1)
port.write('AT+CMGF=1'.encode()+'\r\n'.encode())  #Select Message format as Txt mode 
rcv = port.read(10)
print (rcv)
time.sleep(1)
port.write('AT+CNMI=2,1,0,0,0'.encode()+'\r\n'.encode()) #New SMS Message Indications
rcv = port.read(10)
print (rcv)
time.sleep(1)
port.write('AT+CMGS="9652157636"'.encode()+'\r\n'.encode()) # Sending a message
rcv = port.read(10)
print (rcv)
time.sleep(1)
port.write('temperature is 27 C'.encode()+'\r\n'.encode())  # Message
rcv = port.read(10)
print (rcv)
port.write('message from sim 300'.encode()+'\r\n'.encode())  # Message
rcv = port.read(10)
print (rcv)
port.write("\x1A".encode()) # Enable to send SMS
for i in range(10):
    rcv = port.read(10)
    print (rcv)

 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…