Strange SMS received once a month

Subject of the issue

I have the script from @plord that forwards SMS from my AutoPi to Telegram.
It workes great, however I also recive two mystery messages beginning of every month around the same date. I got them just now again. It only happens when the sim-card is in the AutoPi, I tried to take it out and put it in a phone for two months and I got no extra messages.
The messages are always the same except for the second message where the digits change.

SMS From: 67111109118105113
Date: 20/08/07,10:49:56 08

SMS From: 67111109118105113
Date: 20/08/07,10:49:56 08


Your environment


Steps to reproduce

Not sure, can only reproduce it when the Sim-card is in the AutoPi.
This is the script:

import logging
import requests
import os
import re

log = logging.getLogger(__name__)

# Telegram tokens - see
bot_token = ***Removed***
bot_chatID = ***Removed***

def forward():
    Poll for sms and forward to telegram

    Once sent, delete from autopi


    args = ['AT+CMGL="ALL"']
    res = __salt__['ec2x.query']('AT+CMGL="ALL"')
    if 'data' in res:
        allmessages = parse(res['data'])
        for message in allmessages:
   ("SMS: "+message['message'])
            bot_sendtext('SMS From: '+message['from']+'\nDate: '+message['date']+'\n\n'+message['message'])
    return {"msg": "Forward finished"}

# parse output to an array of dictionary
def parse(x):
    res = []
    i = 0
    while i < len(x):
        m = re.match('\+CMGL: (\d+),\"(.+)\",\"(.+)\",(.*),\"(.+)\"', x[i])
        if m:
   ("SMS: No match "+x[i])
        i += 2
    return res

# send message to telegram
def bot_sendtext(bot_message):
    send_text = '' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse_mode=Markdown&text=' + bot_message

As far as I can see it just picks up the SMS so should not generate anything else.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.