framework16-inputmodule


Nameframework16-inputmodule JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryA library to control input modules on the Framework 16 Laptop
upload_time2023-11-14 08:26:17
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords hatch
VCS
bugtrack_url
requirements get-key Pillow pyserial PySimpleGUI
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Framework Laptop 16 - Input Module Software

This repository contains a python library and scripts to control the
(non-keyboard) input modules, which is currently just the LED Matrix.

## Installing

Pre-requisites: Python with pip

```sh
python3 -m pip install framework16_inputmodule
```

## Control from the host

To build your own application see the: [API command documentation](https://github.com/FrameworkComputer/inputmodule-rs/tree/main/commands.md)

###### Permissions on Linux
To ensure that the input module's port is accessible, install the `udev` rule and trigger a reload:

```
sudo cp release/50-framework-inputmodule.rules /etc/udev/rules.d/
sudo udevadm control --reload && sudo udevadm trigger
```

##### Common commands:

###### Listing available devices

```sh
> ledmatrixctl
More than 1 compatible device found. Please choose with --serial-dev ...
Example on Windows: --serial-dev COM3
Example on Linux:   --serial-dev /dev/ttyACM0
/dev/ttyACM1
  VID:     0x32AC
  PID:     0x0020
  SN:      FRAKDEBZ0100000000
  Product: LED Matrix Input Module
/dev/ttyACM0
  VID:     0x32AC
  PID:     0x0020
  SN:      FRAKDEBZ0100000000
  Product: LED Matrix Input Module
```

###### Apply command to single device

When there are multiple devices you need to select which one to control.

```
# Example on Linux
> ledmatrixctl --serial-dev /dev/ttyACM0 --percentage 33

# Example on Windows
> ledmatrixctl --serial-dev COM5 --percentage 33
```

### Graphical Application

Launch the graphical application

```sh
# Either via the commandline
ledmatrixctl --gui

# Or using the standanlone application
ledmatrixgui
```

### Other example commands

```sh

# Show current time and keep updating it
ledmatrixctl --clock

# Draw PNG or GIF
ledmatrixctl --image stripe.gif
ledmatrixctl --image stripe.png

# Change brightness (0-255)
ledmatrixctl --brightness 50
```

### All commandline options

```
> ledmatrixctl --help
options:
  -h, --help            show this help message and exit
  -l, --list            List all compatible devices
  --bootloader          Jump to the bootloader to flash new firmware
  --sleep, --no-sleep   Simulate the host going to sleep or waking up
  --is-sleeping         Check current sleep state
  --brightness BRIGHTNESS
                        Adjust the brightness. Value 0-255
  --get-brightness      Get current brightness
  --animate, --no-animate
                        Start/stop vertical scrolling
  --get-animate         Check if currently animating
  --pwm {29000,3600,1800,900}
                        Adjust the PWM frequency. Value 0-255
  --get-pwm             Get current PWM Frequency
  --pattern {...}       Display a pattern
  --image IMAGE         Display a PNG or GIF image in black and white only)
  --image-grey IMAGE_GREY
                        Display a PNG or GIF image in greyscale
  --camera              Stream from the webcam
  --video VIDEO         Play a video
  --percentage PERCENTAGE
                        Fill a percentage of the screen
  --clock               Display the current time
  --string STRING       Display a string or number, like FPS
  --symbols SYMBOLS [SYMBOLS ...]
                        Show symbols (degF, degC, :), snow, cloud, ...)
  --gui                 Launch the graphical version of the program
  --panic               Crash the firmware (TESTING ONLY)
  --blink               Blink the current pattern
  --breathing           Breathing of the current pattern
  --eq EQ [EQ ...]      Equalizer
  --random-eq           Random Equalizer
  --wpm                 WPM Demo
  --snake               Snake
  --snake-embedded      Snake on the module
  --pong-embedded       Pong on the module
  --game-of-life-embedded {currentmatrix,pattern1,blinker,toad,beacon,glider}
                        Game of Life
  --quit-embedded-game  Quit the current game
  --all-brightnesses    Show every pixel in a different brightness
  -v, --version         Get device version
  --serial-dev SERIAL_DEV
                        Change the serial dev. Probably /dev/ttyACM0 on Linux, COM0 on Windows
```

## Update the Firmware

First, put the module into bootloader mode.

This can be done either by flipping DIP switch #2 or
by using one of the following commands: 

```sh
> ledmatrixctl --bootloader
```

Then the module will present itself in the same way as a USB thumb drive.
Copy the UF2 firmware file onto it and the device will flash and reset automatically.
```

### Check the firmware version of the device

```sh
> ledmatrixctl --version
Device Version: 0.1.7
```

###### By looking at the USB descriptor

On Linux:

```sh
> lsusb -d 32ac: -v 2> /dev/null | grep -P 'ID 32ac|bcdDevice'
Bus 003 Device 078: ID 32ac:0020 Framework Computer Inc LED Matrix Input Module
  bcdDevice            0.17
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "framework16-inputmodule",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "hatch",
    "author": "",
    "author_email": "Daniel Schaefer <dhs@frame.work>",
    "download_url": "https://files.pythonhosted.org/packages/88/d8/b97e5debd0e7f7a4dd6f8aa58a355f6eb5c9e079573638c8072b0f53f944/framework16_inputmodule-0.1.1.tar.gz",
    "platform": null,
    "description": "# Framework Laptop 16 - Input Module Software\n\nThis repository contains a python library and scripts to control the\n(non-keyboard) input modules, which is currently just the LED Matrix.\n\n## Installing\n\nPre-requisites: Python with pip\n\n```sh\npython3 -m pip install framework16_inputmodule\n```\n\n## Control from the host\n\nTo build your own application see the: [API command documentation](https://github.com/FrameworkComputer/inputmodule-rs/tree/main/commands.md)\n\n###### Permissions on Linux\nTo ensure that the input module's port is accessible, install the `udev` rule and trigger a reload:\n\n```\nsudo cp release/50-framework-inputmodule.rules /etc/udev/rules.d/\nsudo udevadm control --reload && sudo udevadm trigger\n```\n\n##### Common commands:\n\n###### Listing available devices\n\n```sh\n> ledmatrixctl\nMore than 1 compatible device found. Please choose with --serial-dev ...\nExample on Windows: --serial-dev COM3\nExample on Linux:   --serial-dev /dev/ttyACM0\n/dev/ttyACM1\n  VID:     0x32AC\n  PID:     0x0020\n  SN:      FRAKDEBZ0100000000\n  Product: LED Matrix Input Module\n/dev/ttyACM0\n  VID:     0x32AC\n  PID:     0x0020\n  SN:      FRAKDEBZ0100000000\n  Product: LED Matrix Input Module\n```\n\n###### Apply command to single device\n\nWhen there are multiple devices you need to select which one to control.\n\n```\n# Example on Linux\n> ledmatrixctl --serial-dev /dev/ttyACM0 --percentage 33\n\n# Example on Windows\n> ledmatrixctl --serial-dev COM5 --percentage 33\n```\n\n### Graphical Application\n\nLaunch the graphical application\n\n```sh\n# Either via the commandline\nledmatrixctl --gui\n\n# Or using the standanlone application\nledmatrixgui\n```\n\n### Other example commands\n\n```sh\n\n# Show current time and keep updating it\nledmatrixctl --clock\n\n# Draw PNG or GIF\nledmatrixctl --image stripe.gif\nledmatrixctl --image stripe.png\n\n# Change brightness (0-255)\nledmatrixctl --brightness 50\n```\n\n### All commandline options\n\n```\n> ledmatrixctl --help\noptions:\n  -h, --help            show this help message and exit\n  -l, --list            List all compatible devices\n  --bootloader          Jump to the bootloader to flash new firmware\n  --sleep, --no-sleep   Simulate the host going to sleep or waking up\n  --is-sleeping         Check current sleep state\n  --brightness BRIGHTNESS\n                        Adjust the brightness. Value 0-255\n  --get-brightness      Get current brightness\n  --animate, --no-animate\n                        Start/stop vertical scrolling\n  --get-animate         Check if currently animating\n  --pwm {29000,3600,1800,900}\n                        Adjust the PWM frequency. Value 0-255\n  --get-pwm             Get current PWM Frequency\n  --pattern {...}       Display a pattern\n  --image IMAGE         Display a PNG or GIF image in black and white only)\n  --image-grey IMAGE_GREY\n                        Display a PNG or GIF image in greyscale\n  --camera              Stream from the webcam\n  --video VIDEO         Play a video\n  --percentage PERCENTAGE\n                        Fill a percentage of the screen\n  --clock               Display the current time\n  --string STRING       Display a string or number, like FPS\n  --symbols SYMBOLS [SYMBOLS ...]\n                        Show symbols (degF, degC, :), snow, cloud, ...)\n  --gui                 Launch the graphical version of the program\n  --panic               Crash the firmware (TESTING ONLY)\n  --blink               Blink the current pattern\n  --breathing           Breathing of the current pattern\n  --eq EQ [EQ ...]      Equalizer\n  --random-eq           Random Equalizer\n  --wpm                 WPM Demo\n  --snake               Snake\n  --snake-embedded      Snake on the module\n  --pong-embedded       Pong on the module\n  --game-of-life-embedded {currentmatrix,pattern1,blinker,toad,beacon,glider}\n                        Game of Life\n  --quit-embedded-game  Quit the current game\n  --all-brightnesses    Show every pixel in a different brightness\n  -v, --version         Get device version\n  --serial-dev SERIAL_DEV\n                        Change the serial dev. Probably /dev/ttyACM0 on Linux, COM0 on Windows\n```\n\n## Update the Firmware\n\nFirst, put the module into bootloader mode.\n\nThis can be done either by flipping DIP switch #2 or\nby using one of the following commands: \n\n```sh\n> ledmatrixctl --bootloader\n```\n\nThen the module will present itself in the same way as a USB thumb drive.\nCopy the UF2 firmware file onto it and the device will flash and reset automatically.\n```\n\n### Check the firmware version of the device\n\n```sh\n> ledmatrixctl --version\nDevice Version: 0.1.7\n```\n\n###### By looking at the USB descriptor\n\nOn Linux:\n\n```sh\n> lsusb -d 32ac: -v 2> /dev/null | grep -P 'ID 32ac|bcdDevice'\nBus 003 Device 078: ID 32ac:0020 Framework Computer Inc LED Matrix Input Module\n  bcdDevice            0.17\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library to control input modules on the Framework 16 Laptop",
    "version": "0.1.1",
    "project_urls": {
        "Issues": "https://github.com/FrameworkComputer/inputmodule-rs/issues",
        "Source": "https://github.com/FrameworkComputer/inputmodule-rs"
    },
    "split_keywords": [
        "hatch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61e9a9d6661a74b8f37d8d08a64b18f6c751833274e6c5ddad277224e3635d69",
                "md5": "5abe90caa73fa022c322e26fa5527a03",
                "sha256": "9ca49e8cfcf31ae786d21ee6a446e5ff9bbbb198351a72fccb6ef658cd5bd60b"
            },
            "downloads": -1,
            "filename": "framework16_inputmodule-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5abe90caa73fa022c322e26fa5527a03",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 21038,
            "upload_time": "2023-11-14T08:26:16",
            "upload_time_iso_8601": "2023-11-14T08:26:16.270938Z",
            "url": "https://files.pythonhosted.org/packages/61/e9/a9d6661a74b8f37d8d08a64b18f6c751833274e6c5ddad277224e3635d69/framework16_inputmodule-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88d8b97e5debd0e7f7a4dd6f8aa58a355f6eb5c9e079573638c8072b0f53f944",
                "md5": "1c2bce0d326c32a9fb81b9db5ea756fb",
                "sha256": "a43bfc98819966dc4ee5e371e44e91bc61db204dddaf5cdf517fb9716a8816b4"
            },
            "downloads": -1,
            "filename": "framework16_inputmodule-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1c2bce0d326c32a9fb81b9db5ea756fb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 17163,
            "upload_time": "2023-11-14T08:26:17",
            "upload_time_iso_8601": "2023-11-14T08:26:17.781936Z",
            "url": "https://files.pythonhosted.org/packages/88/d8/b97e5debd0e7f7a4dd6f8aa58a355f6eb5c9e079573638c8072b0f53f944/framework16_inputmodule-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-14 08:26:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FrameworkComputer",
    "github_project": "inputmodule-rs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "get-key",
            "specs": [
                [
                    "==",
                    "1.60.0"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "10.0.0"
                ]
            ]
        },
        {
            "name": "pyserial",
            "specs": [
                [
                    "==",
                    "3.5"
                ]
            ]
        },
        {
            "name": "PySimpleGUI",
            "specs": [
                [
                    "==",
                    "4.60.5"
                ]
            ]
        }
    ],
    "lcname": "framework16-inputmodule"
}
        
Elapsed time: 1.13661s