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

huawei-lte-api

v0.1.1

Published

API For huawei LAN/WAN LTE Modems

Downloads

108

Readme

huawei-lte-api-ts

API For huawei LAN/WAN LTE Modems rewritten from original Python library into TypeScript you can use this to simply send SMS, get information about your internet usage, signal, and tons of other stuff

Tested on:

3G/LTE Routers:

  • Huawei B310s-22
  • Huawei B315s-22
  • Huawei B525s-23a
  • Huawei B525s-65a
  • Huawei B715s-23c
  • Huawei B528s
  • Huawei B535-232
  • Huawei B628-265
  • Huawei B818-263
  • Huawei E5186s-22a
  • Huawei E5576-320
  • Huawei E5577Cs-321

3G/LTE USB sticks:

(Device must support NETWork mode aka. "HiLink" version, it wont work with serial mode)

  • Huawei E3131
  • Huawei E3372
  • Huawei E3531

5G Routers:

  • Huawei 5G CPE Pro 2 (H122-373)

(probably will work for other Huawei LTE devices too)

Will NOT work on:

LTE Routers:

  • Huawei B2368-22 (Incompatible firmware, testing device needed!)
  • Huawei B593s-22 (Incompatible firmware, testing device needed!)

Installation

npm

$ npm i huawei-lte-api --save

Usage

import { Connection, Device } from 'huawei-lte-api';

const connection = new Connection('http://admin:[email protected]/');

connection.ready.then(() => {
    const device = new Device(connection);

    //Can be accessed without authorization
    device.signal().then((result) => {
        console.log(result);
    }).catch((error) => {
        console.log(error);
    });

    //Needs valid authorization, will throw exception if invalid credentials are passed in URL
    device.information().then((result) => {
        console.log(result);
    }).catch((error) => {
        console.log(error);
    });
});
# For more API calls just look on code in the src/api folder, there is no separate DOC yet

Result object

{'DeviceName': 'B310s-22', 'SerialNumber': 'MY_SERIAL_NUMBER', 'Imei': 'MY_IMEI', 'Imsi': 'MY_IMSI', 'Iccid': 'MY_ICCID', 'Msisdn': None, 'HardwareVersion': 'WL1B310FM03', 'SoftwareVersion': '21.311.06.03.55', 'WebUIVersion': '17.100.09.00.03', 'MacAddress1': 'EHM:MY:MAC', 'MacAddress2': None, 'ProductFamily': 'LTE', 'Classify': 'cpe', 'supportmode': None, 'workmode': 'LTE'}
const huaweiLteApi = require('huawei-lte-api');

const connection = new huaweiLteApi.Connection('http://admin:[email protected]/');

connection.ready.then(function() {
    console.log('Ready');


    const device = new huaweiLteApi.Device(connection);
    device.signal().then(function(result) {
        console.log(result);
    }).catch(function(error) {
        console.log(error);
    });


    device.information().then(function(result) {
        console.log(result);
    }).catch(function(error) {
        console.log(error);
    });

    const dialUp = new huaweiLteApi.DialUp(connection);
    dialUp.setMobileDataswitch(1).then(function(result) {
        console.log(result);
    }).catch(function(error) {
        console.log(error);
    });
});