{ "info": { "author": "Christian Fobel", "author_email": "christian@fobel.net", "bugtrack_url": null, "classifiers": [], "description": "# teensy-minimal-rpc #\r\n\r\nTemplate package for remote procedure call (RPC) project, utilizing\r\n[`base-node-rpc`][3].\r\n\r\n## Overview ##\r\n\r\nThis package contains:\r\n\r\n - Firmware compatible with Arduino Uno or Mega2560.\r\n - Installable Python package for interfacing with Arduino firmware through\r\n serial port or i2c (through a serial-to-i2c proxy).\r\n\r\n## Install ##\r\n\r\nThe Python package can be installed through `pip` using the following command:\r\n\r\n pip install teensy-minimal-rpc\r\n\r\n## Upload firmware ##\r\n\r\nTo upload the pre-compiled firmware included in the Python package, run the\r\nfollowing command:\r\n\r\n python -m teensy_minimal_rpc.bin.upload \r\n\r\nreplacing `` with either `uno` or `mega2560`, depending on the\r\nmodel of the board.\r\n\r\nThis will attempt to upload the firmware by automatically discovering the\r\nserial port. On systems with multiple serial ports, use the `-p` command line\r\nargument to specify the serial port to use. For example:\r\n\r\n python -m teensy_minimal_rpc.bin.upload -p COM3 uno\r\n\r\n--------------------------------------------------\r\n\r\n## Usage ##\r\n\r\nAfter uploading the firmware to the board, the `teensy_minimal_rpc.Proxy` class can be\r\nused to interact with the Arduino device.\r\n\r\nSee the session log below for example usage.\r\n\r\n### Example interactive session ###\r\n\r\n >>> from serial import Serial\r\n >>> from teensy_minimal_rpc import Proxy\r\n\r\nConnect to serial device.\r\n\r\n >>> serial_device = Serial('/dev/ttyUSB0', baudrate=115200)\r\n\r\nInitialize a device proxy using existing serial connection.\r\n\r\n >>> proxy = Proxy(serial_device)\r\n\r\nQuery the number of bytes free in device RAM.\r\n\r\n >>> proxy.ram_free()\r\n 409\r\n\r\nQuery descriptive properties of device.\r\n\r\n >>> proxy.properties()\r\n base_node_software_version 0.9.post8.dev141722557\r\n name teensy_minimal_rpc\r\n manufacturer Wheeler Lab\r\n url http://github.com/wheeler-microfluidics/rpc-p...\r\n software_version 0.1\r\n dtype: object\r\n\r\nUse Arduino API methods interactively.\r\n\r\n >>> # Set pin 13 as output\r\n >>> proxy.pin_mode(13, 1)\r\n >>> # Turn led on\r\n >>> proxy.digital_write(13, 1)\r\n >>> # Turn led off\r\n >>> proxy.digital_write(13, 0)\r\n\r\n\r\n### Configuration and state ###\r\n\r\nThe device stores a *configuration* and a *state*. The configuration is\r\nserialized and stored in EEPROM, allowing settings to persist across device\r\nresets. The state is stored in device memory and is reinitialized each time\r\nthe device starts up.\r\n\r\nPrint (non-default) configuration values.\r\n\r\n >>> print proxy.config\r\n serial_number: 2\r\n baud_rate: 115200\r\n i2c_address: 17\r\n\r\nConfiguration settings can be set by updating the configuration.\r\n\r\n >>> result_code = proxy.update_config(serial_number=1234)\r\n >>> result_code = proxy.update_config(i2c_address=32)\r\n\r\nTo persist changes to *configuration* across device reset - *not* state - use\r\n`save_config` method.\r\n\r\n >>> proxy.save_config()\r\n\r\n### Other methods ###\r\n\r\nBelow is a list of the attributes of the `teensy_minimal_rpc.Proxy` Python class. Note\r\nthat many of the [Arduino API][1] functions (e.g., `pin_mode`, `digital_write`,\r\netc.) are exposed through the RPC API.\r\n\r\n >>> proxy.\r\n proxy.analog_read proxy.microseconds\r\n proxy.analog_write proxy.milliseconds\r\n proxy.array_length proxy.name\r\n proxy.base_node_software_version proxy.on_config_baud_rate_changed\r\n proxy.begin proxy.on_config_i2c_address_changed\r\n proxy.buffer_size proxy.on_config_serial_number_changed\r\n proxy.channel_count proxy.on_state_frequency_changed\r\n proxy.config proxy.on_state_voltage_changed\r\n proxy.delay_ms proxy.pin_mode\r\n proxy.delay_us proxy.properties\r\n proxy.digital_read proxy.ram_free\r\n proxy.digital_write proxy.read_eeprom_block\r\n proxy.echo_array proxy.reset_config\r\n proxy.get_buffer proxy.reset_state\r\n proxy.i2c_address proxy.save_config\r\n proxy.i2c_available proxy.serialize_config\r\n proxy.i2c_buffer_size proxy.serialize_state\r\n proxy.i2c_read proxy.set_i2c_address\r\n proxy.i2c_read_byte proxy.set_state_of_channels\r\n proxy.i2c_request proxy.software_version\r\n proxy.i2c_request_from proxy.state\r\n proxy.i2c_scan proxy.state_of_channels\r\n proxy.i2c_write proxy.str_echo\r\n proxy.load_config proxy.update_config\r\n proxy.manufacturer proxy.update_eeprom_block\r\n proxy.max_i2c_payload_size proxy.update_state\r\n proxy.max_serial_payload_size proxy.url\r\n\r\n--------------------------------------------------\r\n\r\n## Firmware development ##\r\n\r\nThe Arduino firmware/sketch is located in the `teensy_minimal_rpc/Arduino/teensy_minimal_rpc`\r\ndirectory. The key functionality is defined in the `teensy_minimal_rpc::Node` class in\r\nthe file `Node.h`.\r\n\r\nRunning the following command will build the firmware using [SCons][2] for\r\nArduino Uno and Arduino Mega2560, and will package the resulting firmware in a\r\nPython package, ready for distribution.\r\n\r\n paver sdist\r\n\r\n### Adding new remote procedure call (RPC) methods ###\r\n\r\nNew methods may be added to the RPC API by adding new methods to the\r\n`teensy_minimal_rpc::Node` class in the file `Node.h`.\r\n\r\n# Author #\r\n\r\nCopyright 2015 Christian Fobel \r\n\r\n\r\n[1]: https://www.arduino.cc/en/Reference/HomePage\r\n[2]: http://www.scons.org/\r\n[3]: https://github.com/wheeler-microfluidics/base_node_rpc\r\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/wheeler-microfluidics/teensy-minimal-rpc.git", "keywords": null, "license": "GPLv2", "maintainer": null, "maintainer_email": null, "name": "teensy-minimal-rpc", "package_url": "https://pypi.org/project/teensy-minimal-rpc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/teensy-minimal-rpc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/wheeler-microfluidics/teensy-minimal-rpc.git" }, "release_url": "https://pypi.org/project/teensy-minimal-rpc/0.2.post1/", "requires_dist": null, "requires_python": null, "summary": "Template project demonstrating use of Arduino base node RPC framework.", "version": "0.2.post1" }, "last_serial": 1839977, "releases": { "0.2.post1": [ { "comment_text": "", "digests": { "md5": "5898d4a9a56470de0f2ea7efa513b4b3", "sha256": "6a804f8929009c4b8cb889e0c5f340f6016117012d4dd3986cd46b51d1c286d3" }, "downloads": -1, "filename": "teensy-minimal-rpc-0.2.post1.zip", "has_sig": false, "md5_digest": "5898d4a9a56470de0f2ea7efa513b4b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16464389, "upload_time": "2015-11-30T17:17:57", "url": "https://files.pythonhosted.org/packages/ad/68/5bdcb21541ca748e2d44e875d8bf9ab3efc98f8dacafe1077e8357973c64/teensy-minimal-rpc-0.2.post1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5898d4a9a56470de0f2ea7efa513b4b3", "sha256": "6a804f8929009c4b8cb889e0c5f340f6016117012d4dd3986cd46b51d1c286d3" }, "downloads": -1, "filename": "teensy-minimal-rpc-0.2.post1.zip", "has_sig": false, "md5_digest": "5898d4a9a56470de0f2ea7efa513b4b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16464389, "upload_time": "2015-11-30T17:17:57", "url": "https://files.pythonhosted.org/packages/ad/68/5bdcb21541ca748e2d44e875d8bf9ab3efc98f8dacafe1077e8357973c64/teensy-minimal-rpc-0.2.post1.zip" } ] }