-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: yoyojacky <[email protected]>
- Loading branch information
Showing
10 changed files
with
498 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
# absminitowerkit | ||
ABS mini tower kit 's driver and installation script. | ||
## How to use it?## | ||
* Download the repository to your Raspberry Pi (Current version 2024-3-15 bookworm 64bit) | ||
### Install the driver ### | ||
* Open a terminal and make sure your Raspberry Pi can access internet and Github site. | ||
```bash | ||
cd ~ | ||
git clone https://github.com/geeekpi/absminitowerkit.git | ||
cd absminitowerkit/ | ||
./install_bookworm.sh | ||
``` | ||
* It will `Reboot` Raspberry Pi `automatically`. | ||
* Have fun! | ||
|
||
### Uninstall the driver ### | ||
* Open a terminal and execute the `uninstall.sh` script. | ||
```bash | ||
cd ~ | ||
cd absminitowerkit/ | ||
./uninstall.sh | ||
``` | ||
##End## | ||
If you want to create your own script, please check following location: | ||
* 1. /etc/systemd/system/minitower_moodlight.service --- moodlight service file | ||
* 2. /etc/systemd/system/minitower_oled.service --- OLED service file | ||
* 3. /usr/local/minitower/demo_opts.py --- OLED display script's dependency file | ||
* 4. /usr/local/minitower/sysinfo.py --- OLED display script | ||
* 5. /usr/bin/moodlight --- /tmp/rpi_ws281x/build/test binary file | ||
* 6. /boot/firmware/config.txt --- configuration of I2C: `dtparam=i2c_arm=on` | ||
* 7. /home/$USER/Downloads/examples ---Demo codes from luma.examples | ||
|
||
--- | ||
PS: please replace `$USER` to your own user name, we are using `pi` user by default. you can modify the `install_bookworm.sh` file in grant permission section. | ||
|
||
|
||
If you want to install the driver manually, please check the `systemd_file` folder and `demo_code` folder. | ||
Hope you like it and have a nice day! | ||
##BYE## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2014-2022 Richard Hull and contributors | ||
# See LICENSE.rst for details. | ||
|
||
import sys | ||
import logging | ||
|
||
from luma.core import cmdline, error | ||
|
||
|
||
# logging | ||
logging.basicConfig( | ||
level=logging.DEBUG, | ||
format='%(asctime)-15s - %(message)s' | ||
) | ||
# ignore PIL debug messages | ||
logging.getLogger('PIL').setLevel(logging.ERROR) | ||
|
||
|
||
def display_settings(device, args): | ||
""" | ||
Display a short summary of the settings. | ||
:rtype: str | ||
""" | ||
iface = '' | ||
display_types = cmdline.get_display_types() | ||
if args.display not in display_types['emulator']: | ||
iface = f'Interface: {args.interface}\n' | ||
|
||
lib_name = cmdline.get_library_for_display_type(args.display) | ||
if lib_name is not None: | ||
lib_version = cmdline.get_library_version(lib_name) | ||
else: | ||
lib_name = lib_version = 'unknown' | ||
|
||
import luma.core | ||
version = f'luma.{lib_name} {lib_version} (luma.core {luma.core.__version__})' | ||
|
||
return f'Version: {version}\nDisplay: {args.display}\n{iface}Dimensions: {device.width} x {device.height}\n{"-" * 60}' | ||
|
||
|
||
def get_device(actual_args=None): | ||
""" | ||
Create device from command-line arguments and return it. | ||
""" | ||
if actual_args is None: | ||
actual_args = sys.argv[1:] | ||
parser = cmdline.create_parser(description='luma.examples arguments') | ||
args = parser.parse_args(actual_args) | ||
|
||
if args.config: | ||
# load config from file | ||
config = cmdline.load_config(args.config) | ||
args = parser.parse_args(config + actual_args) | ||
|
||
# create device | ||
try: | ||
device = cmdline.create_device(args) | ||
print(display_settings(device, args)) | ||
return device | ||
|
||
except error.Error as e: | ||
parser.error(e) | ||
return None | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.