Skip to main content

E2C CLIENT

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 socket server.
See ALMA-70.35.10.14-00.00.00.00-A-ICD for the ICD between Computing/E2C Socket Server Protocol and ALMA operations.

Installation

pip install e2c-client

If installed for user only in an APEx virtual environment, it may be necessary to unset the user PYTHONPATH environment variable for the current session:

unset PYTHONPATH

Installation for development

git clone ssh://git@bitbucket.alma.cl:7999/eng/e2c-client.git
cd e2c-client
make venv
source venv/bin/activate
pip install -e .
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
e2c-client version

Monitor-related commands

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

Control-related commands

e2c-client control --help
e2c-client monitor request --host <host> --channel <channel> --node <node> --rca <RCA> --data <data> # perform AMB control request

Auxiliary tools

e2c-client tools temperature --host <host> --channel <channel> --node <node> # perform AMB monitor request for temperature
e2c-client tools revision --host <host>
e2c-client tools revision --all
e2c-client tools cmpr --host <host> # perform AMB monitor requests for Compressor status
e2c-client tools cmpr --all # obtain compressor status for all antennas
e2c-client tools cryo --host <host> # perform AMB monitor requests for Cryostat status
e2c-client tools cryo --all # obtain cryostat status for all antennas

Examples

Command-line client

List all CAN nodes (LRUs) reported by DV10 E2C

$ e2c-client monitor nodes --host dv10-e2c
Channel: 0, Node id:  0X22, ESN: 0x1080E126010800A2, LO Reference Receiver [LORR]
Channel: 0, Node id:  0X29, ESN: 0x10CD504101080009, IF Processor [IFProc]
Channel: 0, Node id:  0X2A, ESN: 0x10697E41010800D3, IF Processor [IFProc]
Channel: 0, Node id:  0X30, ESN: 0x1060264601080068, Digitizer Clock [DGCK]
Channel: 0, Node id:  0X32, ESN: 0x10CEB326010800D2, First LO Offset Generator [FLOOG]
Channel: 0, Node id:  0X40, ESN: 0x10986F4101080027, 2nd LO Synthesizer [LO2]
Channel: 0, Node id:  0X41, ESN: 0x100FA82601080076, 2nd LO Synthesizer [LO2]
Channel: 0, Node id:  0X42, ESN: 0x10E435460108006C, 2nd LO Synthesizer [LO2]
Channel: 0, Node id:  0X43, ESN: 0x10C58041010800F6, 2nd LO Synthesizer [LO2]
Channel: 0, Node id:  0X50, ESN: 0x108CFC4901080045, DTS Transmitter Module [DTX]
Channel: 0, Node id:  0X51, ESN: 0x1090D84901080084, DTS Transmitter Module [DTX]
Channel: 0, Node id:  0X52, ESN: 0x1007F149010800BB, DTS Transmitter Module [DTX]
Channel: 0, Node id:  0X53, ESN: 0x10724A41010800EB, DTS Transmitter Module [DTX]
Channel: 0, Node id:  0X60, ESN: 0x10C23E410108009E, Power Supply (analog rack) [PSA]
Channel: 0, Node id:  0X61, ESN: 0x105C3B7E020800D8, Power Supply (digital rack) [PSD]
Channel: 1, Node id:  0X24, ESN: 0x107F054A010800B3, Water Vapour Radiometer [WVR]
Channel: 1, Node id:  0X13, ESN: 0x10DA070401080072, Front End Monitor & Control [FEMC]
Channel: 1, Node id:  0X26, ESN: 0x107FB44C01080038, Frontend Power Supply [FEPS]
Channel: 1, Node id:  0X28, ESN: 0x103D754101080051, Calibration Widgets [ACD]
Channel: 2, Node id:  0X25, ESN: 0x104D994C010800AF, Compressor [CMPR]

Request AMBSI temperature monitor point of DV10 LORR (raw data)

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

Request AMBSI temperature of DV10 LORR (utility function)

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

Get E2C processor temperature in degrees Celsius (response data is a 4 bytes float, according to ICD):

$ e2c-client monitor request --host dv10-e2c --channel 5 --node 0x16 --rca 0x0E --interpret ">f"
Error: 0  (No error)
Data:
0x42, 0x28, 0x74, 0x92
Interpreted data:
42.11383819580078

Set BB attenuators on IFP0 of DA63 to A:12 dB, B:12.5 dB, C:9 dB, D:8.5 dB

$ e2c-client control request --host da63-e2c --channel 0 --node 0x29 --rca 0x0181 --data "0x60 0x64 0x48 0x44"

Obtain cryostat status for DV01 (e.g., after a power outage):

$ e2c-client tools cryo --host dv01-e2c

                                                                                          Cryostat AMB Monitor request (2026-05-31 03:51:52.410611)                                                                                           
