Skip to main content

ALMA Ethernet-To-CAN socket server Python client package for LRU monitoring and control.

Project description

e2c-client

ALMA Ethernet-To-CAN socket server Python client package for LRU monitoring and control.

The e2c-client package provides an application and libraries for CAN-based monitoring and control of hardware devices through the Ethernet-To-CAN module.

Installation

pip install e2c-client

If installed for user only, it may be necessary to modify PATH accordingly by running:

export PATH=$PATH:$HOME/.local/bin/

Installation for development

git clone ssh://git@bitbucket.alma.cl:7999/eng/e2c-client.git
cd e2c-client
make venv
source venv/bin/activate
e2c-client --help

Usage

Following is a non-exhaustive list of available commands, for illustrative purposes only. Use the following command for all available options:

e2c-client --help

Monitor-related commands

e2c-client --help
e2c-client version
e2c-client monitor --help
e2c-client monitor request --host <host> --channel <channel> --node <node> --rca <RCA> # perform AMB monitor request
e2c-client monitor temperature --host <host> --channel <channel> --node <node> # perform AMB monitor request for temperature
e2c-client monitor nodes --host <host> # list all nodes and ESNs reported by E2C

Examples

Command-line client

$ e2c-client monitor nodes --host dv10-e2c
Channel: 0, Node id: 0x22, ESN: 0x1080E126010800A2
Channel: 0, Node id: 0x29, ESN: 0x10CD504101080009
Channel: 0, Node id: 0x2a, ESN: 0x10697E41010800D3
Channel: 0, Node id: 0x30, ESN: 0x1060264601080068
Channel: 0, Node id: 0x32, ESN: 0x10CEB326010800D2
Channel: 0, Node id: 0x40, ESN: 0x10986F4101080027
Channel: 0, Node id: 0x41, ESN: 0x100FA82601080076
Channel: 0, Node id: 0x42, ESN: 0x10E435460108006C
Channel: 0, Node id: 0x43, ESN: 0x10C58041010800F6
Channel: 0, Node id: 0x50, ESN: 0x108CFC4901080045
Channel: 0, Node id: 0x51, ESN: 0x1090D84901080084
Channel: 0, Node id: 0x52, ESN: 0x1007F149010800BB
Channel: 0, Node id: 0x53, ESN: 0x10724A41010800EB
Channel: 0, Node id: 0x60, ESN: 0x10C23E410108009E
Channel: 0, Node id: 0x61, ESN: 0x105C3B7E020800D8
Channel: 1, Node id: 0x24, ESN: 0x107F054A010800B3
Channel: 1, Node id: 0x13, ESN: 0x10DA070401080072
Channel: 1, Node id: 0x26, ESN: 0x107FB44C01080038
Channel: 1, Node id: 0x28, ESN: 0x103D754101080051
Channel: 2, Node id: 0x25, ESN: 0x104D994C010800AF

$ e2c-client monitor request --host dv10-e2c --channel 0 --node 0x22 --rca 0x30003
Error: 0
Data: 
0x55, 0x0, 0x8, 0x10

$ e2c-client monitor temperature --host dv10-e2c --channel 0 --node 0x22 
Temperature: 42.1875 [C]

Python library

>>> import e2c_client
>>> client = e2c_client.E2CClient("dv10-e2c")
>>>
>>> # LORR on bus 0, node 0x22, relative CAN address 0x30003 (GET_AMBIENT_TEMPERATURE), mode 0 (monitor):
>>> error, data = client.send_request(resource_id=0, bus_id=0, node_id=0x22, can_addr=0x30003, mode=0, data=b"")
>>> print(", ".join(hex(b) for b in data))
0x54, 0x0, 0x9, 0x10
>>>
>>> # LORR on bus 0, node 0x22, relative CAN address 0x00082 (SET_CLEAR_FLAGS), mode 1 (control):
>>> error, data = client.send_request(resource_id=0, bus_id=0, node_id=0x22, can_addr=0x00082, mode=1, data=b"\x01")
>>>
>>> # Get E2C internal monitor point (GET_SERIAL_NUMBER, i.e., MAC address):
>>> error, data = client.send_request(resource_id=0, bus_id=client.E2C_INTERNAL_CHANNEL,node_id=client.E2C_INTERNAL_NODE, can_addr=0x0000, mode=0, data=b"")
>>> print(", ".join(hex(b) for b in data))
0x0, 0xc, 0x69, 0xff, 0x0, 0xad, 0x0, 0x0

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

e2c-client-0.1.3.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

e2c_client-0.1.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file e2c-client-0.1.3.tar.gz.

File metadata

  • Download URL: e2c-client-0.1.3.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for e2c-client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 154878915e6648e63cf6d6ebbaff37d53e02e659efaec057385bd131081265fa
MD5 3dced8cb2c79eb979a25a112dbaeefc4
BLAKE2b-256 4c48de8e0669a82fb2815e12decf39c2ef53e4823e9a46317485aa324d28cc4c

See more details on using hashes here.

File details

Details for the file e2c_client-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: e2c_client-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for e2c_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 484bfe42148a38cd59804e896092b67660cf98034fc5720046a303209abc76ff
MD5 1f26765488d1cd654e81f7992888725a
BLAKE2b-256 61e112e0d5364b6029b8d9e16f9183e16c71acda6b6af597533b12731832746e

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