Skip to main content

A Python interface to the EMQx LwM2M plugin

Project description

This package provides a command line interface to the EMQx LwM2M plugin.

It supports read, discover, write, write-attr, execute, create, delete. It also has some handy features for tracking notifications, etc.

NOTE: This package is still in pre-alpha stage and backwards incompatible changes are likely in the releases prior to version 1.0.0.

Usage and command line options

usage: python3 -m emqxlwm2m [-h] [--host HOST] [--port PORT]
                         [--known-endpoints KNOWN_ENDPOINTS]
                         [--xml-path XML_PATH]
                         [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--echo]
                         [--value VALUE] [--interval INTERVAL]
                         [--timeout TIMEOUT]
[{reboot,notifications,create,write,delete,update,updates,read,discoverall,execute,registrations,cancel-observe,observe,?,discover,attr,endpoints}]
[endpoint] [path]

positional arguments:
{reboot,notifications,create,write,delete,update,updates,read,discoverall,execute,registrations,cancel-observe,observe,?,discover,attr,endpoints}
endpoint              LwM2M endpoint client name
path                  LwM2M object/instance/resource path

optional arguments:
-h, --help            show this help message and exit
--host HOST           EMQx MQTT broker host
--port PORT, -p PORT  EMQx MQTT port
--known-endpoints KNOWN_ENDPOINTS
Path to list of known endpoints. Used for interactive
selection.
--xml-path XML_PATH, -x XML_PATH
Directory with xml lwm2m object definitions. Can be
used multiple times to provide multiple paths.
-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Set the logging level
--echo                Print endpoint and path when selected with fzf.
--value VALUE, -v VALUE
Value to use in context of command.
--interval INTERVAL, -i INTERVAL
Repeat action with interval. Seconds.
--timeout TIMEOUT, -t TIMEOUT
Timeout when waiting for response. Seconds.

Installation

From PyPI:

$ python3 -m pip install emqxlwm2m

Examples

Read:

$ python3 -m emqxlwm2m --host localhost --port 18830 read urn:imei:123456789012345 /3/0/18
{'/3/0/18': '1.2.3'}

Write:

$ python3 -m emqxlwm2m write urn:imei:123456789012345 /1/0/1 --value 60

Write-attr (syntax: [pmin,pmax]lt:st:gt):

$ python3 -m emqxlwm2m attr urn:imei:123456789012345 /3/0/9 --value [60,120]5:10:95

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emqxlwm2m-0.1.0.tar.gz (23.5 kB view details)

Uploaded Source

File details

Details for the file emqxlwm2m-0.1.0.tar.gz.

File metadata

  • Download URL: emqxlwm2m-0.1.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for emqxlwm2m-0.1.0.tar.gz
Algorithm Hash digest
SHA256 75336727c52686aab955a9a4e5d0a08760482433cbb0d113852658f50ef99e1c
MD5 988c77bd7c410e8d034668443167e72e
BLAKE2b-256 5d3935f351f8042daa09d6d1d221a91a5031316c73afd6077971890cf5232947

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page