chaino


Namechaino JSON
Version 0.9.4 PyPI version JSON
download
home_pageNone
Summarypython lib for Arduino Chaino device
upload_time2025-08-18 10:18:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) [2025] [Jang-Hyun Park] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords arduino serial i2c
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # chaino — Python and MicroPython Host Library for controlling Chaino (Arduino) Devices

`chaino` module lets a PC communicate with an Arduino/compatible board that runs the Chaino firmware over **Serial (USB)**. You can remotely execute functions registered on the Chaino board, pass arguments, and receive return values.  

This module can also be used in **MicroPython**, where a MicroPython device acts as a host and controls a Chaino device connected via **I²C**. In this case, all communication and function execution happen over the I²C bus.  

It uses **CRC-16/XMODEM** for integrity and includes robust resend/retry logic to ensure reliable data transmission.

---

## 📦 Requirements & Installation

### 🖥️ CPython (PC / Server)
- **Requirements**
  - Python 3.8+
  - [pyserial](https://pypi.org/project/pyserial/) — **must be installed**
- **Installation Order**
```bash
pip install pyserial
pip install chaino
```
> **Note:** For compatibility with MicroPython, `chaino` does not automatically install `pyserial` when installed in Host PC.


---

### 📟 MicroPython (on device)
- **Requirements**
  - A MicroPython-compatible board (e.g., Raspberry Pi Pico / ESP32)
  - `chaino` installed on the MicroPython filesystem
- **Installation**
  1. Open [Thonny IDE](https://thonny.org/)
  2. Connect your MicroPython device
  3. Go to **Tools → Manage packages...**
  4. Search for `chaino` and click **Install** (from PyPI)

  Alternatively, you can enter this in Thonny's package manager command box:
  ```
  chaino
  ```
- **Usage**
  - In MicroPython, `chaino` communicates with the target Chaino device via **I²C**.
  - You can send commands and read responses from the connected Chaino board using the same API methods as in CPython, with `port` replaced by I²C parameters.

---

## 🔗 Usage Overview
- **CPython**: `Serial (USB)` connection from a PC to the Chaino device. The Chaino deivce may have multiple slave Chaino devices via I²C.
```mermaid
graph TD
    PC["PC<br/>(Python)"] -- Serial --> Dev0[Chaino Board]
    Dev0 -- I²C --> Dev1[Chaino Board #1]
    Dev0 -- I²C --> Dev2[Chaino Board #2]
```

- **MicroPython**: `I²C` connection from a MicroPython device to the Chaino device  
```mermaid
graph TD
    Dev0["Micropython Board"]
    Dev0 -- I²C --> Dev1[Chaino Board #1]
    Dev0 -- I²C --> Dev2[Chaino Board #2]
```

CPython or MicroPython can create an instance of the `Chaino` class or a subclass of it (e.g., the `chaino.Hana` class). When creating an instance, specify the serial port name or the I²C address. You can control the Chaino device using the created object, and the usage is designed to be the same in both CPython and MicroPython.

---

## 📋 Example

### CPython Example
```python
from chaino import Chaino, Hana

# Generate Chaino object via Serial
dev = Chaino("COM3")  
print( dev.who() )

# generate Hana object 
# and call analogRead(26) function of chaino.Hana device
dev2 = Hana("COM3", 0x40)
adc = dev2.read_analog(26)
print(adc)
```

### MicroPython Example
```python
from chaino import Chaino, Hana

# Generate Chaino object via I2C
dev = Chaino(0x40)  
print( dev.who() )

# generate Hana object 
# and call analogRead(26) function of chaino.Hana device
dev2 = Hana(0x41)
adc = dev2.read_analog(26)
print(adc)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "chaino",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "arduino, serial, i2c",
    "author": null,
    "author_email": "Jang-Hyun Park <salesiopark@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d2/c2/1ff06533f86b0159368d490b8d2c7ec5dedd9ff39f52eea74ac0781e6086/chaino-0.9.4.tar.gz",
    "platform": null,
    "description": "# chaino \u2014 Python and MicroPython Host Library for controlling Chaino (Arduino) Devices\r\n\r\n`chaino` module lets a PC communicate with an Arduino/compatible board that runs the Chaino firmware over **Serial (USB)**. You can remotely execute functions registered on the Chaino board, pass arguments, and receive return values.  \r\n\r\nThis module can also be used in **MicroPython**, where a MicroPython device acts as a host and controls a Chaino device connected via **I\u00b2C**. In this case, all communication and function execution happen over the I\u00b2C bus.  \r\n\r\nIt uses **CRC-16/XMODEM** for integrity and includes robust resend/retry logic to ensure reliable data transmission.\r\n\r\n---\r\n\r\n## \ud83d\udce6 Requirements & Installation\r\n\r\n### \ud83d\udda5\ufe0f CPython (PC / Server)\r\n- **Requirements**\r\n  - Python 3.8+\r\n  - [pyserial](https://pypi.org/project/pyserial/) \u2014 **must be installed**\r\n- **Installation Order**\r\n```bash\r\npip install pyserial\r\npip install chaino\r\n```\r\n> **Note:** For compatibility with MicroPython, `chaino` does not automatically install `pyserial` when installed in Host PC.\r\n\r\n\r\n---\r\n\r\n### \ud83d\udcdf MicroPython (on device)\r\n- **Requirements**\r\n  - A MicroPython-compatible board (e.g., Raspberry Pi Pico / ESP32)\r\n  - `chaino` installed on the MicroPython filesystem\r\n- **Installation**\r\n  1. Open [Thonny IDE](https://thonny.org/)\r\n  2. Connect your MicroPython device\r\n  3. Go to **Tools \u2192 Manage packages...**\r\n  4. Search for `chaino` and click **Install** (from PyPI)\r\n\r\n  Alternatively, you can enter this in Thonny's package manager command box:\r\n  ```\r\n  chaino\r\n  ```\r\n- **Usage**\r\n  - In MicroPython, `chaino` communicates with the target Chaino device via **I\u00b2C**.\r\n  - You can send commands and read responses from the connected Chaino board using the same API methods as in CPython, with `port` replaced by I\u00b2C parameters.\r\n\r\n---\r\n\r\n## \ud83d\udd17 Usage Overview\r\n- **CPython**: `Serial (USB)` connection from a PC to the Chaino device. The Chaino deivce may have multiple slave Chaino devices via I\u00b2C.\r\n```mermaid\r\ngraph TD\r\n    PC[\"PC<br/>(Python)\"] -- Serial --> Dev0[Chaino Board]\r\n    Dev0 -- I\u00b2C --> Dev1[Chaino Board #1]\r\n    Dev0 -- I\u00b2C --> Dev2[Chaino Board #2]\r\n```\r\n\r\n- **MicroPython**: `I\u00b2C` connection from a MicroPython device to the Chaino device  \r\n```mermaid\r\ngraph TD\r\n    Dev0[\"Micropython Board\"]\r\n    Dev0 -- I\u00b2C --> Dev1[Chaino Board #1]\r\n    Dev0 -- I\u00b2C --> Dev2[Chaino Board #2]\r\n```\r\n\r\nCPython or MicroPython can create an instance of the `Chaino` class or a subclass of it (e.g., the `chaino.Hana` class). When creating an instance, specify the serial port name or the I\u00b2C address. You can control the Chaino device using the created object, and the usage is designed to be the same in both CPython and MicroPython.\r\n\r\n---\r\n\r\n## \ud83d\udccb Example\r\n\r\n### CPython Example\r\n```python\r\nfrom chaino import Chaino, Hana\r\n\r\n# Generate Chaino object via Serial\r\ndev = Chaino(\"COM3\")  \r\nprint( dev.who() )\r\n\r\n# generate Hana object \r\n# and call analogRead(26) function of chaino.Hana device\r\ndev2 = Hana(\"COM3\", 0x40)\r\nadc = dev2.read_analog(26)\r\nprint(adc)\r\n```\r\n\r\n### MicroPython Example\r\n```python\r\nfrom chaino import Chaino, Hana\r\n\r\n# Generate Chaino object via I2C\r\ndev = Chaino(0x40)  \r\nprint( dev.who() )\r\n\r\n# generate Hana object \r\n# and call analogRead(26) function of chaino.Hana device\r\ndev2 = Hana(0x41)\r\nadc = dev2.read_analog(26)\r\nprint(adc)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) [2025] [Jang-Hyun Park]\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \u201cSoftware\u201d), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in\r\n        all copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n        THE SOFTWARE.\r\n        ",
    "summary": "python lib for Arduino Chaino device",
    "version": "0.9.4",
    "project_urls": {
        "Homepage": "https://github.com/salesiopark/pychaino",
        "Issues": "https://github.com/salesiopark/pychaino/issues"
    },
    "split_keywords": [
        "arduino",
        " serial",
        " i2c"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d4a6aca2dd0cf863cc96b6c08d3da74d3fa62323e6b845849ab9759b1d7a319a",
                "md5": "371002f324b2938a9199dbb26060a888",
                "sha256": "102c165e11a22081046ddf40288875778b5ea1e66cb1446a8fc5dfc9e9a41f9b"
            },
            "downloads": -1,
            "filename": "chaino-0.9.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "371002f324b2938a9199dbb26060a888",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 17178,
            "upload_time": "2025-08-18T10:18:51",
            "upload_time_iso_8601": "2025-08-18T10:18:51.374315Z",
            "url": "https://files.pythonhosted.org/packages/d4/a6/aca2dd0cf863cc96b6c08d3da74d3fa62323e6b845849ab9759b1d7a319a/chaino-0.9.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d2c21ff06533f86b0159368d490b8d2c7ec5dedd9ff39f52eea74ac0781e6086",
                "md5": "cb13255a6dbc95bd62b7fffddcde3480",
                "sha256": "b6955cb8a6d2e5ef84bf091d9fefe3e72cbe9dba6a4c7fdf1c1042f062f6b320"
            },
            "downloads": -1,
            "filename": "chaino-0.9.4.tar.gz",
            "has_sig": false,
            "md5_digest": "cb13255a6dbc95bd62b7fffddcde3480",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18042,
            "upload_time": "2025-08-18T10:18:52",
            "upload_time_iso_8601": "2025-08-18T10:18:52.708141Z",
            "url": "https://files.pythonhosted.org/packages/d2/c2/1ff06533f86b0159368d490b8d2c7ec5dedd9ff39f52eea74ac0781e6086/chaino-0.9.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-18 10:18:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "salesiopark",
    "github_project": "pychaino",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "chaino"
}
        
Elapsed time: 1.01913s