Skip to main content

Wrapper interfaces to interact with Backend to/from Gateway API.

Project description

Wirepas Mesh Messaging

This Python wheel contains the generated code to interact with Wirepas Mesh Network through the Gateway to Backend API. It offers an easy way to use the API in Python without the need to build the protobuf files yourself

Installation

Install from PyPi

This package is available from PyPi.

    pip install wirepas-mesh-messaging

From the source

This wheel can be built from source directly. Flow will be described here but can already be seen from this repository Github action.

Usage example

Create a message to be sent to a Gateway in protobuf format

>>> import wirepas_mesh_messaging as wmm

>>> downlink_message = wmm.SendDataRequest(dest_add=1234, src_ep=10, dst_ep=10, qos=0, payload=bytes.fromhex("0102ABCD"))

# downlink_message.payload can be published on right topic (protobuf formatted)
>>> downlink_message.payload
b'\n\x1e2\x1c\n\x0b\x08\x8e\xac\x9c\xbf\xab\x95\xbd\xf6\xfe\x01\x10\xd2\t\x18\n \n(\x002\x04\x01\x02\xab\xcd'

Parse a Wirepas message received from a Gateway in protobuf format

>>> import wirepas_mesh_messaging as wmm

# payload is the payload received from mqtt (protobuf formatted)
# Let's assume it was created like this on Gateway side:
# wmm.ReceivedDataEvent(gw_id="Gw1", sink_id="sink0", rx_time_ms_epoch=1608644981000, src=1234, dst=1, src_ep=10, dst_ep=10, travel_time_ms=128, qos=1).payload

>>> uplink_message = wmm.ReceivedDataEvent.from_payload(payload)

>>> print(uplink_message)
{'gw_id': 'Gw1', 'sink_id': 'sink0', 'event_id': 12527549978202166391, 'rx_time_ms_epoch': 1608644981000, 'source_address': 1234, 'destination_address': 1, 'source_endpoint': 10, 'destination_endpoint': 10, 'travel_time_ms': 128, 'qos': 1, 'data_payload': None, 'data_size': None, 'hop_count': 0}

Services API documentation

Please refer to the backend apis repository for documentation on the Gateway to Backend API.

License

Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

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

wirepas_mesh_messaging-1.1rc2.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wirepas_mesh_messaging-1.1rc2-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file wirepas_mesh_messaging-1.1rc2.tar.gz.

File metadata

  • Download URL: wirepas_mesh_messaging-1.1rc2.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for wirepas_mesh_messaging-1.1rc2.tar.gz
Algorithm Hash digest
SHA256 33ee69c76ada6ecd829c55fc23aab127e73c56e79bd6528fd00c9a4acb4d8b5e
MD5 ecc99ec5080cb172a26e048ab39cf366
BLAKE2b-256 9d1a14e9a1ba9ded9b934dda134f84b8d6af64e8f2d72224d87ac55781b99788

See more details on using hashes here.

File details

Details for the file wirepas_mesh_messaging-1.1rc2-py3-none-any.whl.

File metadata

  • Download URL: wirepas_mesh_messaging-1.1rc2-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for wirepas_mesh_messaging-1.1rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 a7781618e0fc982cb1d921030d8200d754f0c041485eea294167c92b607e4c3e
MD5 c3a41195ff68162ba695b1855550f1bc
BLAKE2b-256 592ebd6917f52d68fe160bcbf6ea27868fadb7050e887759c1532ff62bf2ab6a

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