SMS with Teltonika TRB140 via sms_api - HTTP Error 422 + timeout

CMK version: 2.4.0p16 CEE
OS version: Appliance 1.7.14

Error message: HTTPError sending SMS: 422 Client Error: Unprocessable Entity for url: …
and
Error sending SMS: HTTPConnectionPool(host=‘192.168.1.1’, port=80): Read timed out. (read timeout=30.0)

It took me quite a while to be able to send an SMS at all. Now that it works, however, I regularly receive error messages from the sms_api.
Despite the messages, the SMS messages are reaching the recipient.
Message 1:
Error sending SMS: HTTPConnectionPool(host=‘192.168.1.1’, port=80): Read timed out. (read timeout=30.0)
Message 2:
HTTPError sending SMS: 422 Client Error: Unprocessable Entity for url: , b’<!doctype html>\n\n \n <meta\n name=“robots”\n content=“noindex”\n />\n <meta charset=“utf-8” / >\n <meta\n http-equiv=“X-UA-Compatible”\n content=“IE=edge”\n />\n <meta\n http-equiv= “Cache-Control”\n content=“no-cache, no-store, must-revalidate”\n />\n <meta\n name=“viewport”\n content=“width=device-width,initial-scale=1.0”\n />\n <link\n rel=“stylesheet”\n href=“/brand/colors.css?v=1”\ n />\n <link\n rel=“stylesheet”\n href=“/brand/tokens.css?v=1”\n />\n <link\n rel=“icon”\n href=“/favicon.ico”\n />\n \n \n \n <link rel=“modulepreload”

A test with my own script (Bash and Python) to send the messages has similar problems, and I thought it was due to the script. The script was only created because the text of the SMS cannot be customized with 2.4! :angry:

The login always seems to work, and I always find a token in my log, but sending the SMS triggers errors.
For example, from my log:
Login OK – Token received. – [2025-12-09 15:27:49] Router returned 422: {“success”:false,“errors”:[{“source”:“Message sending”,“code”:2,“error”:“Failed to send message”,‘section’:“send”}]}

What I noticed is that I almost only experience the errors during the day (approx. 6 a.m. to 10 p.m.), up to three or two out of 500 messages.

Could the LTE cell or something similar be overloaded and the TRB’s API be sensitive to this?

Hello, I saw a similar problem (422) here:

However, this does not seem to be the issue because in your case the behavior is unpredictable.

I also heard about cases where the pre-paid credit of the SIM card was empty.

My only real idea would be to check the network coverage.

Alternatively, you might want to try an alerting service like SIGNL4 which supports push, SMS and voice calls. It can also use heardbeats or web-site checks to alert you in case of a missing internet connection.

Hi Ron,
Thank you for the information.
Currently (since last Friday), I no longer have any problems or 422 or other messages when sending, even though I send around 300 messages a day as a test via notifications that were triggered.
But nothing has been changed in the settings… :man_shrugging:

Hm, interesting, but good to know. I guess, since there is no obvious cause, there is still this feeling that it might fail again ….

New discovery: today I transferred a SIM card from an old USB modem (which was connected to checkmk 1.6 until today) to the TRB140.
Since then, I have 422 errors again, but messages are coming through!

However, what is noticeable on the TRB status page is that I only get a 2G connection with the old card, as the contract behind it apparently does not provide for 4G, or it may be due to the SIM card.

Unfortunately, I cannot clarify this completely, as today is my last day of work at my current company.
Maybe it will help you.