aboutsummaryrefslogtreecommitdiff
path: root/docs/Usage
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2019-09-22 13:12:44 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2019-09-22 13:12:44 +0200
commite6880cd8ccf82d993f222cb14b4860581654acb8 (patch)
tree45f318f4ece2f0d6ca73fc3f775b9ba277ccdb77 /docs/Usage
parente911f8029ca612d3b17ced300cdf5b6f13e20972 (diff)
parent2e60b25ae368b8c19ce5e982aa2672a6c56edf90 (diff)
downloadLuxcena-Neo-e6880cd8ccf82d993f222cb14b4860581654acb8.tar.gz
Luxcena-Neo-e6880cd8ccf82d993f222cb14b4860581654acb8.zip
Merge branch 'master' of https://github.com/JakobST1n/Luxcena-Neo
Diffstat (limited to 'docs/Usage')
-rw-r--r--docs/Usage/CLI.md96
-rw-r--r--docs/Usage/Configuration.md82
-rw-r--r--docs/Usage/Install.md35
-rw-r--r--docs/Usage/README.md11
4 files changed, 224 insertions, 0 deletions
diff --git a/docs/Usage/CLI.md b/docs/Usage/CLI.md
new file mode 100644
index 0000000..6052193
--- /dev/null
+++ b/docs/Usage/CLI.md
@@ -0,0 +1,96 @@
+# Command line interface
+---
+
+This gets installed in the `/usr/bin` directory, and can be called by:
+```bash
+$ luxcena-neo.sh
+```
+or is alias
+```bash
+$ lux-neo
+```
+{% hint style='danger' %}
+This CLI assumes root access, so please run it with `sudo`
+{% endhint %}
+
+## Options
+### `sudo lux-neo uninstall`
+Uninstall the whole thing. You will have to remove this script yourself.
+
+### `sudo lux-neo update (skipNode)`
+Update to the newest version on the current branch.
+If `skipNode` is the second argument, `npm` won't be run.
+
+### `sudo lux-neo conf`
+Open the strip-config in `nano`.
+
+### `sudo lux-neo start (boot)`
+Start the server.
+If you add `boot`, it will start when the system boots:
+```bash
+sudo lux-neo start boot
+```
+
+### `sudo lux-neo stop (boot)`
+Stop the server.
+If you add `boot`, it will *NOT* start when the system boots:
+```bash
+sudo lux-neo start boot
+```
+
+### `sudo lux-neo status`
+This will output the status of the app. First it reports if the service is running,
+and some general info. Then it prints the systemd-status report.
+
+Example output:
+```text
+Luxcena-neo-cli [args: 'status']
+
+╭─────────────────────╮
+│ Service active: yes │
+│ Starts on boot: yes │
+│ Has failed: no │
+╰─────────────────────╯
+
+━━━Service status━━━━━━━━━━━━━━━━━━
+● luxcena-neo.service - Luxcena Neo
+ Loaded: loaded (/etc/systemd/system/luxcena-neo.service; enabled; vendor preset: enabled)
+ Active: active (running) since Wed 2018-12-05 22:55:28 UTC; 6min ago
+ Main PID: 2365 (luxcena-neo.sh)
+ CGroup: /system.slice/luxcena-neo.service
+ ├─2365 /bin/bash /home/lux-neo/src/bin/luxcena-neo.sh
+ └─2367 node /home/lux-neo/src/app.js
+
+Dec 05 22:55:28 LUXCENA-STUE-SKAP systemd[1]: Started Luxcena Neo.
+━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+```
+
+### `sudo lux-neo log service/app`
+This shows the last 20 lines of the chosen log-file. And stays open to show
+all new entries.
+
+Example output:
+```text
+Luxcena-neo-cli [args: 'log app']
+
+━━━App log (press ctrl+c to exit)━━━━━━━━━━━━━━━━━━
+[3.11.2018 23:5:21:401] EVENT Starting Luxcena-Neo...
+[3.11.2018 23:5:22:462] SUCCESS Webserver now listening at *:8080
+```
+
+### `sudo lux-neo version`
+Currently not really doing anything usefull apart from showing which branch you are on.
+
+Example output:
+```text
+Luxcena-neo-cli [args: 'version']
+
+╭─────────────────────╮
+│ Version: Unknown │
+│ branch : dev │
+╰─────────────────────╯
+```
+### `sudo lux-neo selectBranch <branch>`
+This will change what branch you are on to <branch>. Stashing changes (shouldn't be a concern, but just saying it anyways).
+
+*Please note that the version-checker now will just be useless, as it does not now what branch we really are on.*
diff --git a/docs/Usage/Configuration.md b/docs/Usage/Configuration.md
new file mode 100644
index 0000000..f13d639
--- /dev/null
+++ b/docs/Usage/Configuration.md
@@ -0,0 +1,82 @@
+# Configuration
+
+How to setup luxcena-neo to work with your setup
+
+---
+
+```bash
+$ sudo lux-neo conf
+```
+
+When running the command above, a config file should appear in the editor 'nano'.
+```json
+{
+ "led_count": 53,
+ "segments": [],
+ "matrix": [],
+ "segmentConfiguration": "snake",
+ "led_pin": 18,
+ "led_freq_hz": 800000,
+ "led_dma": 10,
+ "led_invert": false,
+ "led_channel": 0
+}
+```
+{% hint style='tip' %}
+If you rather want to use vim or another editor, the file is at `/home/lux-neo/userdata/config/strip.json`
+{% endhint %}
+
+## led_count
+
+This is the number of LED's you want to control.
+
+## segments
+
+This is a simple list, here you should add the lenghts of all your segments. Please enter the "real" length, and don't start counting from 0. If you just want one segment, you should just have one element in the list, which is the number of led's you are controlling.
+
+When summing this list, it should check out with the "led-count"-option.
+
+## matrix
+
+This is a two dimensonal array, used to arrange the segments in a matrix of your likings. Here you enter the segment-number to represent them. In the example above, all the segments are in one line. If you want to have them in a square, it could look like this:
+
+```json
+"segments": [10, 10, 10, 10, 10, 10, 10, 10, 10],
+"matrix": [
+ [[0, false], [1, true], [2, false]],
+ [[3, true], [4, false], [5, true]],
+ [[6, false], [7, true], [8, false]]
+]
+```
+Each entry looks is a list, with two parameters, `[<segment_number>, <invert>]`
+{% hint style='danger' %}
+If you don't have a reference to all the segments or something, the matrix setup will fail. And fall back to 'segmentsconfiguration'
+{% endhint %}
+
+## segmentconfiguration
+
+If the matrix-option is empty or badly setup. The matrix will be set up using one of these defaults:
+
+```
+"snake":
+"line":
+"random":
+```
+
+## led_pin
+If using the luxcena-shield, you shouldn't have to worry about this option. But set it to the GPIO-port connected to your pixel's din-port.
+
+## led_dma
+{% hint style='danger' %}
+If using a newer RPi (3 or newer), leave this as 10! Or your file-system might crash.
+{% endhint %}
+This is the dma-channel used to generate the data-stream. If you for some reason need channel 10 for something else, you can change it. But i strongly recommend leaving it to 10!
+
+## led_invert
+This should not be touched, unless you are using a inverting level converter.
+
+## led_channel
+Leave this as default unless you know what you are doing.
+
+---
+Now you might want to take a look at the [command line interface](/Usage/CLI.md).
diff --git a/docs/Usage/Install.md b/docs/Usage/Install.md
new file mode 100644
index 0000000..5f19d39
--- /dev/null
+++ b/docs/Usage/Install.md
@@ -0,0 +1,35 @@
+# Installation
+
+If you want to install luxcena-neo to use it, these are the instructions:
+
+---
+
+## Requirements
+* The luxcena-shield
+* Access to the raspberry pi (SSH or direct)
+* Root access (preferably through the `sudo` command)
+
+## Install
+1. Start with logging into your Raspberry Pi
+2. Run these commands
+```bash
+$ git clone https://github.com/JakobST1n/Luxcena-Neo
+$ cd Luxcena-Neo
+$ sudo ./bin/install.sh
+```
+3. Follow the instructions on screen. You should answer yes to most of the questions.
+4. The install-process might seem to hang, but there is just no output being sent to the console. If you want to see a bit more verbose output. Open another terminal session, and run this command:
+```bash
+$ tail -n 10 -f /tmp/luxcena-neo.install.log
+```
+This is also where you will find possible reasons for a failed install.
+4. Luxcena-Neo should now be installed. Start it with this command
+```bash
+$ luxcena-neo start
+```
+
+## Troubleshooting
+We haven't encountered any troubles yet, but once we do, we will post fix'es here.
+
+---
+You should now be all set to [configuring luxcena-neo](/Usage/Configuration.md).
diff --git a/docs/Usage/README.md b/docs/Usage/README.md
new file mode 100644
index 0000000..ce62034
--- /dev/null
+++ b/docs/Usage/README.md
@@ -0,0 +1,11 @@
+# Usage
+
+
+## [Install](/Usage/Install.md)
+Want to install luxcena-neo? This is the guide!
+
+## [Configuration](/Usage/Configuration.md)
+Just installed luxcena-neo, or you have changed your setup? This is the guide!
+
+## [CLI](/Usage/CLI.md)
+Ready to start the thing? Or change something?