Jump to content
  • 0

Hero 4G+ (KN-2311). SMS gateway, SMS API and AT commands


Question

Posted

Hallo,

Is it possible to use the Hero 4G to manage SMS via a API or AT commands? I would like to use a Raspberry connected to the router to list, send and receive SMS without using the router's web interface. Does the Hero 4G suppports AT commands? Are AT commands accessible? How could the Raspberry communicate with the router? If possible, can you provide some links or examples to understand?

Thank you, regards.

1 answer to this question

Recommended Posts

  • 0
Posted
3 hours ago, Enrico said:

Hallo,

Is it possible to use the Hero 4G to manage SMS via a API or AT commands? I would like to use a Raspberry connected to the router to list, send and receive SMS without using the router's web interface. Does the Hero 4G suppports AT commands? Are AT commands accessible? How could the Raspberry communicate with the router? If possible, can you provide some links or examples to understand?

Thank you, regards.

Hello, Enrico!

Yes, it is possible to send and list received SMS via the REST API.
The easiest way to do it is to see how the web interface interacts with the router.

I wrote an extended explanation for USSD requests here:

Commands for reading/sending SMS are quite similar (sms {interface} list, sms {interface} send, sms {interface} delete, sms {inteface} read).

Spoiler

You can see the name of the interface you need to use in the web interface URL if you go to the Mobile page in the web UI:

image.png

 

 

A simple example:

Spoiler

Request:

POST http://<router IP>/rci/

{
    "sms": {
        "list": {
            "interface": "UsbLte0"
        }
    }
}


Response (I don't have any messages on my router right now):

{
    "sms": {
        "list": {
            "nv-free-slots": 200,
            "nv-total-slots": 200,
            "sim-free-slots": 10,
            "sim-total-slots": 10,
            "messages-count": 0
        }
    }
}


A few extra notes:

- you need to be authorized on the Keenetic to send the requests;
   the auth process is described here (in Russian): https://forum.keenetic.ru/topic/5461-не-работает-digest-авторизация-для-rci/#findComment-62946
   preserve session cookies while sending follow-up GET requests

- don't forget to set the Content-Type HTTP header for your requests (Content-Type: application/json)

 

  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...