{"id":16190696,"url":"https://github.com/tiagocoutinho/julabo","last_synced_at":"2025-03-19T03:30:59.546Z","repository":{"id":62573171,"uuid":"291029421","full_name":"tiagocoutinho/julabo","owner":"tiagocoutinho","description":"Python library to control Julabo equipment","archived":false,"fork":false,"pushed_at":"2022-11-07T15:13:57.000Z","size":14480,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T15:08:45.105Z","etag":null,"topics":["julabo","library","python","serial-communication","serialport","tango"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiagocoutinho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-28T11:27:39.000Z","updated_at":"2024-11-10T20:07:42.000Z","dependencies_parsed_at":"2023-01-21T06:02:07.669Z","dependency_job_id":null,"html_url":"https://github.com/tiagocoutinho/julabo","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocoutinho%2Fjulabo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocoutinho%2Fjulabo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocoutinho%2Fjulabo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagocoutinho%2Fjulabo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiagocoutinho","download_url":"https://codeload.github.com/tiagocoutinho/julabo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965775,"owners_count":20375917,"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":["julabo","library","python","serial-communication","serialport","tango"],"created_at":"2024-10-10T07:43:58.268Z","updated_at":"2025-03-19T03:30:57.658Z","avatar_url":"https://github.com/tiagocoutinho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Julabo library\n\n\u003cimg align=\"right\" alt=\"Julabo CF31\" width=\"280\" src=\"docs/cf31.png\" /\u003e\n\nThis library is used to control basic features of Julabo equipment. It is\ncomposed of a core library, an optional simulator and an optional\n[tango](https://tango-controls.org/) device server.\n\nIt has been tested with CF31, HL-4, MS-1000f and FC models, but should work with\nother models too.\n\nIt can be used with either with a direct serial line (read below\non the recommended way to setup a serial line connection) or remotely\nthrough TCP socket (either raw socket or rfc2217). In the latter case\nthe master device to which the Julabo serial line is connected must\nprovide a raw socket or rfc2217 interface.\n\n## Installation\n\nFrom within your favorite python environment type:\n\n`$ pip install julabo`\n\n\n## Library\n\nThe core of the julabo library consists of JulaboCF, JulaboHL, JulaboMS and\n JulaboFC objects.\nTo create a Julabo object you need to pass a communication object.\nHere is how to connect to a julabo CF31 through a raw tcp socket:\n\n```python\n\nfrom julabo import JulaboCF, connection_for_url\n\n\nasync def main():\n    conn = connection_for_url(\"tcp://controls.lab.org:17890\")\n    dev = JulaboCF(conn)\n    await conn.open()\n\n    ident = await dev.identification()\n    status = await dev.status()\n    print(f\"{ident} status is: {status}\")\n\n    # read temperature:\n    temp = await dev.bath_temperature()\n    print(f\"Bath temperature: {temp} degC\")\n\n    # start the device\n    started = await dev.is_started()\n    if not started:\n       await cryo.start()\n\n    # define a new set point\n    await dev.set_point_1(34.56)\n\nasyncio.run(main())\n```\n\n#### Serial line\n\nTo access a serial line based Julabo device it is strongly recommended you spawn\na serial to tcp bridge using [ser2net](https://linux.die.net/man/8/ser2net),\n[ser2sock](https://github.com/tiagocoutinho/ser2sock) or\n[socat](https://linux.die.net/man/1/socat)\n\nAssuming your device is connected to `/dev/ttyS0` and the baudrate is set to 9600,\nhere is how you could use socat to expose your device on the machine port 5000:\n\n`socat -v TCP-LISTEN:5000,reuseaddr,fork file:/dev/ttyS0,rawer,b9600,cs8,eol=10,icanon=1`\n\nIt might be worth considering starting socat, ser2net or ser2sock as a service using\n[supervisor](http://supervisord.org/) or [circus](https://circus.rtfd.io/).\n\n### Simulator\n\nA Julabo simulator is provided.\n\nBefore using it, make sure everything is installed with:\n\n`$ pip install julabo[simulator]`\n\nThe [sinstruments](https://pypi.org/project/sinstruments/) engine is used.\n\nTo start a simulator you need to write a YAML config file where you define\nhow many devices you want to simulate and which properties they hold.\n\nThe following example exports 1 hardware device with a minimal configuration\nusing default values:\n\n```yaml\n# config.yml\n\ndevices:\n- class: JulaboCF\n  package: julabo.simulator\n  transports:\n  - type: serial\n    url: /tmp/julabo-cf31\n    baudrate: 9600\n```\n\nTo start the simulator type:\n\n```terminal\n$ sinstruments-server -c ./config.yml --log-level=DEBUG\n2020-09-01 21:04:43,172 INFO  simulator: Bootstraping server\n2020-09-01 21:04:43,173 INFO  simulator: no backdoor declared\n2020-09-01 21:04:43,173 INFO  simulator: Creating device JulaboCF ('JulaboCF')\n2020-09-01 21:04:43,186 INFO  simulator: Created symbolic link \"/tmp/julabo-cf31\" to simulator pseudo terminal '/dev/pts/4'\n2020-09-01 21:04:43,186 INFO  simulator.JulaboCF[/tmp/julabo-cf31]: listening on /tmp/julabo-cf31 (baud=9600)\n\n```\n\n(To see the full list of options type `sinstruments-server --help`)\n\nYou can access it as you would a real hardware. Here is an example using python\nserial library on the same machine as the simulator:\n\n```python\n$ python\n\u003e\u003e\u003e from julabo import JulaboCF, connection_for_url\n\u003e\u003e\u003e conn = connection_for_url(\"serial:///tmp/julabo-cf31\", concurrency=\"syncio\")\n\u003e\u003e\u003e dev = JulaboCF(conn)\n\u003e\u003e\u003e conn.open()\n\u003e\u003e\u003e print(dev.identification())\nJULABO CRYOCOMPACT CF31 VERSION 5.0\n```\n\n### Tango server\n\nA [tango](https://tango-controls.org/) device server is also provided.\n\nMake sure everything is installed with:\n\n`$ pip install julabo[tango]`\n\nRegister a julabo tango server in the tango database:\n```\n$ tangoctl server add -s Julabo/test -d JulaboCF test/julabo/1\n$ tangoctl device property write -d test/julabo/1 -p url -v \"tcp://controls.lab.org:17890\"\n```\n\n(the above example uses [tangoctl](https://pypi.org/project/tangoctl/). You would need\nto install it with `pip install tangoctl` before using it. You are free to use any other\ntango tool like [fandango](https://pypi.org/project/fandango/) or Jive)\n\nLaunch the server with:\n\n```terminal\n$ Julabo test\n```\n\n## TODO\n\n* Add `on_connection_made` callback to initialize controller with:\n  * support for async local serial line connection\n  * cache identification()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagocoutinho%2Fjulabo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiagocoutinho%2Fjulabo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagocoutinho%2Fjulabo/lists"}