I can’t get my T-call to send an SMS and I am wondering do you need to present the SIM PIN to the network to make it work? I certainly need to do that if I plug the SIM Card into my (French) phone.
When programming without ESPHOME it seems it might be necessary: ESP32 SIM800L: Send Text Messages (SMS Alert) with Sensor Readings | Random Nerd Tutorials but Ican’t see how to do it with ESPHOME.
This is my code:
#https://community.home-assistant.io/t/esp32-sim800l-ttgo-t-call-not-working/149781/15
substitutions: !include substitutions.yaml
esphome:
name: sim800l
platform: ESP32
board: esp32dev
wifi:
ssid: $wifi_ssid
password: $wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Sim800L Fallback Hotspot"
password: $hotspot_password
captive_portal:
# Enable logging
logger:
baud_rate: 0 # disable uart logger on esp 8266
# Enable Home Assistant API
api:
services:
- service: send_sms
variables:
recipient: string
message: string
then:
- sim800l.send_sms:
recipient: !lambda 'return recipient;'
message: !lambda 'return message;'
text_sensor:
- platform: template
id: sms_sender
name: "Sms Sender"
- platform: template
id: sms_message
name: "Sms Message"
uart:
baud_rate: 9600
tx_pin: 27
rx_pin: 26
sim800l:
on_sms_received:
- lambda: |-
id(sms_sender).publish_state(sender);
id(sms_message).publish_state(message);
ota:
switch:
- platform: gpio
name: "SIM800_PWKEY"
pin: 4
restore_mode: ALWAYS_OFF
- platform: gpio
name: "SIM800_RST"
pin: 5
restore_mode: ALWAYS_ON
- platform: gpio
name: "SIM800_POWER"
pin: 23
restore_mode: ALWAYS_ON
I am getting this in the logs:
INFO Reading configuration /config/esphome/T-call.yaml...
INFO Starting log output from sim800l.local using esphome API
INFO Connecting to sim800l.local:6053 (192.168.1.74)
INFO Successfully connected to sim800l.local
[21:08:37][I][app:105]: ESPHome version 1.16.2 compiled on Apr 26 2021, 18:59:10
[21:08:37][C][wifi:443]: WiFi:
[21:08:37][C][wifi:303]: SSID: [redacted]
[21:08:37][C][wifi:304]: IP Address: 192.168.1.74
[21:08:37][C][wifi:306]: BSSID: [redacted]
[21:08:37][C][wifi:307]: Hostname: 'sim800l'
[21:08:37][C][wifi:311]: Signal strength: -57 dB ▂▄▆█
[21:08:37][C][wifi:315]: Channel: 3
[21:08:37][C][wifi:316]: Subnet: 255.255.255.0
[21:08:37][C][wifi:317]: Gateway: 192.168.1.1
[21:08:37][C][wifi:318]: DNS1: 192.168.1.1
[21:08:37][C][wifi:319]: DNS2: 0.0.0.0
[21:08:37][C][uart_esp32:088]: UART Bus:
[21:08:37][C][uart_esp32:090]: TX Pin: GPIO27
[21:08:37][C][uart_esp32:093]: RX Pin: GPIO26
[21:08:37][C][uart_esp32:094]: RX Buffer Size: 256
[21:08:37][C][uart_esp32:096]: Baud Rate: 9600 baud
[21:08:37][C][uart_esp32:097]: Data Bits: 8
[21:08:37][C][uart_esp32:098]: Parity: NONE
[21:08:37][C][uart_esp32:099]: Stop bits: 1
[21:08:37][C][template.text_sensor:020]: Template Sensor 'Sms Sender'
[21:08:37][C][template.text_sensor:020]: Template Sensor 'Sms Message'
[21:08:37][C][switch.gpio:042]: GPIO Switch 'SIM800_PWKEY'
[21:08:37][C][switch.gpio:043]: Pin: GPIO4 (Mode: OUTPUT)
[21:08:37][C][switch.gpio:059]: Restore Mode: Always OFF
[21:08:37][C][switch.gpio:042]: GPIO Switch 'SIM800_RST'
[21:08:37][C][switch.gpio:043]: Pin: GPIO5 (Mode: OUTPUT)
[21:08:37][C][switch.gpio:059]: Restore Mode: Always ON
[21:08:38][C][switch.gpio:042]: GPIO Switch 'SIM800_POWER'
[21:08:38][C][switch.gpio:043]: Pin: GPIO23 (Mode: OUTPUT)
[21:08:38][C][switch.gpio:059]: Restore Mode: Always ON
[21:08:38][C][logger:185]: Logger:
[21:08:38][C][logger:186]: Level: DEBUG
[21:08:38][C][logger:187]: Log Baud Rate: 0
[21:08:38][C][logger:188]: Hardware UART: UART0
[21:08:38][C][sim800l:259]: SIM800L:
[21:08:38][C][sim800l:260]: RSSI: 0 dB
[21:08:38][C][captive_portal:169]: Captive Portal:
[21:08:38][C][ota:029]: Over-The-Air Updates:
[21:08:38][C][ota:030]: Address: sim800l.local:3232
[21:08:38][C][api:095]: API Server:
[21:08:38][C][api:096]: Address: sim800l.local:6053
[21:08:39][W][sim800l:062]: Not ack. 3 ERROR
[21:08:54][W][sim800l:062]: Not ack. 3 ERROR
[21:09:09][W][sim800l:062]: Not ack. 3 ERROR
[21:09:24][W][sim800l:062]: Not ack. 3 ERROR
[21:09:39][W][sim800l:062]: Not ack. 3 ERROR
If I call the service I get this in the log, but no SMS received:
[21:11:33][D][sim800l:252]: Sending to +33xxxxxxx: This is Home Assistant calling +33xxxxxxx