LILYGO T-Call ESP32 with SIM800L

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

I learned you can remove the PIN from your SIM card with your phone, which is exactly what I did. Now the yaml I posted works perfectly for sending and receiving. Fantastic!

which SIM800 board you buyed?

  • ch340k v15
  • ch9102 v1.4
  • cp2104 v1.4
1 Like

Manufactured 20-8-11 . It says “1.4” on it

Hi,
I tried to send SMS using service in this way, but it seems to don’t works…

service: ESPHome: combinatoregsm_send_sms
recipient: +39xxxxxxxxxxxxx
message: 'Hello word'

this configuration of ESPHOME:

esphome:

  name: combinatoregsm

ota:

  safe_mode: true

 

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

esp32:

  board: esp32dev

  framework:

    type: arduino

# Enable logging

logger:

  level: verbose

  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;'

    - service: dial

      variables:

        recipient: string

      then:

        - sim800l.dial:

            recipient: !lambda 'return recipient;'

    - service: connect

      then:

        - sim800l.connect

    - service: disconnect

      then:

        - sim800l.disconnect

    - service: send_ussd

      variables:

        ussdCode: string

      then:

        - sim800l.send_ussd:

            ussd: !lambda 'return ussdCode;'

text_sensor:

  - platform: template

    id: sms_sender

    name: "Sms Sender"

  - platform: template

    id: sms_message

    name: "Sms Message"

  - platform: template

    id: caller_id_text_sensor

    name: "Caller ID"

  - platform: template

    id: ussd_message

    name: "Ussd Code"

uart:

  baud_rate: 9600

  tx_pin: TX

  rx_pin: RX

sim800l:

  on_sms_received:

    - lambda: |-

        id(sms_sender).publish_state(sender);

        id(sms_message).publish_state(message);

  on_incoming_call:

    - lambda: |-

        id(caller_id_text_sensor).publish_state(caller_id);

  on_call_connected:

    - logger.log:

        format: Call connected

  on_call_disconnected:

    - logger.log:

        format: Call disconnected

  on_ussd_received:

    - lambda: |-

        id(ussd_message).publish_state(ussd);

but I don’t find nothing in the logs…

Hello.

I removed the pin from my SIM, but still getting the error Not ack. 3 ERROR.

I also bought a second unit of T-CALL and inserted a second sim card. There I have another problem: (see screenshot)

sorry I can’t help. i am not sending SMS’s anymore with this board.

How do you send the SMS now?

I don’t send SMS’s anymore at all. I am content with the Home Assistant app via Nabucasa. I was planning on overcoming internet outages with SMS, but I have paused that project.

Hi I have this board,

Could someone help me to send a SMS via a Binary Sensor?

I am not sure where to put the phone number etc.

Thanks