arduino-colab-bridge


Namearduino-colab-bridge JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryHW bridge for Arduino Colab
upload_time2025-08-30 15:52:05
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords arduino esp32 jupyter magics notebook
VCS
bugtrack_url
requirements arduino-colab-kernel
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Arduino Colab Project 

# Arduino Bridge 
This is HW<->frontend bridge component of [Arduino Colab Project](https://github.com/sgtkingo/ArduinoColab.git).

---

## How to Use

### 1. Running the Remote Server

To use the remote backend (for cloud or remote Jupyter/Colab environments), you need to run the remote server on the machine connected to your Arduino hardware.

**Install dependencies:**
```bash
pip install -r .\requirements.txt
```

**Run the server:**
**RUN** server with default settings (localhost):
```bash
python -m arduino_colab_kernel.backends.remote_server
```
*OR* use custom port and token:
```bash
python -m arduino_colab_kernel.backends.remote_server --port 5000 --token YOUR_TOKEN
```
- Replace `YOUR_TOKEN` with a secure token of your choice.
- The server will listen for requests from the frontend (Colab/Jupyter).

### 1.1 Open server site in web-browser
**Open** server URL address in web-browser and copy *TOKEN*, and *Server URL* if needed.

### 2. Connecting from the Client (Colab/Jupyter)

In your Jupyter/Colab notebook, load the magics and set up the remote backend:

```python
%load_ext arduino_colab_kernel.magic_project
%load_ext arduino_colab_kernel.magic_board
%load_ext arduino_colab_kernel.magic_code
%load_ext arduino_colab_kernel.magic_serial

MY_API_TOKEN = input("Enter your API token: ")  # Use the same token as the server
REMOTE_URL = "http://<server-ip>:<server-port>"  # Replace <server-ip> and <server-port> with your server's IP address and port (*Optional*)

# Load or initialize a project in remote mode
%project load --mode remote --remote_url $REMOTE_URL --token $MY_API_TOKEN
# init
%project init --mode remote --remote_url $REMOTE_URL --token $MY_API_TOKEN

# or use simplify version with default server address:
%project load --mode remote --token {MY_API_TOKEN}
# init
%project init --mode remote --token {MY_API_TOKEN}
```

### 3. Workflow

- Use `%project`, `%board`, `%%code`, and `%serial` magics as usual.
- All compile/upload/serial operations will be forwarded to the remote server.

---

## Example

```python
# Set up remote backend
MY_API_TOKEN = "YOUR_TOKEN"
REMOTE_URL = "http://192.168.1.100:5000"

%project init my_project --mode remote --remote_url $REMOTE_URL --token $MY_API_TOKEN
%board select uno
%%code setup
pinMode(13, OUTPUT);
%%code loop
digitalWrite(13, HIGH); delay(500); digitalWrite(13, LOW); delay(500);
%board upload
%serial listen --duration 10
```

---

## Security

- Always use a strong, secret token for authentication.
- Never expose your remote server to the public internet without proper security.

---

For more details, see project Arduino Colab on [Github](https://github.com/sgtkingo/ArduinoColab)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "arduino-colab-bridge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "arduino, esp32, jupyter, magics, notebook",
    "author": null,
    "author_email": "Jiri Konecny <jiri.konecny@vsb.cz>",
    "download_url": "https://files.pythonhosted.org/packages/b1/49/96220c9dd69ddcdd94f84c756fe3cce22f421792888b58152f61ba9037aa/arduino_colab_bridge-0.1.0.tar.gz",
    "platform": null,
    "description": "# Arduino Colab Project \r\n\r\n# Arduino Bridge \r\nThis is HW<->frontend bridge component of [Arduino Colab Project](https://github.com/sgtkingo/ArduinoColab.git).\r\n\r\n---\r\n\r\n## How to Use\r\n\r\n### 1. Running the Remote Server\r\n\r\nTo use the remote backend (for cloud or remote Jupyter/Colab environments), you need to run the remote server on the machine connected to your Arduino hardware.\r\n\r\n**Install dependencies:**\r\n```bash\r\npip install -r .\\requirements.txt\r\n```\r\n\r\n**Run the server:**\r\n**RUN** server with default settings (localhost):\r\n```bash\r\npython -m arduino_colab_kernel.backends.remote_server\r\n```\r\n*OR* use custom port and token:\r\n```bash\r\npython -m arduino_colab_kernel.backends.remote_server --port 5000 --token YOUR_TOKEN\r\n```\r\n- Replace `YOUR_TOKEN` with a secure token of your choice.\r\n- The server will listen for requests from the frontend (Colab/Jupyter).\r\n\r\n### 1.1 Open server site in web-browser\r\n**Open** server URL address in web-browser and copy *TOKEN*, and *Server URL* if needed.\r\n\r\n### 2. Connecting from the Client (Colab/Jupyter)\r\n\r\nIn your Jupyter/Colab notebook, load the magics and set up the remote backend:\r\n\r\n```python\r\n%load_ext arduino_colab_kernel.magic_project\r\n%load_ext arduino_colab_kernel.magic_board\r\n%load_ext arduino_colab_kernel.magic_code\r\n%load_ext arduino_colab_kernel.magic_serial\r\n\r\nMY_API_TOKEN = input(\"Enter your API token: \")  # Use the same token as the server\r\nREMOTE_URL = \"http://<server-ip>:<server-port>\"  # Replace <server-ip> and <server-port> with your server's IP address and port (*Optional*)\r\n\r\n# Load or initialize a project in remote mode\r\n%project load --mode remote --remote_url $REMOTE_URL --token $MY_API_TOKEN\r\n# init\r\n%project init --mode remote --remote_url $REMOTE_URL --token $MY_API_TOKEN\r\n\r\n# or use simplify version with default server address:\r\n%project load --mode remote --token {MY_API_TOKEN}\r\n# init\r\n%project init --mode remote --token {MY_API_TOKEN}\r\n```\r\n\r\n### 3. Workflow\r\n\r\n- Use `%project`, `%board`, `%%code`, and `%serial` magics as usual.\r\n- All compile/upload/serial operations will be forwarded to the remote server.\r\n\r\n---\r\n\r\n## Example\r\n\r\n```python\r\n# Set up remote backend\r\nMY_API_TOKEN = \"YOUR_TOKEN\"\r\nREMOTE_URL = \"http://192.168.1.100:5000\"\r\n\r\n%project init my_project --mode remote --remote_url $REMOTE_URL --token $MY_API_TOKEN\r\n%board select uno\r\n%%code setup\r\npinMode(13, OUTPUT);\r\n%%code loop\r\ndigitalWrite(13, HIGH); delay(500); digitalWrite(13, LOW); delay(500);\r\n%board upload\r\n%serial listen --duration 10\r\n```\r\n\r\n---\r\n\r\n## Security\r\n\r\n- Always use a strong, secret token for authentication.\r\n- Never expose your remote server to the public internet without proper security.\r\n\r\n---\r\n\r\nFor more details, see project Arduino Colab on [Github](https://github.com/sgtkingo/ArduinoColab)\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "HW bridge for Arduino Colab",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/sgtkingo/ArduinoColab",
        "Issues": "https://github.com/sgtkingo/ArduinoColab/issues",
        "Repository": "https://github.com/sgtkingo/ArduinoColab"
    },
    "split_keywords": [
        "arduino",
        " esp32",
        " jupyter",
        " magics",
        " notebook"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "caec520a31afa552b4e49d52569d71d1f408ce8039bcf170fec14e30821c2097",
                "md5": "5c209a890a5d8e642cea6978dfed2402",
                "sha256": "cad0b1f371989099dcc7d56d7bf3c7a4ba372496f3eadae22a4cf3aa9ff01b38"
            },
            "downloads": -1,
            "filename": "arduino_colab_bridge-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5c209a890a5d8e642cea6978dfed2402",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 6771,
            "upload_time": "2025-08-30T15:52:03",
            "upload_time_iso_8601": "2025-08-30T15:52:03.950646Z",
            "url": "https://files.pythonhosted.org/packages/ca/ec/520a31afa552b4e49d52569d71d1f408ce8039bcf170fec14e30821c2097/arduino_colab_bridge-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b14996220c9dd69ddcdd94f84c756fe3cce22f421792888b58152f61ba9037aa",
                "md5": "9a8529ffb54c7be5d852f6e0c8357713",
                "sha256": "cd633a5463c458f850ca8132e6103914f4e1b130cd6363aae668fe19f8ebd079"
            },
            "downloads": -1,
            "filename": "arduino_colab_bridge-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9a8529ffb54c7be5d852f6e0c8357713",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6563,
            "upload_time": "2025-08-30T15:52:05",
            "upload_time_iso_8601": "2025-08-30T15:52:05.180656Z",
            "url": "https://files.pythonhosted.org/packages/b1/49/96220c9dd69ddcdd94f84c756fe3cce22f421792888b58152f61ba9037aa/arduino_colab_bridge-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-30 15:52:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sgtkingo",
    "github_project": "ArduinoColab",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "arduino-colab-kernel",
            "specs": []
        }
    ],
    "lcname": "arduino-colab-bridge"
}
        
Elapsed time: 1.25702s