Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR when sending sms #6

Closed
caginbektas opened this issue Feb 1, 2022 · 7 comments
Closed

ERROR when sending sms #6

caginbektas opened this issue Feb 1, 2022 · 7 comments

Comments

@caginbektas
Copy link

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
Copy link
Author

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
Copy link
Author

caginbektas commented Feb 2, 2022

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
Copy link
Owner

jakhax commented Feb 3, 2022

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:

  • Your carrier supports 2G as sim800l is a 2G only modem which in some countries is already phased out.
  • modem supports the cellular bands in your country for example for GSM-900 and GSM-1800 for EMEA region & GSM-850 and GSM-1900 in most of North, South and Central America. The one you have is Quad-band 850/900/1800/1900MHz, should be good, but just confirm that at least one of this bands is supported in your region

@caginbektas
Copy link
Author

Hi, thanks for the answer.

Here is the code I ran:
image

Here is the response:
image

  • I tried a different number format - did not work
  • I totally missed that it is compatible with 2G
  • The band seems fine, also here it says 2.5G is supported (not sure how accurate is that data)

@jakhax
Copy link
Owner

jakhax commented Feb 3, 2022

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 #4 (comment), 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

  • GSM antenna
  • Power requirements
    • Current: I wouldn't trust the Pi can supply enough current, I have seem this modems consume upto 2A peek especially during RF transmission
    • Voltage: some SIM800L modules are rated for 3.7V – 4.2V, this cannot be powered directly via the Pi's 5V line without some sort of voltage regulator

@jakhax
Copy link
Owner

jakhax commented Feb 3, 2022

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants