npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nickiv/node-red-huawei-sms

v0.1.0

Published

Nodes to send and receive SMS from Huawei LTE USB Stick

Downloads

38

Readme

Node-RED Huawei LTE USB Stick SMS Module

image of example flow image of Huawei LTE USB Stick

Overview

This module provides nodes that enable the sending and receiving of SMS messages using the Huawei LTE USB Stick E3372 in a Node-RED environment.

To use this module, ensure that the USB stick is connected to a computer running Node-RED as a network adapter. The module sends commands for sending or receiving SMS via HTTP requests to the integrated web server of the USB stick.

For proper functioning, you need to provide the password for the web admin interface of the USB stick.

During the development of this module, I conducted research on how the web admin interface works, leveraging browser inspector tools. Although I couldn't find an official API, I discovered helpful projects on GitHub. The most challenging aspect was implementing the authorization process.

The code of the module is structured to maintain only one session with each stick at any given moment. All requests are executed in sequence to prevent potential issues. It was observed that multiple sessions or simultaneous requests could lead to problems, such as an authorization request failure with the message "Already authorized."

You can use this module to:

  • Forward SMS to email or Telegram or whatever channel Node-RED can use
  • Send SMS notifications from Node-RED flows
  • Receive SMS commands in Node-RED flows
  • Send arbituary API requests to device

I tested this module for several months on couple of devices E3372h-320 with firmware 11.0.1.1(H697SP1C00). I consider it to be fairly reliable for home use. It is possible that it will work with other devices which run the same integrated web server (called HiLink).

For clarity I'm not related in any way with Huawei.

Compatible devices

This module also works fine with other Huawei devices:

  • E8231s-2

Install

$ npm install @nickiv/node-red-huawei-sms

Usage

Receive SMS

To receive an SMS drag Receive SMS node to flow. Add SMS config node or select the one you set up earlier. Upon receiving an SMS node will emit an object containing message with some metadata. New messages are checked every 20 seconds. Received messages are being deleted from Inbox of the stick. When flow starts all messages that are currently in the Inbox will be emitted.

Send SMS

To send an SMS drag Send SMS node to flow. Add SMS config node or select the one you set up earlier. Specify target phone number in the node properties. Upon receiving a message with string payload, node will try to send it as SMS to specified target phone. Result of the operation will be set as message payload on output.

Sent messages are being deleted from Outbox of the stick.

Generic API Request

The Generic API Request node allows you to send custom requests to a device's API. The module handles authentication and session management for you. Examples of available API requests can be found here.

Please note that not all requests are compatible with every device, so you'll need to experiment to find what works for yours. Keep in mind that POST requests must include an XML body with a root <request> element. The API response will also be in XML format, so it's recommended to pair this node with the XML node for processing.

image of example flow with Generic API Request

For example, you can use the Generic API Request node to:

  • Retrieve signal strength via GET device/status.
  • Check traffic counters via GET monitoring/traffic-statistics.

Feedback

If something doesn’t work as expected or you have suggestions for improvements, feel free to open a Pull Request. Your contributions are always welcome!