-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding in linting for markdown files
- Loading branch information
1 parent
85cf5a6
commit edb3b1f
Showing
10 changed files
with
184 additions
and
51 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
lint-docs: | ||
name: Lint docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Lint docs | ||
uses: docker://avtodev/markdown-lint:v1 | ||
with: | ||
args: '**/*.md' | ||
config: .markdownlint.yaml |
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,5 @@ | ||
|
||
# MD013/line-length - Line length | ||
MD013: | ||
# Number of characters | ||
line_length: 120 |
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,2 @@ | ||
temp/ | ||
target/ |
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 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,41 +1,66 @@ | ||
# GunplaLED | ||
|
||
## What is this? | ||
This repo contains Python code that deploys to a [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#raspberry-pi-pico-w-and-pico-wh) that runs a web server allowing you to control individual LED's or program lightshows for a Gundam (or other gunpla) model kit. | ||
|
||
This repo contains Python code that deploys to a [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#raspberry-pi-pico-w-and-pico-wh) | ||
that runs a web server allowing you to control individual LED's or program lightshows for a Gundam (or other gunpla) | ||
model kit. | ||
|
||
## Why? | ||
When I was building RX-93 Nu Gundam ver ka, it lets you use a green LED module to light up the head. It was basically out of stock everywhere, so I had to look for alternatives. I also didn't like the idea of not having easy access to the on/off of the LED and having to replace batteries. So I wanted something more hardwired into an outlet that I could plug/unplug. I also do a lot of home automation, so I thought it'd be cool to have it connected to a smart plug. Seeing others on r/gunpla do more complicated LED setups and all the above made me think of running some sort of server I can cURL to make it light up. Then research led me here. | ||
|
||
When I was building RX-93 Nu Gundam ver ka, it lets you use a green LED module to light up the head. It was basically | ||
out of stock everywhere, so I had to look for alternatives. I also didn't like the idea of not having easy access to | ||
the on/off of the LED and having to replace batteries. So I wanted something more hardwired into an outlet that I could | ||
plug/unplug. I also do a lot of home automation, so I thought it'd be cool to have it connected to a smart plug. | ||
Seeing others on r/gunpla do more complicated LED setups and all the above made me think of running some sort of server | ||
I can cURL to make it light up. Then research led me here. | ||
**tl;dr** A Pico W and green LED is about the same cost as the official LED module but cooler. | ||
|
||
## Goals of this project | ||
|
||
* Be simple for anyone not technical to install and configure LEDs to their gunpla | ||
* Widespread Gunpla kit support | ||
* Thorough LED installation documentation and simple configuration | ||
* Eventual support of additional microcontrollers | ||
* Widespread community support | ||
|
||
## Project Status | ||
This project is in early alpha. It is considered to be functional and fulfills the minimum requirements of hosting a webserver that can control individual LEDs. However, there is still much to be done in terms of adding support for more gunpla models, expanding lightshows, bug fixes, etc. Therefore, until this project hits beta, there is no backwards support as areas of the codebase are rapidly changing and improving. Thus, when upgrading, it is recommended to start from the initial setup. | ||
|
||
# Installation | ||
At this time installation requires setting up a local Python development environment as some of the tooling requires it. The recommended OS's are GNU/Linux(Ubuntu) and macOS. Windows is not currently supported but is on the roadmap as it has a more complicated way of talking to the Raspberry Pi. | ||
This project is in early alpha. It is considered to be functional and fulfills the minimum requirements of hosting a | ||
webserver that can control individual LEDs. However, there is still much to be done in terms of adding support for more | ||
gunpla models, expanding lightshows, bug fixes, etc. Therefore, until this project hits beta, there is no backwards | ||
support as areas of the codebase are rapidly changing and improving. Thus, when upgrading, it is recommended to start | ||
from the initial setup. | ||
|
||
## Installation | ||
|
||
At this time installation requires setting up a local Python development environment as some of the tooling requires it. | ||
The recommended OS's are GNU/Linux(Ubuntu) and macOS. Windows is not currently supported but is on the roadmap as it | ||
has a more complicated way of talking to the Raspberry Pi. | ||
See the [installation instructions](docs/installation.md) for a full walkthrough of how to install | ||
## Requirements | ||
|
||
### Requirements | ||
|
||
* cli: make, python, pip, pyenv (optional) | ||
|
||
# Developer Setup | ||
The [developer setup](docs/developer_setup.md) to add and contribute to the project mainly consists of setting up an IDE environment in addition to setting up the tooling in [installation](docs/installation.md). | ||
## Developer Setup | ||
|
||
The [developer setup](docs/developer_setup.md) to add and contribute to the project mainly consists of setting up an | ||
IDE environment in addition to setting up the tooling in [installation](docs/installation.md). | ||
|
||
## Contributing | ||
|
||
# Contributing | ||
Contributions are very much welcome. For bugs and/or feature requests file a [issue](https://github.com/frozenwizard/GunplaLED/issues). If you'd like to contribute to a specific area such as HTML, additional kit support, etc submit a [PR](https://github.com/frozenwizard/GunplaLED/pulls) as well. | ||
Contributions are very much welcome. For bugs and/or feature requests file a [issue](https://github.com/frozenwizard/GunplaLED/issues) | ||
. If you'd like to contribute to a specific area such as HTML, additional kit support, etc submit a [PR](https://github.com/frozenwizard/GunplaLED/pulls) | ||
as well. | ||
|
||
## Roadmap | ||
|
||
# Roadmap | ||
* Better documentation for installation of each LED's on each kit | ||
* More Gunpla model support | ||
* More Gunpla model support | ||
* Windows support | ||
* Better UI | ||
* More lightshows and LED effects | ||
* Easier installation and configuration | ||
* Package and deploy dependencies better | ||
* Add the ability to play sounds | ||
|
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 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,30 +1,43 @@ | ||
# Developer Setup | ||
The recommended IDE is [Pycharm Community](https://www.jetbrains.com/pycharm). You will need to install the [micropython plugin](https://plugins.jetbrains.com/plugin/9777-micropython). | ||
|
||
The recommended IDE is [Pycharm Community](https://www.jetbrains.com/pycharm). You will need to install the | ||
[micropython plugin](https://plugins.jetbrains.com/plugin/9777-micropython) | ||
|
||
## Tooling Installation | ||
The tools needed to build and deploy are the same as the normal installation. Follow [this](/docs/installation.md#tooling-setup) for that setup. | ||
|
||
The tools needed to build and deploy are the same as the normal installation. Follow [this](/docs/installation.md#tooling-setup) | ||
for that setup. | ||
|
||
## Debugging | ||
Right now, there is no IDE support for debugging remotely and pdb has not been tested. So all debugging needs to be done with a Pico board attached and primarily through log or print statments | ||
|
||
Right now, there is no IDE support for debugging remotely and pdb has not been tested. So all debugging needs to be | ||
done with a Pico board attached and primarily through log or print statements. | ||
|
||
The easiest way is to connect the Pico to the computer and run the following commands: | ||
|
||
Build and deploy the latest code | ||
|
||
```shell | ||
make build deploy && rshell | ||
``` | ||
|
||
Navigate to the Pico board file system | ||
|
||
```shell | ||
cd /pyboard | ||
``` | ||
``` | ||
|
||
Activate the interactive Python interpreter | ||
|
||
```shell | ||
repl | ||
``` | ||
``` | ||
|
||
Import and run the webserver | ||
|
||
```python | ||
import main | ||
main.main() | ||
``` | ||
|
||
The server logs start to appear in the console. | ||
The server logs start to appear in the console. |
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,56 +1,86 @@ | ||
# Installation | ||
|
||
The following describes how to set up the necessary software tooling and deploys software to the Pico board. | ||
|
||
It is assumed that the user knows what a terminal, shell, etc is and how to use it, but has nothing configured on their system. | ||
#TODO: Link to an external overview of what the terminal and shell is, and how to use it. | ||
It is assumed that the user knows what a terminal, shell, etc is and how to use it, but has nothing configured on their | ||
system. TODO: Link to an external overview of what the terminal and shell is, and how to use it | ||
|
||
## Tooling Setup | ||
|
||
### Prerequisites | ||
|
||
#### macOS | ||
|
||
Install [brew.sh](https://brew.sh) to install the macOS package manager | ||
|
||
```shell | ||
brew install pyenv git wget | ||
brew install pyenv git wget markdownlint-cli | ||
``` | ||
|
||
#### GNU/Linux(Ubuntu) | ||
|
||
```shell | ||
sudo apt install pyenv git wget make | ||
sudo apt install pyenv git wget make markdownlint-cli | ||
``` | ||
|
||
After this make sure Pyenv is enabled correctly on your [shell](https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv) | ||
|
||
### Clone this repo | ||
If you have not done so yet git clone this repo to your desired directory. The green '<>code' button in GitHub will give you options on how to do that. | ||
|
||
If you have not done so yet git clone this repo to your desired directory. The green '<>code' button in GitHub will | ||
give you options on how to do that. | ||
|
||
### Install tooling | ||
Run the following make command to download micropython, install python, python requirements and generate the config file. This is a one time setup. | ||
|
||
Run the following make command to download micropython, install python, python requirements and generate the config | ||
file. This is a one time setup. | ||
|
||
```shell | ||
make setup && pyenv activate gunpla | ||
``` | ||
|
||
### Install MicroPython to the Raspberry Pico board | ||
MicroPython needs to be installed on the board before the project can be deployed. Plug a Micro-USB cable into the Pico board, hold down the [bootsel button](https://projects-static.raspberrypi.org/projects/getting-started-with-the-pico/725a421f3b51a5674c539d6953db5f1892509475/en/images/Pico-bootsel.png) and then plug the cable into your computer. | ||
This sets the Pico board as a usb mass storage device. The following OS appropriate command will automatically deploy MicroPython to the Pico board. | ||
|
||
MicroPython needs to be installed on the board before the project can be deployed. Plug a Micro-USB cable into the Pico | ||
board, hold down the [bootsel button](https://projects-static.raspberrypi.org/projects/getting-started-with-the-pico/725a421f3b51a5674c539d6953db5f1892509475/en/images/Pico-bootsel.png) | ||
and then plug the cable into your computer. | ||
This sets the Pico board as a usb mass storage device. The following OS appropriate command will automatically deploy | ||
MicroPython to the Pico board. | ||
|
||
```shell | ||
make install-micropython-osx | ||
``` | ||
|
||
Or | ||
|
||
```shell | ||
make install-micropython-ubuntu | ||
``` | ||
After completion the board will disappear as a device and reappear silently, so wait 10 seconds before continuing. | ||
|
||
After completion the board will disappear as a device and reappear silently, so wait 10 seconds before continuing. | ||
|
||
## Deploy the test build | ||
The test build is a simple Python script that helps to make sure the tooling has been setup correctly and things work. The test file will blink the onboard Pico LED several times and then stop. Run the following command, once the transfer has completed, unplug the Raspberry Pi Pico W and then plug it back in. You should see the onboard LEDs flash. | ||
|
||
The test build is a simple Python script that helps to make sure the tooling has been setup correctly and things work. | ||
The test file will blink the onboard Pico LED several times and then stop. Run the following command, once the transfer | ||
has completed, unplug the Raspberry Pi Pico W and then plug it back in. You should see the onboard LEDs flash. | ||
|
||
```shell | ||
make build-test deploy | ||
``` | ||
|
||
If there are any errors, they should be corrected before continuing to configure your gunpla. | ||
|
||
## Deploy your gunpla server | ||
Follow the steps in [configuring your gunpla](/docs/configuring_gunpla.md) to configure some important settings and make any modifications. It is recommended to set the configuration to the GenericGundam and make sure all the settings are correct before installing an LED's. Afterwards, run the following to build and deploy your configuration to the Pico board | ||
|
||
Follow the steps in [configuring your gunpla](/docs/configuring_gunpla.md) to configure some important settings and make | ||
any modifications. It is recommended to set the configuration to the GenericGundam and make sure all the settings are | ||
correct before installing an LED's. Afterwards, run the following to build and deploy your configuration to the Pico | ||
board | ||
|
||
```shell | ||
make build deploy | ||
``` | ||
``` | ||
|
||
Afterwards, you should be able to open a webpage to the hostname you set in the ```settings.py``` or find the IP address in your routers connected device list. If neither works, follow the [debugging guide](/docs/developer_setup.md) | ||
Afterwards, you should be able to open a webpage to the hostname you set in the ```settings.py``` or find the IP address | ||
in your routers connected device list. If neither works, follow the [debugging guide](/docs/developer_setup.md) |
Oops, something went wrong.