chabisik f9740deada Modifying function | 1 year ago | |
---|---|---|
__pycache__ | 1 year ago | |
images | 1 year ago | |
LICENSE | 1 year ago | |
Makefile | 1 year ago | |
README.md | 1 year ago | |
README_.md | 1 year ago | |
datasaver.py | 1 year ago | |
etc-wpa_supplicant-wpa_supplicant.conf | 1 year ago | |
executor_esp32.ino | 1 year ago | |
fail.html | 1 year ago | |
index.html | 1 year ago | |
manage_gpio.py | 1 year ago | |
myapp.py | 1 year ago | |
rootmystarter.sh | 1 year ago | |
sim800l.py | 1 year ago | |
sim800lCommandLine.py | 1 year ago | |
success.html | 1 year ago |
SIM900/SIM800 are 2G only modems, make sure your provider supports 2G as it is already being phased out in a lot of areas around the world, else a 3G/4G modem like the SIM7100 / SIM5300 is warranted.
We will start by disabling serial console to enable communication between the pi and sim800l via serial0 .
Open the terminal on your pi and run sudo raspi-config
Select Interfaces → Serial
Select No to the 1st prompt and Yes for the 2nd.
from sim800l import SIM800L
sim800l=SIM800L('/dev/serial0')
sms="Hello there"
#sim800l.send_sms(dest.no,sms)
sim800l.send_sms('2547xxxxxxxx',sms)
#sim800l.read_sms(id)
sim800l.read_sms(id)
def print_delete():
#assuming the sim has no sms initially
sms=sim800l.read_sms(1)
print(sms)
sim800l.delete_sms(1)
sim800l.callback_msg(print_delete)
while True:
sim800l.check_incoming()