┏━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Host     ┃ Supply     ┃ Pumping    ┃ Backing    ┃ Turbo     ┃ Turbo pump ┃ Gate      ┃ Solenoid   ┃  0: 4K    ┃  1: 4K     ┃  5: 15K   ┃  6: 15K    ┃  8: 15K   ┃  9: 110K   ┃ 10: 110K  ┃ 12: 110K   ┃ Vacuum    ┃ Sensor 0   ┃ Sensor 1  ┃
┃          ┃ Current    ┃ substate   ┃ pump       ┃ pump      ┃ speed      ┃ valve     ┃ valve      ┃ cryocool… ┃ plate near ┃ cryocool… ┃ plate near ┃ shield    ┃ cryocooler ┃ plate     ┃ shield top ┃ gauge     ┃ [mbar]     ┃ [mbar]    ┃
┃          ┃ [A]        ┃            ┃            ┃           ┃            ┃           ┃            ┃ [K]       ┃ link1  [K] ┃ [K]       ┃ link [K]   ┃ top [K]   ┃ [K]        ┃ near link ┃ [K]        ┃           ┃            ┃           ┃
┃          ┃            ┃            ┃            ┃           ┃            ┃           ┃            ┃           ┃            ┃           ┃            ┃           ┃            ┃ [K]       ┃            ┃           ┃            ┃           ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ dv01-e2c │ N/A        │ UNKNOWN    │ OFF        │ N/A       │ N/A        │ UNKNOWN   │ N/A        │ 3.00      │ 3.28       │ 18.03     │ 18.38      │ 18.89     │ 79.34      │ 95.17     │ 109.00     │ OFF       │ 8.06e-08   │ 3.75      │
└──────────┴────────────┴────────────┴────────────┴───────────┴────────────┴───────────┴────────────┴───────────┴────────────┴───────────┴────────────┴───────────┴────────────┴───────────┴────────────┴───────────┴────────────┴───────────┘

Use with --all to get cryostat status of all antenna elements.

Obtain helium compressor status for DV01:

$ e2c-client tools cryo --host dv01-e2c

                                                                                        Compressor AMB Monitor request (2026-05-31 03:55:13.151434)                                                                                          
┏━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Host     ┃ Compress… ┃ Compress… ┃ Line      ┃ Line      ┃ Compress… ┃ Compress… ┃ Compress… ┃ Compress… ┃ Compress… ┃ Compress… ┃ Time      ┃ Time      ┃ Fault     ┃ Compress… ┃ Compress… ┃ Compres… ┃ Compress… ┃ Compres… ┃ Compress… ┃
┃          ┃ Drive     ┃ Interlock ┃ Pressure  ┃ Pressure  ┃ Temp 1    ┃ Temp 2    ┃ Temp 3    ┃ Temp 4    ┃ Aux 2     ┃ ECU Type  ┃ since     ┃ since     ┃ Status    ┃ Alarms    ┃ Alarms    ┃ ICCU     ┃ ICCU      ┃ FETIM    ┃ FETIM     ┃
┃          ┃           ┃           ┃ Supply    ┃ Return    ┃ [C]       ┃ [C]       ┃ [C]       ┃ [C]       ┃ [mA]      ┃           ┃ last      ┃ last      ┃ Error     ┃ Pressure  ┃ Temperat… ┃ Error    ┃ Error     ┃ Error    ┃ Error     ┃
┃          ┃           ┃           ┃ [mPa]     ┃ [mPa]     ┃           ┃           ┃           ┃           ┃           ┃           ┃ power ON  ┃ power OFF ┃           ┃           ┃           ┃ Status   ┃ Cable     ┃ Status   ┃ Cable     ┃
┃          ┃           ┃           ┃           ┃           ┃           ┃           ┃           ┃           ┃           ┃           ┃ [Sec]     ┃ [Sec]     ┃           ┃           ┃           ┃          ┃           ┃          ┃           ┃
┡━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━┩
│ dv01-e2c │ OFF       │ Override  │ 2.06      │ -1.00     │ 332.91    │ 332.91    │ 332.91    │ 332.91    │ 0.25      │ European  │ 42949672… │ 42949672… │ True      │ False     │ False     │ True     │ True      │ True     │ True      │
│          │           │           │           │           │           │           │           │           │           │ unit      │           │           │           │           │           │          │           │          │           │
└──────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴──────────┴───────────┴──────────┴───────────┘    

Use with --all to get compressor status of all antenna elements.

Python library

>>> import e2c_client
>>> with E2CClient(host="dv10-e2c", port=2000, verbose=False) as client:    
>>>     # 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

WARNING: the e2c-client library does not (currently) support any rate limitation when communicating with the E2C module. Exercise caution when sending monitoring (or control) requests in a loop to avoid potentially overloading the channel. Always add a reasonable delay (e.g., time.sleep(1)) in each iteration.

TODO

Feel free to contribute on the following pending tasks:

  • Improve error handling
  • Add real testing pytest template files.
  • Code additional auxiliary/support functions for critical recovery tasks like cryostat temperature and pressure monitoring, power supply status, etc.
  • Real-time console plotting.

Metadata

Release files for e2c-client 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for e2c-client 0.2.2
File Size Uploaded Provenance Actions
e2c_client-0.2.2.tar.gz 28.5 kB Without provenance Details for e2c_client-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for e2c-client 0.2.2
File Interpreter ABI Platform Actions
e2c_client-0.2.2-py3-none-any.whl Python 3 none any Details for e2c_client-0.2.2-py3-none-any.whl

Total release size: 56.7 kB

Release files / e2c_client-0.2.2.tar.gz

Download URL e2c_client-0.2.2.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9099f371cf863ce72f562b30657056ef23efeefcb1f08537661a2bd9d8338085
BLAKE2b-256 checksum
How to use checksums
4de88c5efec17c77817bb9e3803971347765d3028dc587f7c9912bd5f8b9ea77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / e2c_client-0.2.2-py3-none-any.whl

Download URL e2c_client-0.2.2-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7d42900ed39ac4b0f14810dcf013e31ce5224695e0b56b39edfdb0c913744b8
BLAKE2b-256 checksum
How to use checksums
e8a900a7545a51b4ff0b6589811b54cbb7a1eb8423dfad1c2d28181f1bd0926d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for e2c-client 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page