{ "info": { "author": "['Matt Mets', 'David Sayles (MBI)', 'Far McKon (MBI)']", "author_email": "cibomahto@gmail.com,david.sayles@makerbot.com,far@makerbot.com", "bugtrack_url": null, "classifiers": [], "description": "# makerbot_driver\n\nThe makerbot_driver module is designed to communicate with a Makerbot Printer via makerbot_driver Packets. The main objectives of this module are to transform certain actions (i.e. move-to-a-position, heat-up-a-toolhead) into packets of information to be sent and to decode packets of information received from a printer into human parsable formats.\n\n##Machine Connection\n\n## Example: Connecting to a Replicator\nImport both the makerbot_driver module and pyserial:\n\n```python\nimport makerbot_driver, serial\n```\n\nCreate an makerbot_driver object, and attach it to a serial port:\n\n```python\nr = makerbot_driver.s3g()\nfile = serial.Serial(port, 115200, timeout=1)\nr.writer = makerbot_driver.Writer.StreamWriter(file)\n```\n\n_Note: Replace port with your serial port (example: '/dev/tty.usbmodemfd121')_\n\nHome the x, y, and z axes:\n\n```python\nr.find_axes_maximums(['x', 'y'], 500, 60)\nr.find_axes_minimums(['z'], 500, 60)\nr.recall_home_positions(['x', 'y', 'z', 'a', 'b'])\n```\n\nInstruct the machine to move in a square pattern:\n\n```python\nr.queue_extended_point([2000,0,5000,0,0], 400)\nr.queue_extended_point([2000,2000,5000,0,0], 400)\nr.queue_extended_point([0,2000,5000,0,0], 400)\nr.queue_extended_point([0,0,5000,0,0], 400)\n```\n\n_Note: All points are in steps, and all speeds are in DDA. This is s3g, not gcode!_\n\nNow, instruct the machine to heat toolhead 0, wait up to 5 minutes for it to reach temperature, then extrude for 12.5 seconds:\n\n```python\nr.set_toolhead_temperature(0, 220)\nr.wait_for_tool_ready(0,100,5*60)\nr.queue_extended_point([0,0,5000,-5000,0], 2500)\n```\n\nFinally, don't forget to turn off the toolhead heater, and disable the stepper motors:\n\n```python\nr.set_toolhead_temperature(0,0)\nr.toggle_axes(['x','y','z','a','b'],False)\n```\n\nThose are the basics of how to control a machine. For more details, consult the [s3g protocol](https://github.com/jnesselr/s3g/blob/master/doc/s3g_protocol.markdown) and the [s3g source](https://github.com/jnesselr/s3g/blob/master/s3g/s3g.py).\n\n# Data types\nThere are a few specific data formats that are used throughout this module, that warrant further explanation here.\n\n## Points\nPoints come in two flavors: regular and extended.\n\nRegular points are expressed as a list of x, y, and z coordinates:\n\n [x, y, z]\n\nExtended points are expressed as a list of x, y, a, and b coordinates:\n\n [x, y, z, a, b]\n\n## Axes Lists\nThere are several commands that require a list of axes as input. This parameter is passed as a python list of strings, where each axis is its own separate string. To pass in all axes:\n\n ['x', 'y', 'z', 'a', 'b']\n\n# Error handling\nThe makerbot_driver module will raise an exception if it encounters a problem during transmission. Conditions, such as timeouts, bad packets being received from the bot and poorly formatted parameters all can cause the makerbot_driver module to raise exceptions. Some of these states are recoverable, while some require a machine restart. We can categorize makerbot_driver's error states into the following:\n\nTODO: This is largely duplicated in the errors.py doc, consider rewriting as a summary of the base error types only.\n\n## Buffer Overflow Error (used internally)\nA Buffer Overflow Error is raised when the machine has full buffer.\n\n## Retryable Errors (used internally)\nRetryable Errors are non-catastrophic errors raised by makerbot_driver. While alone they cannot cause makerbot_driver to terminate, an aggregate of 5 errors will cause makerbot_driver to quit.\n\n Packet Decode Errors\n Generic Errors\n CRC Mismatch Errors\n Timeout Errors\n\n## Packet Decode Errors (used internally):\nPacket decode errors are raised if there is a problem evaluating a return packet from an s3g Host:\n\n Bad Packet Lengths\n Bad Packet Field Lenghts\n Bad Packet CRCs\n Bad Packet Headers\n\n## Transmission Errors:\nTransmission Errors are thrown when more than 5 Retryable Errors are raised.\n\n## Protocol Errors\nThese errors are caused by ostensibly well formed packets returned from the machine, but with incorrect data:\n\n Bad Heat Element Ready Responses\n Bad EEPROM Read/Write Lengths\n UnrecognizedResponseError\n\n## Parameter Errors\nParameter errors are raised when imporperly formatted arguments are passed into an s3g function.\n\n Bad Point Length\n EEPROM Read/Write length too long\n Bad Tool Index\n Bad button name\n\n## ToolBusError (used internally):\nTool Bus errors are raised when the machine cannot communicate with its toolbus.\n\n Downstream Timeout Error\n Tool Lock Error\n\n## Other Errors\nBot generated errors will throw their own specific errors, such as:\n\n SD Card Errors\n Extended Stop Errors\n Build Cancel Errors\n\n## GCode Errors\nGCode errors are thrown when reading through a GCode file and parsing out g/m codes and comments.\nCause By:\n\n Improperly Formatted Comments\n Bad Codes\n Codes That Are Repeated Multiple Times On A Single Line\n M And G Codes Present On The Same Line\n \n## External Stop Error\nAn External Stop Error is raised when an external thread sets the External Stop Flag in makerbot_driver.Writer.StreamWriter to true, which terminates the Stream Writer's packet sending process.\n \n## S3G Stream Reading Errors\nThese errors are thrown when the makerbot_driver module encounters errors during makerbot_driver stream parsing. \nCaused By:\n\n Encoded Strings Above The Max Payload Length\n\n\n# Contributing\nContributions are welcome to this project! All changes must be in the style of the project, and include unit tests that are as complete as possible. Place all source code in the s3g/ directory, and all tests in the tests/ directory. Before submitting a patch, ensure that all unit tests pass by running the unit test script:\n\n```python\npython unit_tests.py\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/makerbot/s3g", "keywords": null, "license": "GNU AFFERO GENERAL PUBLIC LICENSE", "maintainer": null, "maintainer_email": null, "name": "makerbot_driver", "package_url": "https://pypi.org/project/makerbot_driver/", "platform": "any", "project_url": "https://pypi.org/project/makerbot_driver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/makerbot/s3g" }, "release_url": "https://pypi.org/project/makerbot_driver/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Python driver to connect to MakerBot 3D Printers which use the s3g protocol", "version": "0.1.3" }, "last_serial": 1860404, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "effd0efb07908d10ecbcd3144ed6c614", "sha256": "d9ba1bb28f92cd140f741317daeee634ccf25394673141a56d0334cbb757d9b3" }, "downloads": -1, "filename": "makerbot_driver-0.1.2.tar.gz", "has_sig": false, "md5_digest": "effd0efb07908d10ecbcd3144ed6c614", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1178812, "upload_time": "2015-12-12T23:10:44", "url": "https://files.pythonhosted.org/packages/19/55/12b8618e414ac1dff7edc413476844d70ae82d36e3f57fc193522efd73f7/makerbot_driver-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "316dd00bdc2d05013e4e8e067189f127", "sha256": "0dba9de0a702370b2495190d819d3701a384ff03a17e7cd801be7353b98b17e6" }, "downloads": -1, "filename": "makerbot_driver-0.1.3.tar.gz", "has_sig": false, "md5_digest": "316dd00bdc2d05013e4e8e067189f127", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1178950, "upload_time": "2015-12-13T20:10:16", "url": "https://files.pythonhosted.org/packages/66/36/5dc5a2a80ea5dcc6fbe5b785659ba8f1d04c4a5c7686fcdc7a66888f5a7a/makerbot_driver-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "316dd00bdc2d05013e4e8e067189f127", "sha256": "0dba9de0a702370b2495190d819d3701a384ff03a17e7cd801be7353b98b17e6" }, "downloads": -1, "filename": "makerbot_driver-0.1.3.tar.gz", "has_sig": false, "md5_digest": "316dd00bdc2d05013e4e8e067189f127", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1178950, "upload_time": "2015-12-13T20:10:16", "url": "https://files.pythonhosted.org/packages/66/36/5dc5a2a80ea5dcc6fbe5b785659ba8f1d04c4a5c7686fcdc7a66888f5a7a/makerbot_driver-0.1.3.tar.gz" } ] }