diff --git a/.vscode/settings.json b/.vscode/settings.json
index feb10db..c61cd55 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -13,6 +13,8 @@
"deque": "cpp",
"list": "cpp",
"unordered_map": "cpp",
- "vector": "cpp"
+ "vector": "cpp",
+ "tuple": "cpp",
+ "utility": "cpp"
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index b93a14a..c6e6823 100644
--- a/README.md
+++ b/README.md
@@ -1,43 +1,9 @@
# Illumination-Cat
-This is the brain of the the almighty [Illumination Cat](https://www.thingiverse.com/thing:2974862).
+This is the brain of the the almighty Illumination-Cat.
-## API
-### WebSocket
-Endpoint: /pixel
+## Resources & Documentation
+[3D Model](https://www.thingiverse.com/thing:2974862)
+[Installation](https://gitlab.com/0x1d/illucat/blob/master/installation.md)
+[API](https://gitlab.com/0x1d/illucat/blob/master/api.md)
+[OctoPrint Stuff](https://github.com/FrYakaTKoP/simple-octo-ws2812)
-Fields:
-|Field|Type|Description|
-| --- |---| ---|
-| topic | String | Defines which functionality is executed, usually to set a value or activate a pattern |
-| payload | String | data to be set |
-
-Example:
-``` json
-{
- "topic": "pixels/color",
- "payload": "13505813"
-}
-```
-#### Topics
-| Topic | Data |
-| ----- | ---- |
-| pixels/color | |
-| pixels/color2 | |
-| pixels/pattern | |
-| pixels/totalSteps | |
-| pixels/brightness | |
-
-### REST
-#### Endpoints
-POST /pixel/state
-POST /config
-
-### Mesh
-
-## Features
-- Enduser setup: initial setup where the cat opens an access point for configuration
-- WiFi: connect to existing AP as client or build a mesh network where all cats act as a collective
-- Web controls: colors and patterns can be changed through the web interface
-- OTA plugin: cats connected to an AP can be updated over-the-air via TCP flash method
-- [0%] audio output
-- [0%] OctoPrint plugin: connect to an OctoPrint instance and reflect print status via colors
\ No newline at end of file
diff --git a/api.md b/api.md
new file mode 100644
index 0000000..cd74ef9
--- /dev/null
+++ b/api.md
@@ -0,0 +1,74 @@
+# API
+Two API architectures are supported: WebSocket and REST.
+Both can be used with the same set of fields.
+As everything can be controlled with topics, only a few fields are required:
+| Field | Type | Description |
+| ----- | ---- | ---- |
+| topic | String | Topic where the payload is dispatched |
+| payload | String | Payload to be dispatched |
+| broadcast | Integer | Where to send the payload; 0 = local, 1 = broadcast |
+
+
+
+- topic
+- payload
+- broadcast
+
+## Topics
+All functionality can be used by sending messages to these topics.
+
+| topic | type | payload |
+| ----- | ---- | ---- |
+| pixels/colorWheel | Integer | Value from 0 to 255 to cycle through all colors |
+| pixels/color | Integer | RGB color as integer. By calling this topic, all LEDs of the strip are set synchronously, stopping current running animation. |
+| pixels/color2 | Integer |RGB color as integer. Sets the second color used in animations. Does not stop current running animation. |
+| pixels/pattern | Integer | Value from 0 to 5 to set the current animation. Available animations: { NONE = 0, RAINBOW_CYCLE = 1, THEATER_CHASE = 2, COLOR_WIPE = 3, SCANNER = 4, FADE = 5 } |
+| pixels/totalSteps | Integer | Number of steps of an animation. |
+| pixels/brightness | Integer | Integer from 0 to 255 to set the overall brightness of the strip by bitshifting the current colors in memory. Use with caution as running the LEDs on full brightness requires a lot of power. |
+
+## WebSocket
+Endpoint: /pixel
+Send a JSON String containing the mandatory fields.
+
+Example:
+``` json
+{
+ "topic": "pixels/color",
+ "payload": 13505813
+}
+```
+
+## REST
+#### Endpoints
+Content-Type: application/x-www-form-urlencoded
+POST /pixel/api
+Request: Form post with topic and payload as fields
+Response: 200 + final payload as JSON
+
+Examples:
+```shell
+# set color by wheel
+curl -v -X POST \
+ --data "topic=pixels/colorWheel" \
+ --data "payload=20" \
+ http://illucat/pixel/api
+
+# set color only on current node
+curl -v -X POST \
+ --data "topic=pixels/colorWheel" \
+ --data "payload=20" \
+ --data "broadcast=1"\
+ http://illucat/pixel/api
+
+# set brightness
+curl -v -X POST \
+ --data "topic=pixels/brightness" \
+ --data "payload=10" \
+ http://illucat/pixel/api
+
+# run rainbow pattern
+curl -v -X POST \
+ --data "topic=pixels/pattern" \
+ --data "payload=1" \
+ http://illucat/pixel/api
+```
\ No newline at end of file
diff --git a/data/www/index.html b/data/www/index.html
index 2b38b6b..b119527 100644
--- a/data/www/index.html
+++ b/data/www/index.html
@@ -2,10 +2,10 @@