Skip to main content

API for the delimux device

Project description

README

PyPI

The delimux module provides a streamlined communication with the socket server running on the delimux Raspberry Pi. On the delimux Raspberry Pi, a MUX36S08 analog multiplexer is connected via custom designed hat. It allows the user to route an incoming electrical signal in the range between 0V and 40V onto one of seven lines in a patch cable. The raw communication protocol is shown below. The delimux module wraps this into a set of convenience function.

Installation

pip install delimux

How to use

The usage should be self-explanatory:

import delimux
mx=delimux.DeliMUX()
help(mx)
class DeliMUX(builtins.object)
 |  DeliMUX(host='delimux-cmtqo', port=60606, verbose=False)
 |  
 |  Client for controlling a MUX36S08 device via socket protocol.
 |  
 |  Server is expected to run on delimux-cmtqo:60606
 |  and respond to newline-terminated commands like SET, GET, ENABLE, etc.
 |  
 |  Methods defined here:
 |  
 |  __init__(self, host='delimux-cmtqo', port=60606, verbose=False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  disable(self)
 |  
 |  enable(self)
 |  
 |  getChannel(self) -> int
 |  
 |  getLine(self) -> int
 |  
 |  getState(self) -> list
 |  
 |  setChannel(self, n: int)
 |      Sets the channel 
 |      
 |      Channel refers to the channel of the MUX36S08
 |  
 |  setLine(self, n: int)
 |      Sets the line 
 |      
 |      Line refers to the patch-cable line, line 8 is GND
 |  

Raw protocol

Via a direct socket connection the full protocol can be exploited:

Commands are terminated with \r\n or \n.

Command Description Response Format
SET <n> Sets the MUX channel to n (0–7) and enables it OK or ERROR <message>
GET Returns full state as 3 address bits + enable bit STATE <A2> <A1> <A0> <EN>
CHANNEL Returns the currently selected channel number CHANNEL <n>
ENABLE Enables the MUX OK
DISABLE Disables the MUX OK
(unknown) Any invalid or unsupported command ERROR Unknown command

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

delimux-0.0.8.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

delimux-0.0.8-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file delimux-0.0.8.tar.gz.

File metadata

  • Download URL: delimux-0.0.8.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for delimux-0.0.8.tar.gz
Algorithm Hash digest
SHA256 0826fb7375c6487969b93ba65eb10fdeb71187d68683832ac6ade509c82324e3
MD5 d9a67a4606e835a1595298108c2305ad
BLAKE2b-256 494ef0573839be73c507abdeda11a253138c3520187401a6f7639641c96b7568

See more details on using hashes here.

File details

Details for the file delimux-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: delimux-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for delimux-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a63b3ae82419993df55199b4446cc22ea316709c98d4f97e7b9b746acb752738
MD5 5fd207a7ab77ac88b41b873c0ef3a3d2
BLAKE2b-256 a6bfe1f4440be46b53baa5e466100265ebaa17990fce1be285e1232f148bdf3d

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