How do I send SMS messages via the ZTE MF286D MiFi device?

I'm trying to find our how to send SMS messages via the ZTE MF286D MiFi device ?
I've recently purchased this device and discovered I can manually send/receive SMS messages via the user-interface web page. What I'd like to be able to do is send SMS messages from Node-RED to my mobile phone or from an IoT node (like Wemos D1 Mini or ESP32) to my mobile.
e.g. Status information or an alarm condition. [As an alternative to using MQTT]

I heard about 'goform/goform_set_cmd_process' but haven't found much information about it.

As a starting point I've found this MicroPython script that runs (without giving any errors) but doesn't send the SMS - well it doesn't arrive on my phone. As there is so little documentation available, I'm not sure if the MF286D supports 'goform'.

import requests

def send_sms(router_ip, username, password, recipient_number, message):
    # Construct the URL for sending SMS
    url = f"http://{router_ip}/goform/goform_set_cmd_process"

    # Construct the data payload for the request
    data = {
        "isTest": "false",
        "goformId": "SEND_SMS",
        "notCallback": "true",
        "Number": recipient_number,
        "sms_time": "",
        "MessageBody": message,
        "ID": "-1",
        "encode_type": "UNICODE",
        "send_time": "",
        "flag": "4",
        "sms_priority": "0",
        "save_type": "0",
    }

    # Send the POST request to send the SMS
    response = requests.post(url, data=data, auth=(username, password))

    # Check the response status code
    if response.status_code == 200:
        print("SMS sent successfully.")
    else:
        print("Failed to send SMS.")

# Usage example
router_ip = "192.168.32.1"  # Replace with your router's IP address
username = "xxxx"         # Replace with your router's username
password = "xxxx"      # Replace with your router's password
recipient_number = "+123456789"  # Replace with the recipient's phone number
message = "Hello, this is a test SMS message from the MiFi box."

send_sms(router_ip, username, password, recipient_number, message)
    # Send the POST request to send the SMS
    response = requests.post(url, data=data, auth=(username, password))

The above script uses the 'requests' library, so I assume there may be an equivalent way of using the
http-request node in Node-RED ?

Any advice, suggestions, feedback would be greatly appreciated especially if you have this device.

Hello Dave

I don't have a MT286D, but I had a bit of spare time and took a look around the net. I found a video on youtube by an italian chap who was using javascript and goform to make changes to his MT286D, so it would appear to confirm that it does use the goform method.

HACK WEB ZTE 286 - YouTube

After that, I found this. GitHub - paulo-correia/ZTE_API_and_Hack: ZTE Modem API and Hack

It claims that it works with the MT286 (though it doesnt specify the d subtype. also in the issues, someone mentions that it doesnt work for the r subtype)

In addition, another reported issue shows that the send sms command will always return success once it has sent a message and doesnt reflect whether the msg is actually received.

Anyway, its not much, but it may help you to get your code working. the code you show above seems to be very close to what they put into their curl commands,, but I guess as ever, the devil is in the detail.

best of luck.

1 Like

Hi Martin,
Thanks for taking the time to explore this for me. As you found out, there is NOT much material published on this topic/device. The MF286D is a variant of the MTF86 and has sockets for two external antennas.

I thought it would make a nice project for some of my IoT students as they could send "information" from their Node-RED flows to their mobile phones. At the moment they use MQTT and/or Telegram, so this would demonstrate to them there are other methods available.

At home I have a number of ESP32-S2 Mini devices flashed with MicroPython and thought with a little bit of extra code I could also send "information" to a mobile device.

It's not a show stopper if I can't find out how to do it.

Just to add my 2c:

Could you monitor the browser network transfers when using the provided web interface?
This may reveal the payload it is expecting - and possibly the correct URI endpoint?

Haven't done this myself for a long, long time, but ....Edit: - OK, openWRT is supported on the MF286D and I can't find an MT286D in my side of the world) - so it's a big IF the device would support openWRT]([OpenWrt Wiki] ZTE MF286D)...if you can get through to the Modem at AT-Commands level, sending SMS can be scripted, can't it?
Used to do use this in the good old days, when analog modems were all what was available at that time.

1 Like

Thanks for the information.
Wooo - that looks like taking the box apart and soldering wires onto Tx, Rx pins.
As the box is brand new, I think I'll give that idea a miss (at the moment)

Ah, I actually did not notice that part..seems that forcing the device into a (cross) flash mode requires access to the serial console, which can only be accessed via soldering to internal pins.

...quite understandable.
But did you see my edit? Is your device a MT286D or a MF286D model? I can't find a MT286D anywhere, but if yours is, you better refrain from using openwrt at all, since this mod is for a MF286D model (I actually missed that difference in the model name and when searching for MT286D, all that comes up is the MF286D)....sorry for that.

1 Like

Oops, sorry - typo. Just checked the label on the MiFi device, mine is a ZTE MF286D

1 Like

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