# Syndesi Python Implementation
Syndesi description is available [here](https://github.com/syndesi-project/Syndesi/README.md)
## Installation
The syndesi Python package can be installed through pip
``pip install syndesi``
The package can also be installed locally by cloning this repository
```bash
git clone https://github.com/syndesi-project/Syndesi
cd Syndesi/Python
pip install .
```
## Usage
To instantiate a device, one must import the device and a suitable adapter
```python
# 1) Import the device
from syndesi.drivers.instruments.mutlimeters.siglent.SDM3055 import SDM3055
# 2) Import the adapter
from syndesi.adapters import IP
# 3) Instantiate the multimeter using its IP
mm = SDM3055(IP("192.168.1.123"))
## 4) Use
voltage = mm.measure_dc_voltage()
```
## Layers
The first layer is the "Device" base class
The second layer is made of "Primary drivers". First stage drivers implement mid-level communication protocols like Modbus, SDP, Raw, HTTP, SPCI, etc... Those drivers can be instanciated by the user if he wishes to use a device "as is" (i.e without an application driver)
Next are device drivers. They provide implementation for device-specific operations
Last are the application drivers. These are used to provide application-specific operations that mar or may not be tied to a particular device.
Note that both device drivers and application drivers can be omitted and can also be stacked as all first stage drivers, device drivers and application drivers stem from the same base Class
## SDP
The Syndesi Device Protocol is a light-weight and easy interface to send / receive commands with compatible devices.
## Usecases
- Test gear (multimeters, oscilloscopes, power supply, etc...)
- set values (output voltage, settings, etc...)
- get values (measured voltage, trace, screenshot)
- continuously read data (UART multimeter for instance)
- UART devices (Arduinos, etc...)
- Send / receive raw data
- Custom drivers
- Syndesi devices
- Send / receive formatted data
- USB devices
- Send / receive data using the USB protocol
## Notes
06.09.2023 : bytearray is changed to bytes everywhere
23.10.2023 : continuation timeout isn't suitable for TCP, but it can work for UDP as a UDP server can send multiple response packets after a single packet from the client. This can be handled in different ways by firewalls. Thankfull that's none of our business so continuation timeout can be implemented
22.11.2023 : The timeout and stop conditions strategy is a bit complicated :
- What if we receive the message b'ACK\nNCK\n' using a termination stop condition but we receive b'ACK', then a timeout, then b'\nNCK\n' ?
- Should the first part be kept ? should an error be raised at the timeout because nothing was read ?
- Two kinds of timeouts ?
- One where "we read as much as possible during the available time"
- One where "we expect a response within X otherwise it's trash"
Raw data
{
"_id": null,
"home_page": null,
"name": "syndesi",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, syndesi, interface, ethernet",
"author": "Sebastien Deriaz",
"author_email": "sebastien.deriaz1@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e9/28/8dc5a3da586a9d95adff7ac199c3ee962c0dc29e18797b328d24853e3e24/syndesi-0.2.3.tar.gz",
"platform": null,
"description": "# Syndesi Python Implementation\n\nSyndesi description is available [here](https://github.com/syndesi-project/Syndesi/README.md)\n\n## Installation\n\nThe syndesi Python package can be installed through pip\n\n``pip install syndesi``\n\nThe package can also be installed locally by cloning this repository\n\n```bash\ngit clone https://github.com/syndesi-project/Syndesi\ncd Syndesi/Python\npip install .\n```\n\n## Usage\n\n\n\nTo instantiate a device, one must import the device and a suitable adapter\n\n```python\n# 1) Import the device\nfrom syndesi.drivers.instruments.mutlimeters.siglent.SDM3055 import SDM3055\n# 2) Import the adapter\nfrom syndesi.adapters import IP\n\n# 3) Instantiate the multimeter using its IP\nmm = SDM3055(IP(\"192.168.1.123\"))\n\n## 4) Use\nvoltage = mm.measure_dc_voltage()\n```\n## Layers\n\nThe first layer is the \"Device\" base class\n\nThe second layer is made of \"Primary drivers\". First stage drivers implement mid-level communication protocols like Modbus, SDP, Raw, HTTP, SPCI, etc... Those drivers can be instanciated by the user if he wishes to use a device \"as is\" (i.e without an application driver)\n\nNext are device drivers. They provide implementation for device-specific operations\n\nLast are the application drivers. These are used to provide application-specific operations that mar or may not be tied to a particular device.\n\nNote that both device drivers and application drivers can be omitted and can also be stacked as all first stage drivers, device drivers and application drivers stem from the same base Class\n\n## SDP\n\nThe Syndesi Device Protocol is a light-weight and easy interface to send / receive commands with compatible devices.\n\n## Usecases\n\n- Test gear (multimeters, oscilloscopes, power supply, etc...)\n - set values (output voltage, settings, etc...)\n - get values (measured voltage, trace, screenshot)\n - continuously read data (UART multimeter for instance)\n- UART devices (Arduinos, etc...)\n - Send / receive raw data\n - Custom drivers\n- Syndesi devices\n - Send / receive formatted data\n- USB devices\n - Send / receive data using the USB protocol\n\n## Notes\n\n06.09.2023 : bytearray is changed to bytes everywhere\n\n23.10.2023 : continuation timeout isn't suitable for TCP, but it can work for UDP as a UDP server can send multiple response packets after a single packet from the client. This can be handled in different ways by firewalls. Thankfull that's none of our business so continuation timeout can be implemented\n\n22.11.2023 : The timeout and stop conditions strategy is a bit complicated :\n\n- What if we receive the message b'ACK\\nNCK\\n' using a termination stop condition but we receive b'ACK', then a timeout, then b'\\nNCK\\n' ?\n - Should the first part be kept ? should an error be raised at the timeout because nothing was read ?\n - Two kinds of timeouts ?\n - One where \"we read as much as possible during the available time\"\n - One where \"we expect a response within X otherwise it's trash\" \n",
"bugtrack_url": null,
"license": null,
"summary": "Syndesi",
"version": "0.2.3",
"project_urls": null,
"split_keywords": [
"python",
" syndesi",
" interface",
" ethernet"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "72c1fcdbcc30b0ba07730b915c3a6f543e39e05111d3400f4f29eb15d684d865",
"md5": "6758a3e62fb5f3b0b8c6f364ec0da3f1",
"sha256": "b2e472f6625ace2b03c358a1bed9da38e58684a06de17dfe2ca9ea09ba1142d5"
},
"downloads": -1,
"filename": "syndesi-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6758a3e62fb5f3b0b8c6f364ec0da3f1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 74535,
"upload_time": "2024-09-09T18:38:36",
"upload_time_iso_8601": "2024-09-09T18:38:36.922120Z",
"url": "https://files.pythonhosted.org/packages/72/c1/fcdbcc30b0ba07730b915c3a6f543e39e05111d3400f4f29eb15d684d865/syndesi-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e9288dc5a3da586a9d95adff7ac199c3ee962c0dc29e18797b328d24853e3e24",
"md5": "ed3c4bd6a5fa59cc2d1c7e85b95e15e8",
"sha256": "c45cfc89aa1ee0e490f5c5adf5e28dae8c5748c801d4a51a0657994dfdc5ae47"
},
"downloads": -1,
"filename": "syndesi-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "ed3c4bd6a5fa59cc2d1c7e85b95e15e8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 38194,
"upload_time": "2024-09-09T18:38:38",
"upload_time_iso_8601": "2024-09-09T18:38:38.924622Z",
"url": "https://files.pythonhosted.org/packages/e9/28/8dc5a3da586a9d95adff7ac199c3ee962c0dc29e18797b328d24853e3e24/syndesi-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-09 18:38:38",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "syndesi"
}