API for Huawei LAN/WAN LTE Modems rewritten from original Python library into PHP you can use this to simply send SMS, get information about your internet usage, signal, and tons of other stuff
(Device must support NETWork mode aka. "HiLink" version, it wont work with serial mode)
(probably will work for other Huawei LTE devices too)
$ composer require icetee/huawei-lte-api-php
<?php
declare(strict_types=1);
include 'vendor/autoload.php';
use Icetee\HuaweiAPI\Connection;
use Icetee\HuaweiAPI\Options\ConnectionOptions;
use Icetee\HuaweiAPI\Endpoints\Sms;
$connectionOptions = new ConnectionOptions();
$connectionOptions->setUrl('http://192.168.8.1');
$connectionOptions->setUsername('admin');
$connectionOptions->setPassword('YOUR_PASSWORD');
$connection = new Connection($connectionOptions);
$device = new Device($connection);
echo json_encode($device->information());
NOTICE: It is in development. Simple calls have been resolved for now. Complex parameters such as DateTime, Enum are not resolved.
The entry point for the docker is the docker/api.php
file. The first parameter is the name of the class. The second parameter is the method name of the class. Everything else is a parameter of the method.
docker run --env HUAWEI_API_PASSWORD=__PASSWORD__ --rm icetee/huawei-lte-api-php:latest Endpoints\Device informations
Examples:
docker build -f Dockerfile.dev --tag huawei-lte-api-php:latest .
docker run -it --rm -v $(pwd):/app huawei-lte-api-php:latest sh