jakhax / raspberry-pi-sim800l-gsm-module

connecting the raspberry pi to sim8ool gsm module to send, receive sms, delete sms etc.
MIT License
51 stars 28 forks source link

ERROR when sending sms #6

Closed caginbektas closed 2 years ago

caginbektas commented 2 years ago

Hi,

I am not sure if you have support for the following devices, but I get ERROR when I try to send an SMS

Device : Raspberry PI 4 Model B Module : SIM800L V2.0 (https://www.amazon.com/SIM800L-Wireless-Module-Quad-Band-Antenna/dp/B07PSKDBKJ)

I have the following wiring: image

Code:

from sim800l import SIM800L
sim800l=SIM800L('/dev/ttyS0') 
sms="Hello there"
sim800l.send_sms('+xxxxxxxxxxxxx',sms)

Could you please help me for identifying the issue? Thanks

caginbektas commented 2 years ago

This is the output from the python script that you shared in the other issue

image

it says SIM not inserted which is weird, it is literally inserted. I heard the click sound when I put it to the tray. Do I need to activate anything with the carrier? It is a standard prepaid Vodafone card with enough credit in it

caginbektas commented 2 years ago

I took the card off and put it back, sim not inserted error disappeared, here what I get:

image

No sms, Sim reader restarts itself after every 13 blinks

jakhax commented 2 years ago

Hi.

can you share the response for the +CMGS command i.e screenshot only shows until the > Test line. I would also try different phone number format.

Also do confirm that:

caginbektas commented 2 years ago

Hi, thanks for the answer.

Here is the code I ran: image

Here is the response: image

jakhax commented 2 years ago

Seems like the modem is compatible.(2.5G is GPRS)

usually it takes a few seconds before the modem recognizes the sim, typically you would poll +CPIN with timeouts.

Though the output i was asking for is the one from this script https://github.com/jakhax/raspberry-pi-sim800l-gsm-module/issues/4#issuecomment-750881426, the screenshot you shared earlier only showed the output till the > Test line and I would like to know whether +CMGS in that executed successfully +CMGS: <ref>\r\nOK or there was an error.

I would also check for the following

jakhax commented 2 years ago

Also try debugging using +COPS to get operator info & +CREG to check network registration status

AT+CREG? – to get network registration information. second parameter in response should be 1 or 5 for roaming
AT+COPS? – returns currently registered operator details
AT+COPS=? – returns all the operators available

Remember to also check signal quality with AT+CSQ anything between 5-31 should be good if not check your antenna is plugged in correctly, though location is a factor too.

For more information see AT datasheet https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf

Does the module come with LED Status Indicator, if so you could also use it to know whether the modem has connected to the cellular network, for example on my module Blinking every other 3s means The module has made contact with the cellular network & can send/receive voice and SMS.

caginbektas commented 2 years ago

well, I burnt the module out accidentally :D I am closing this PR, I will get a new one and will try again. I am planning to go with a >3G modem tho. Thanks for your effort for investigating the issue with me Jack! I appreciate it