{ "info": { "author": "Water Linked AS", "author_email": "support@waterlinked.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# wl-95046 Python library for Water Linked underwater modems\n\n[![PyPI version](https://badge.fury.io/py/wlmodem.svg)](https://badge.fury.io/py/wlmodem)\n[![Build Status](https://travis-ci.org/waterlinked/modem-python.svg?branch=master)](https://travis-ci.org/waterlinked/modem-python)\n[![Coverage Status](https://coveralls.io/repos/github/waterlinked/modem-python/badge.svg?branch=master)](https://coveralls.io/github/waterlinked/modem-python?branch=master)\n\nPython library for communicating with Water Linked underwater modems.\n\nThe library exposes the functionality of the modem: setting configuration, getting diagnostic, sending\nand receiving packets.\n\n## Resources\n\n* [Water Linked web site](https://waterlinked.com/underwater-communication/)\n* [Modem documentation](https://waterlinked.github.io/docs/modems/modem-m64/)\n* [Modem protocol specification](https://waterlinked.github.io/docs/modems/modem-m64-protocol/)\n* [Repository](https://github.com/waterlinked/modem-python)\n\n## Requirements\n\n* Python 2.7 or Python 3.6\n* pip\n\n## Supported modems\n\n* Water Linked Modem-M64\n\n## Setup\n\n```\n$ python3 -m pip install --user wlmodem\nor\n(venv)$ python3 -m pip install wlmodem\n```\n\n## Quick start\n\nConnecting to a modem and configuring the mode and channel:\n\n```py\n$ python3\n\n>>> from wlmodem import WlModem\n>>> modem = WlModem(\"/dev/ttyUSB0\")\n>>> modem.connect()\nTrue\n>>> modem.cmd_configure(\"a\", 4)\nTrue\n>>> modem.cmd_queue_packet(b\"HelloSea\")\nTrue\n```\n\n## Usage\n\nThe `WlModem` class provides an easy interface to configure, send and receive data with a Water Linked modem.\nA pair of modems must be configured on the same channel and with different roles to establish communication between them.\n\nA `WlModem` object is initialized with the serial device name:\n\n```py\nfrom wlmodem import WlModem\nmodem = WlModem(\"/dev/ttyUSB0\")\n```\n\nCall `connect()` to establish communication with the device\n\n```py\nif not modem.connect():\n print(\"Failed connecting to modem\")\n sys.exit(1)\n```\n\nOnce connected we set the same channel and different roles on the pair of modems:\n\n```py\n# On modem 1:\nsuccess = modem.cmd_configure(\"a\", 4)\n# On modem 2:\nsuccess = modem.cmd_configure(\"b\", 4)\n```\n\nIf the tip of the modems are close to each other (<5cm) the modems will now link up.\nThe link status can be seen on the LEDs or by getting the diagnostic data.\n\n```py\nif modem.cmd_get_diagnostic().get(\"link_up\"):\n print(\"Link is up\")\n```\n\nOnce we have connected we can use `cmd_queue_packet` function to queue data for transmission.\n\n```py\nsuccess = modem.cmd_queue_packet(b\"HelloSea\")\n```\n\nIn order to get data which one modem has received from the other modem use the `get_data_packet` function.\nThis function will by default wait `timeout` seconds until a data packet is received before returning.\nIf `timeout` is 0 it will immediately return with a packet (if available) or `None` if no packet has been received.\n\n```py\npkt = modem.get_data_packet(timeout=0)\nif pkt:\n print(\"Got data:\", pkt)\n```\n\n## UDP-style transfers\n\nThe `WlUDPSocket` class is a higher level abstraction which allows arbitrary sized UDP-like datagrams to be transferred.\nThis style of transfer is suitable for short messages and has low overhead at 3 bytes for each\ndatagram (1 start byte, 1 checksum and 1 end byte).\nThe datagram will be corrupted by any single modem packet dropped (while still taking the full time to transmit),\nwhich means it is only suitable for short datagrams.\nThe Modem-M64 has a payload size of 8 bytes, so the chance of success given a chance of any packet lost and number of packets transferred is given by:\n\n```py\nchance_of_success = ((100.0 - chance_of_packet_loss) / 100) ** (number_of_packets_sent) * 100\n```\n\nFor example, with a 5% chance of packet loss and datagram of 77 bytes (with the 3 overhead bytes this gives 10 packets):\n\n```py\n>>> ((100.0 - 5) / 100)**10 * 100\n59.87369392383787\n```\n\nIe. there is a 60% chance of successful transmission.\n\nExample of how to use the `WLUDPSocket` class for transmission and reception of data:\n\n```py\nfrom wlmodem import WlModem, WlUDPSocket\nmodem = WlModem(\"/dev/ttyUSB0\")\nmodem.connect()\nwl_sock = WlUDPSocket(modem)\nwl_sock.send(b\"There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss\")\nreceived = wl_sock.receive()\n```\n\n## Simulator\n\nA `WlModemSimulator` class can be used to simulate communication with a modem without a physical modem.\nOnce instantiated the object will behave similarly to a Water Linked Modem-M64.\nData packets that are queued using the simulator object is returned after a timeout.\n\n```py\n>>> from wlmodem import WlModemSimulator\n>>> modem = WlModemSimulator()\n>>> modem.connect()\nTrue\n>>> modem.cmd_queue_packet(b\"HelloSim\")\nTrue\n>>> modem.get_data_packet()\nb'HelloSim'\n```\n\n## Examples\n\nMultiple examples showing how to use the API is available in the [example/](example/) folder.\n\n## Development\n\nThe code in this repository is unit tested with `pytest`. `tox` is used to automate testing on multiple Python versions.\n\nRun unit-tests with:\n\n```\npip install tox\ntox\n```\n\nFurther details on development of the repository is described in [README_maintain.md](README_maintain.md)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.waterlinked.com", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "wlmodem", "package_url": "https://pypi.org/project/wlmodem/", "platform": "", "project_url": "https://pypi.org/project/wlmodem/", "project_urls": { "Homepage": "https://www.waterlinked.com" }, "release_url": "https://pypi.org/project/wlmodem/1.3.0/", "requires_dist": [ "setuptools", "pyserial", "crcmod", "cobs" ], "requires_python": "", "summary": "Python library for Water Linked underwater modems", "version": "1.3.0" }, "last_serial": 5927409, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f194d1daf9abe78cbb4d1476dbd6499d", "sha256": "a59400d18aa9cb123da4132a427a99f5cd298543c0bc5784539be0245285ecfc" }, "downloads": -1, "filename": "wlmodem-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f194d1daf9abe78cbb4d1476dbd6499d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9389, "upload_time": "2019-07-03T13:17:34", "url": "https://files.pythonhosted.org/packages/69/f4/0dd1309b4cdc87bd3f8390c06212fa887be3b8cc1bc1cc7c1402ab37053a/wlmodem-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46442d6a99a42fdf44357c7f397c7a69", "sha256": "8bd1a32f6e9fa0e6b0a00500a9e1f89dfe8436509066b643849630a4d5faacb0" }, "downloads": -1, "filename": "wlmodem-1.0.0.tar.gz", "has_sig": false, "md5_digest": "46442d6a99a42fdf44357c7f397c7a69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9152, "upload_time": "2019-07-03T13:17:36", "url": "https://files.pythonhosted.org/packages/bc/4a/208ae068e94d28f2d2b49e31ccafd0475b41f95fffdd3be1093b4cbad59b/wlmodem-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8bd945aa07e38fd50880f9be2c4a806e", "sha256": "b685371ec1ff2c0edc174bff77cd94f68cf7efad2368e58dba089671798654e2" }, "downloads": -1, "filename": "wlmodem-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8bd945aa07e38fd50880f9be2c4a806e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9816, "upload_time": "2019-07-04T07:11:35", "url": "https://files.pythonhosted.org/packages/93/8a/a1603471f62b8bc030d70b40a41257f8aa457bc0a84ad09653b57eef8901/wlmodem-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5451252aca22746b5930a5c5b9db2f86", "sha256": "2f08c0eb9dbd2b7c2f05407d844964b05aac1e16be7e61d323a4361bfcecab81" }, "downloads": -1, "filename": "wlmodem-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5451252aca22746b5930a5c5b9db2f86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10515, "upload_time": "2019-07-04T07:11:37", "url": "https://files.pythonhosted.org/packages/70/b3/d553adfa1d63bd2e4294eca2666e03eea2424099b0ce8d8d8779b15d1569/wlmodem-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "43c9993a09da3049bed432b45d5a940c", "sha256": "c83afb8b0934cb321624a2ab1cd29891da8cf756c3f40a1dc219f657675375c2" }, "downloads": -1, "filename": "wlmodem-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "43c9993a09da3049bed432b45d5a940c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11892, "upload_time": "2019-07-04T08:52:07", "url": "https://files.pythonhosted.org/packages/76/18/b19407d297407e1bb59cb70cd25e148880ea48a5832171cc076c369ab738/wlmodem-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b144ae147b326a4e8da99d90757407c0", "sha256": "fc3078c5960f3f03b538c8cfc4b6c328b85412250df98a2b0a803f84c9cb6598" }, "downloads": -1, "filename": "wlmodem-1.1.0.tar.gz", "has_sig": false, "md5_digest": "b144ae147b326a4e8da99d90757407c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11730, "upload_time": "2019-07-04T08:52:08", "url": "https://files.pythonhosted.org/packages/a2/c6/e666f8c40cc45b26d57cc0f0ffd71b89d55af48cf90f3290b09cd2d5da4e/wlmodem-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "4beb768f7f3599ad643464671831839a", "sha256": "03ead362fc68cd8d4f38c64aad03a1e0a492a13ecb6ace21bda8b4215c42886b" }, "downloads": -1, "filename": "wlmodem-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4beb768f7f3599ad643464671831839a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11915, "upload_time": "2019-07-04T11:07:43", "url": "https://files.pythonhosted.org/packages/b6/6f/eedfb75dca407ec3d1793744e1393d315420f77204ef9f3cc70a5ae89350/wlmodem-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "20f8b5f5e85e3238355169bcb438531c", "sha256": "3ceaea301872bd2b8bc16616086ad1b116b437a8c7114eb970199ffa948549e3" }, "downloads": -1, "filename": "wlmodem-1.1.1.tar.gz", "has_sig": false, "md5_digest": "20f8b5f5e85e3238355169bcb438531c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11747, "upload_time": "2019-07-04T11:07:45", "url": "https://files.pythonhosted.org/packages/62/b3/f0e8032d8a25516acfaf89cdd7a534ccfa02bc6bce4cf27cf7928c1c94f0/wlmodem-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "657cbeedd80fd17ddcbb15a16dddcbf1", "sha256": "a445830414067d2c1c1a841f9960f94dbe301e561988fbfcc43bf4e0a5dd7e64" }, "downloads": -1, "filename": "wlmodem-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "657cbeedd80fd17ddcbb15a16dddcbf1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15940, "upload_time": "2019-07-25T06:57:55", "url": "https://files.pythonhosted.org/packages/28/8f/17fecc07988d01c2d142c0cbbd655d60056e3b6bf538e8508f7e95e7659d/wlmodem-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7897d7fd90359f6761dcf3740ff71ecf", "sha256": "47410b1df979cbcc1e3f9bb3fcbf40af254e170160bbf43dd349362904ff4391" }, "downloads": -1, "filename": "wlmodem-1.2.0.tar.gz", "has_sig": false, "md5_digest": "7897d7fd90359f6761dcf3740ff71ecf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15322, "upload_time": "2019-07-25T06:57:57", "url": "https://files.pythonhosted.org/packages/dc/a3/9b049808c501c32a72c2ac4d34936c9916c7a50c2ab6af827dad94c474be/wlmodem-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "56ac3f30833bc47d5fbdeeefe35e4396", "sha256": "774c3ca501b8d8a919bcd4e1545e63266e8b6f877b35383e1f63a94c082a060e" }, "downloads": -1, "filename": "wlmodem-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "56ac3f30833bc47d5fbdeeefe35e4396", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16780, "upload_time": "2019-07-25T12:00:49", "url": "https://files.pythonhosted.org/packages/37/b4/ce5adc3581518b6515550b66b939853be98a5fce0dd0fd9cd0c82592302a/wlmodem-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e488e1e286f758bb3c612b77b2ba7698", "sha256": "4d32b6e855145cdb05e1419b4580258c7875a329564e27a64420cc51a40f069e" }, "downloads": -1, "filename": "wlmodem-1.2.1.tar.gz", "has_sig": false, "md5_digest": "e488e1e286f758bb3c612b77b2ba7698", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15754, "upload_time": "2019-07-25T12:00:51", "url": "https://files.pythonhosted.org/packages/fa/6d/34c0b451b0ee37d57becced12cd5e10086adf8fe90a0949280a03d3a2004/wlmodem-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "9bdb332f499ee82729de52fa05d9241b", "sha256": "b2fe923b3cb9a619e1e3e38eba54d72a8393916e8d8ead80d4064b9bb491981c" }, "downloads": -1, "filename": "wlmodem-1.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "9bdb332f499ee82729de52fa05d9241b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17062, "upload_time": "2019-08-04T18:40:02", "url": "https://files.pythonhosted.org/packages/60/68/35cc39f76b372ed1e44134c12e148df9485fa20534e0de11a2ea3c479566/wlmodem-1.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c355bdfdb7eb1f7c2f71d96cacc20ace", "sha256": "966b71eb0aa339b003c25a93748ce16c19723c6d871660d920cd76b8c3ca13c3" }, "downloads": -1, "filename": "wlmodem-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c355bdfdb7eb1f7c2f71d96cacc20ace", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17063, "upload_time": "2019-08-04T18:39:34", "url": "https://files.pythonhosted.org/packages/a9/e3/c4fc60545ab3b9f4610102aa1eba9e941b1a9e3bad07b128ad9ddbfc403f/wlmodem-1.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ca89f63372e622206a33e602c2f3fa1", "sha256": "041cfbe6c7d161dbdd2010813071b41b9b248facd8d7eb43f13bb0a4a2c1f80c" }, "downloads": -1, "filename": "wlmodem-1.2.2.tar.gz", "has_sig": false, "md5_digest": "7ca89f63372e622206a33e602c2f3fa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15984, "upload_time": "2019-08-04T18:39:36", "url": "https://files.pythonhosted.org/packages/f0/d8/90506157fd54a86435006eb071efef6156f7f5908b53fc89d03f7b342a77/wlmodem-1.2.2.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "e919c7180137e1e924295e702904df74", "sha256": "571c8911e3443acc1b159a194cc65978c10fe7504cb86da2a7f1c20b61d1b340" }, "downloads": -1, "filename": "wlmodem-1.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "e919c7180137e1e924295e702904df74", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17949, "upload_time": "2019-10-04T09:03:28", "url": "https://files.pythonhosted.org/packages/76/5d/1da2dda94e1407fc7d52737b40379a419f2b1f395c9d4191a4888da97def/wlmodem-1.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d680287237b038b7a1cc88dcc8ae5f82", "sha256": "46b5e604a0a8a6473e6fbb46c934bbf9fa8ad2af5a6bad519443a4b2dcae2aa6" }, "downloads": -1, "filename": "wlmodem-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d680287237b038b7a1cc88dcc8ae5f82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17950, "upload_time": "2019-10-04T09:03:32", "url": "https://files.pythonhosted.org/packages/4d/a1/ec807e5fd431587bc6f7a80f2ade299000082a6ce191d2a2fc8c3c4371e7/wlmodem-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "967b38fc390fe7c959f27ffebff62f17", "sha256": "7b32f660d481a548925e07733392455777da8345b81c7f8d75edea13571013e5" }, "downloads": -1, "filename": "wlmodem-1.3.0.tar.gz", "has_sig": false, "md5_digest": "967b38fc390fe7c959f27ffebff62f17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16950, "upload_time": "2019-10-04T09:03:29", "url": "https://files.pythonhosted.org/packages/ba/59/5e037331808188dd42a34492b9062a24473356c067185b321c77c192f0b8/wlmodem-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e919c7180137e1e924295e702904df74", "sha256": "571c8911e3443acc1b159a194cc65978c10fe7504cb86da2a7f1c20b61d1b340" }, "downloads": -1, "filename": "wlmodem-1.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "e919c7180137e1e924295e702904df74", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 17949, "upload_time": "2019-10-04T09:03:28", "url": "https://files.pythonhosted.org/packages/76/5d/1da2dda94e1407fc7d52737b40379a419f2b1f395c9d4191a4888da97def/wlmodem-1.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d680287237b038b7a1cc88dcc8ae5f82", "sha256": "46b5e604a0a8a6473e6fbb46c934bbf9fa8ad2af5a6bad519443a4b2dcae2aa6" }, "downloads": -1, "filename": "wlmodem-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d680287237b038b7a1cc88dcc8ae5f82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17950, "upload_time": "2019-10-04T09:03:32", "url": "https://files.pythonhosted.org/packages/4d/a1/ec807e5fd431587bc6f7a80f2ade299000082a6ce191d2a2fc8c3c4371e7/wlmodem-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "967b38fc390fe7c959f27ffebff62f17", "sha256": "7b32f660d481a548925e07733392455777da8345b81c7f8d75edea13571013e5" }, "downloads": -1, "filename": "wlmodem-1.3.0.tar.gz", "has_sig": false, "md5_digest": "967b38fc390fe7c959f27ffebff62f17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16950, "upload_time": "2019-10-04T09:03:29", "url": "https://files.pythonhosted.org/packages/ba/59/5e037331808188dd42a34492b9062a24473356c067185b321c77c192f0b8/wlmodem-1.3.0.tar.gz" } ] }