{"id":26387549,"url":"https://github.com/benoitlx/apt-interface","last_synced_at":"2025-03-17T08:34:37.648Z","repository":{"id":219174396,"uuid":"748370271","full_name":"benoitlx/APT-interface","owner":"benoitlx","description":"Python Module to interface lab equipment who communicate with the Thorlabs APT protocol","archived":false,"fork":false,"pushed_at":"2024-02-16T12:47:15.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-17T11:43:16.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitlx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-25T20:38:07.000Z","updated_at":"2024-02-17T11:43:16.983Z","dependencies_parsed_at":"2024-02-14T11:34:40.738Z","dependency_job_id":null,"html_url":"https://github.com/benoitlx/APT-interface","commit_stats":null,"previous_names":["benoitlx/apt-interface"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitlx%2FAPT-interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitlx%2FAPT-interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitlx%2FAPT-interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitlx%2FAPT-interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitlx","download_url":"https://codeload.github.com/benoitlx/APT-interface/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244000889,"owners_count":20381664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-17T08:34:33.938Z","updated_at":"2025-03-17T08:34:36.045Z","avatar_url":"https://github.com/benoitlx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APT-interface\n\nA python module to interface lab equipment that communicate with the Thorlab APT protocol\n\n# Installation\n\n\u003e The package is for now on test_pypi it will be moved on pypi in times !\n\nThe package is based on the library [pyftdi](https://github.com/eblot/pyftdi) which uses `libusb 1.x` as a native dependency and thus should be installed.\n\n## Linux\n\n```bash\napt-get install libusb-1.0\n```\n\n### udev rules configuration\n\nUdev rules need to be created to communicate with devices without using administrator privilege.\nA special rule `11-ftdi.rules` is available in the `rules` directory (it might be necessary to adapt it if you want to use different devices than mine), you can copy it to `/etc/udev/rules.d` and run the following command as root :\n\n```bash\nudevadm control --reload-rules\nudevadm trigger\n```\n\n## Windows\n\nThe easiest way is to install [zadig](https://zadig.akeo.ie/) (it will detect ftdi device automatically)\n\n1. Start up the Zadig utility\n2. Select `Options/List All Devices`, then select the FTDI devices you want to communicate with. Its names depends on your hardware, _i.e._ the name stored in the FTDI EEPROM.\n - With FTDI devices with multiple channels, such as FT2232 (2 channels) and FT4232 (4 channels), you **must** install the driver for the composite parent, **not** for the individual interfaces. If you install the driver for each interface, each interface will be presented as a unique FTDI device and you may have difficulties to select a specific FTDI device port once the installation is completed. To make the composite parents to appear in the device list, uncheck the `Options/Ignore Hubs or Composite Parents` menu item.\n - Be sure to select the parent device, _i.e._ the device name should not end with _(Interface N)_, where _N_ is the channel number.\n     - for example _Dual RS232-HS_ represents the composite parent, while _Dual RS232-HS (Interface 0)_ represents a single channel of the FTDI device. Always select the former.\n3. Select `libusb-win32` (not `WinUSB`) in the driver list.\n4. Click on `Replace Driver`\n\n## Pip Install\n\nFinally, run the following command to install my package (only in test.pypi for now).\n```bash\npip install --extra-index-url https://test.pypi.org/simple/ apt-interface\n#pip install apt-interface\n```\n\n\n# Usage\n\nThe package is composed for now of 4 differents files and modules:\n - `device.py` with class `Device` a low level communication class with APT devices\n - `KPZ101.py` with class `KPZ101` and `KPZ101Config` a module with multiple function to control KPZ101 devices\n - `KSG101.py` with class `KSG101` and `KSG101Config` a module with multiple function to control KSG101 devices\n - `scan.py` with class `Scan` and `ScanConfig` a module to generate coordinates and follow them with a KPZ101 device\n\n## Simple example\n\n### Configuration\n\nHere is a simple configuration for a KPZ device\n\n```yaml\nname: X_axis_controller\nserial_nm: \"29501986\"\nbaudrate: 115200\nmode: open_loop \nvoltage_limit: 75 \n```\n\n### Usage\n\n```python\nfrom apt_interface.KPZ101 import KPZ101\n\nwith KPZ101(config_file=\"config_KPZ.yaml\") as kpz:\n    print(kpz.conf)\n    print(kpz.get_info())\n    kpz.identify() # Should make the screen of the specified KPZ blink\n\n    print(\"Warning High Voltage\")\n    kpz.enable_output()\n    kpz.set_output_voltage(20) # The KPZ needs to be configured in open_loop for voltage control\n```\n\nThe full documentation is available [here](https://benoitlx.github.io/Documentation-Stage-G1/Technique/APT-interface) (not finished yet and only in french for now)\n\nFeel free to create pull requests and add support for other devices, i will try my best to review the code and merge changes in time! You can as well add issues for any problem you encounter with implemented functions. \nThe documentation for APT protocol is available [here](https://www.thorlabs.com/Software/Motion%20Control/APT_Communications_Protocol.pdf).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitlx%2Fapt-interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitlx%2Fapt-interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitlx%2Fapt-interface/lists"}