0

When i run this python code to send sms from gsm, I recive a message

content not supported

import serial
import time 

ser = serial.Serial("/dev/ttyAMA0",baudrate=9600) 
time.sleep(1) 
ser.write('ATE0\r') 
time.sleep(1) 
ser.write('ATZ\r') 
time.sleep(1) 
ser.write('AT+CMGF=1\r') 
time.sleep(1) 
ser.write('AT+CMGS= "+989337282702" \r') 
time.sleep(1) 
ser.write('hi \r')
time.sleep(1) 
ser.write(chr(26)) 
time.sleep(1)

print 'sent successfully'
Skandix
  • 1,916
  • 6
  • 27
  • 36
  • 1
    Please paste the complete error message. – Joe Feb 09 '18 at 13:27
  • There is not error that i see .just i recived message in mobile with content <> – Erfan Farhadi Feb 09 '18 at 13:29
  • Ah, ok. On the sending or receiving cell phone? Them I am not sure if you will find help here. I googled for GSM and "content not supported" and there are several results. Could you try `ser.write('hi')` instead of `ser.write('hi \r')`? This code looks slightly different `"AT+CMGS=\"+ZZXXXXXXXXXX\"\r"` https://mechatrofice.com/arduino/gsm/send-sms – Joe Feb 09 '18 at 14:00
  • I tried but the soulotion is not this – Erfan Farhadi Feb 09 '18 at 14:12
  • Does "content not supported" appear on the sending or receiving phone? – Joe Feb 09 '18 at 14:29
  • 1
    No! No! No! You should [never, never, never, never, never, never, never, never, never, never, ever use sleep like that](https://stackoverflow.com/a/46064206/23118). You MUST **read** and **parse** the responses given back by the modem, otherwise you will [abort](https://stackoverflow.com/a/1389034/23118) the commands. – hlovdal Feb 10 '18 at 09:17
  • 1
    See also the first part of [this answer](https://stackoverflow.com/a/15591673/23118). – hlovdal Feb 10 '18 at 09:19
  • @Joe appears on sending and instaed of recive message for user ,recive "content not sopported" – Erfan Farhadi Feb 11 '18 at 13:24
  • @hlovdal tnx man but i checked also whit any sleep but still when i send mesaage from gms to phone i have this problem – Erfan Farhadi Feb 11 '18 at 13:25
  • Please update the question with the new code that does not use sleep. Does the modem actually support text mode? Have you tried sending a sms to another number? Using another sim card? Another phone? – hlovdal Feb 11 '18 at 14:18
  • @hlovdal i tried to send to other number other phone but still it is that – Erfan Farhadi Feb 12 '18 at 06:51
  • @hlovdal help please – Erfan Farhadi Feb 16 '18 at 19:40
  • If you want people to help you, then you should not make yourself sound like a [help vampyre](http://slash7.com/2006/12/22/vampires/). – hlovdal Feb 17 '18 at 08:34
  • @hlovdal tnx but what i do ? – Erfan Farhadi Feb 17 '18 at 08:42

0 Answers0