remoteio


Nameremoteio JSON
Version 2.1 PyPI version JSON
download
home_pageNone
Summaryremoteio - Remote GPIO control
upload_time2024-10-15 14:26:49
maintainerNone
docs_urlNone
authorChristoph Scherbeck
requires_pythonNone
licenseNone
keywords python remoteio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # remoteio
A Raspberry Pi GPIO remote control based on gpiozero

https://github.com/gpiozero/gpiozero

# new behavior of remoteio: simultaneous processing of remote pins
When remoteio proceeds 2 pins, the second pin must wait until the first one has made his work on the server. This may take time, if the first pin has a long timer and the second pin cannot start its work.
A pin blocks itself in the same way. In this modification of remoteio, different pins can work simultaneously. If a pin has two tasks and the second one is asked to start before the first one has finished,
the second one interrupts the first one.
The main modifications are the use of 
  1. a list of maps, that allows sending of tasks of several pins to the server
  2. an own thread for each pin for treating
  3. thread safe queues for each pin as input to the pin-specific threads
  4. a thread.Timer in handle_timer instead of time.sleep in order to make the interruption of a task with a time_ms>0 possible
  5. the getattr function to find led-funtions only by knowing the name of the function 

Further, the internal pin numbering is 'b', by the aid of a conversion dictionary. This allows to suppress the establishing of the sam pin two times by different representations by 'b' and 'g'
The syntax to operate the pins is the same as that of remoteio.

## Server (remote Raspberry Pi)
Use this all-in-one command to install remoteio as deamon on port `8509`.
The server can be updated with this command.
```
bash -c "$(wget -qLO - https://github.com/schech1/remoteio/raw/master/install.sh)"

```

##  Using pip
```
pip install remoteio
```
When you want to create the server by yourself, you can install the library via
pip and use the examples below, for server- and client usage.



## Server usage
Start a remote server on port `1234`.
If no port is specified default port `8509` will be used

```
from remoteio import run_server

if __name__ == "__main__":
    run_server(port=1234)

```


## Client usage
```
from remoteio import RemoteServer

if __name__ == "__main__":
    server_ip = "192.168.1.38"
    server_port = 1234

    remote_server = RemoteServer(server_ip, server_port)
    remote_pin = remote_server.pin(7, 'b')
    remote_pin.on(time_ms=2000) # (Optional) Time until switch off
    remote_pin.blink() # Blink LED
    remote_pin.pulse() # Pulse LED
    remote_pin.off()
    remote_server.close()
```

### Use Board numbering
```
remote_pin = remote_server.pin(7, 'b') # Use physical board numbering
```
### Use GPIO numbering
```
remote_pin = remote_server.pin(4, 'g') # Use GPIO numbering (e.g. GPIO4)
```




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "remoteio",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, remoteio",
    "author": "Christoph Scherbeck",
    "author_email": "christoph@scherbeck.tech",
    "download_url": "https://files.pythonhosted.org/packages/7a/a6/186432bdb7a8830232923ade5a72614d3acf84832e0273412757c765d8c3/remoteio-2.1.tar.gz",
    "platform": null,
    "description": "# remoteio\nA Raspberry Pi GPIO remote control based on gpiozero\n\nhttps://github.com/gpiozero/gpiozero\n\n# new behavior of remoteio: simultaneous processing of remote pins\nWhen remoteio proceeds 2 pins, the second pin must wait until the first one has made his work on the server. This may take time, if the first pin has a long timer and the second pin cannot start its work.\nA pin blocks itself in the same way. In this modification of remoteio, different pins can work simultaneously. If a pin has two tasks and the second one is asked to start before the first one has finished,\nthe second one interrupts the first one.\nThe main modifications are the use of \n  1. a list of maps, that allows sending of tasks of several pins to the server\n  2. an own thread for each pin for treating\n  3. thread safe queues for each pin as input to the pin-specific threads\n  4. a thread.Timer in handle_timer instead of time.sleep in order to make the interruption of a task with a time_ms>0 possible\n  5. the getattr function to find led-funtions only by knowing the name of the function \n\nFurther, the internal pin numbering is 'b', by the aid of a conversion dictionary. This allows to suppress the establishing of the sam pin two times by different representations by 'b' and 'g'\nThe syntax to operate the pins is the same as that of remoteio.\n\n## Server (remote Raspberry Pi)\nUse this all-in-one command to install remoteio as deamon on port `8509`.\nThe server can be updated with this command.\n```\nbash -c \"$(wget -qLO - https://github.com/schech1/remoteio/raw/master/install.sh)\"\n\n```\n\n##  Using pip\n```\npip install remoteio\n```\nWhen you want to create the server by yourself, you can install the library via\npip and use the examples below, for server- and client usage.\n\n\n\n## Server usage\nStart a remote server on port `1234`.\nIf no port is specified default port `8509` will be used\n\n```\nfrom remoteio import run_server\n\nif __name__ == \"__main__\":\n    run_server(port=1234)\n\n```\n\n\n## Client usage\n```\nfrom remoteio import RemoteServer\n\nif __name__ == \"__main__\":\n    server_ip = \"192.168.1.38\"\n    server_port = 1234\n\n    remote_server = RemoteServer(server_ip, server_port)\n    remote_pin = remote_server.pin(7, 'b')\n    remote_pin.on(time_ms=2000) # (Optional) Time until switch off\n    remote_pin.blink() # Blink LED\n    remote_pin.pulse() # Pulse LED\n    remote_pin.off()\n    remote_server.close()\n```\n\n### Use Board numbering\n```\nremote_pin = remote_server.pin(7, 'b') # Use physical board numbering\n```\n### Use GPIO numbering\n```\nremote_pin = remote_server.pin(4, 'g') # Use GPIO numbering (e.g. GPIO4)\n```\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "remoteio - Remote GPIO control",
    "version": "2.1",
    "project_urls": {
        "Homepage": "https://github.com/schech1/remoteio"
    },
    "split_keywords": [
        "python",
        " remoteio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f0a7db880518ea61eccec732e937ca3e2552cb73bd026166892d39ba8d2694c",
                "md5": "156ff9ae222952a65525cd377a28c5d5",
                "sha256": "b977ada040adb98ca063d2625782a6830e839cdcd8e9377298a94b6a20f02ba9"
            },
            "downloads": -1,
            "filename": "remoteio-2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "156ff9ae222952a65525cd377a28c5d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 18548,
            "upload_time": "2024-10-15T14:26:48",
            "upload_time_iso_8601": "2024-10-15T14:26:48.440006Z",
            "url": "https://files.pythonhosted.org/packages/8f/0a/7db880518ea61eccec732e937ca3e2552cb73bd026166892d39ba8d2694c/remoteio-2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7aa6186432bdb7a8830232923ade5a72614d3acf84832e0273412757c765d8c3",
                "md5": "1da59cccc6812fe587959385c5fe5cad",
                "sha256": "70e7c0a53ff8b52c6b89413f8b27a7d1313bc7aaacbac07c9f814c5d522a2e7e"
            },
            "downloads": -1,
            "filename": "remoteio-2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1da59cccc6812fe587959385c5fe5cad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17760,
            "upload_time": "2024-10-15T14:26:49",
            "upload_time_iso_8601": "2024-10-15T14:26:49.576206Z",
            "url": "https://files.pythonhosted.org/packages/7a/a6/186432bdb7a8830232923ade5a72614d3acf84832e0273412757c765d8c3/remoteio-2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-15 14:26:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "schech1",
    "github_project": "remoteio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "remoteio"
}
        
Elapsed time: 0.52752s