Browse Source

first avenger commit!

m0e 4 years ago
commit
d13dbcec76
49 changed files with 1869 additions and 0 deletions
  1. 3 0
      .gitlab-ci.yml
  2. 8 0
      ImmerlichtAPP/.gitignore
  3. 1 0
      ImmerlichtAPP/.idea/.name
  4. 22 0
      ImmerlichtAPP/.idea/compiler.xml
  5. 3 0
      ImmerlichtAPP/.idea/copyright/profiles_settings.xml
  6. 6 0
      ImmerlichtAPP/.idea/encodings.xml
  7. 23 0
      ImmerlichtAPP/.idea/gradle.xml
  8. 46 0
      ImmerlichtAPP/.idea/misc.xml
  9. 9 0
      ImmerlichtAPP/.idea/modules.xml
  10. 12 0
      ImmerlichtAPP/.idea/runConfigurations.xml
  11. BIN
      ImmerlichtAPP/app-debug.apk
  12. 1 0
      ImmerlichtAPP/app/.gitignore
  13. 30 0
      ImmerlichtAPP/app/build.gradle
  14. 17 0
      ImmerlichtAPP/app/proguard-rules.pro
  15. 13 0
      ImmerlichtAPP/app/src/androidTest/java/de/labs/ocknigma/immerlichtapp/ApplicationTest.java
  16. 21 0
      ImmerlichtAPP/app/src/main/AndroidManifest.xml
  17. BIN
      ImmerlichtAPP/app/src/main/IL_Icon-web.png
  18. 46 0
      ImmerlichtAPP/app/src/main/java/de/labs/ocknigma/immerlichtapp/GetMethodDemo.java
  19. 97 0
      ImmerlichtAPP/app/src/main/java/de/labs/ocknigma/immerlichtapp/MainActivity.java
  20. 236 0
      ImmerlichtAPP/app/src/main/res/layout/activity_main.xml
  21. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-hdpi/ic_launcher.png
  22. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-hdpi/il_icon.png
  23. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-mdpi/ic_launcher.png
  24. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-mdpi/il_icon.png
  25. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  26. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-xhdpi/il_icon.png
  27. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  28. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-xxhdpi/il_icon.png
  29. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  30. BIN
      ImmerlichtAPP/app/src/main/res/mipmap-xxxhdpi/il_icon.png
  31. 6 0
      ImmerlichtAPP/app/src/main/res/values-w820dp/dimens.xml
  32. 6 0
      ImmerlichtAPP/app/src/main/res/values/colors.xml
  33. 5 0
      ImmerlichtAPP/app/src/main/res/values/dimens.xml
  34. 3 0
      ImmerlichtAPP/app/src/main/res/values/strings.xml
  35. 11 0
      ImmerlichtAPP/app/src/main/res/values/styles.xml
  36. 15 0
      ImmerlichtAPP/app/src/test/java/de/labs/ocknigma/immerlichtapp/ExampleUnitTest.java
  37. 23 0
      ImmerlichtAPP/build.gradle
  38. 18 0
      ImmerlichtAPP/gradle.properties
  39. BIN
      ImmerlichtAPP/gradle/wrapper/gradle-wrapper.jar
  40. 6 0
      ImmerlichtAPP/gradle/wrapper/gradle-wrapper.properties
  41. 160 0
      ImmerlichtAPP/gradlew
  42. 90 0
      ImmerlichtAPP/gradlew.bat
  43. 1 0
      ImmerlichtAPP/settings.gradle
  44. 13 0
      README.md
  45. 308 0
      esp8266-iot-ws2812b-2/esp8266-iot-ws2812b-2.ino/esp8266-iot-ws2812b-2.ino.ino
  46. 3 0
      esp8266-iot-ws2812b/.gitlab-ci.yml
  47. 1 0
      esp8266-iot-ws2812b/README.md
  48. 303 0
      esp8266-iot-ws2812b/esp8266-iot-ws2812b.ino
  49. 303 0
      src/esp8266-iot-ws2812b.ino

+ 3 - 0
.gitlab-ci.yml

@@ -0,0 +1,3 @@
+compile:  
+  script:
+    - ino build

+ 8 - 0
ImmerlichtAPP/.gitignore

@@ -0,0 +1,8 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures

+ 1 - 0
ImmerlichtAPP/.idea/.name

@@ -0,0 +1 @@
+ImmerlichtAPP

+ 22 - 0
ImmerlichtAPP/.idea/compiler.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <resourceExtensions />
+    <wildcardResourcePatterns>
+      <entry name="!?*.java" />
+      <entry name="!?*.form" />
+      <entry name="!?*.class" />
+      <entry name="!?*.groovy" />
+      <entry name="!?*.scala" />
+      <entry name="!?*.flex" />
+      <entry name="!?*.kt" />
+      <entry name="!?*.clj" />
+      <entry name="!?*.aj" />
+    </wildcardResourcePatterns>
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="false">
+        <processorPath useClasspath="true" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>

+ 3 - 0
ImmerlichtAPP/.idea/copyright/profiles_settings.xml

@@ -0,0 +1,3 @@
+<component name="CopyrightManager">
+  <settings default="" />
+</component>

+ 6 - 0
ImmerlichtAPP/.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 23 - 0
ImmerlichtAPP/.idea/gradle.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+          </set>
+        </option>
+        <option name="myModules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+          </set>
+        </option>
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 46 - 0
ImmerlichtAPP/.idea/misc.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
+  <component name="NullableNotNullManager">
+    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
+    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
+    <option name="myNullables">
+      <value>
+        <list size="4">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
+          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+        </list>
+      </value>
+    </option>
+    <option name="myNotNulls">
+      <value>
+        <list size="4">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
+          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
+          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+        </list>
+      </value>
+    </option>
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 9 - 0
ImmerlichtAPP/.idea/modules.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/ImmerlichtAPP.iml" filepath="$PROJECT_DIR$/ImmerlichtAPP.iml" />
+      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
+    </modules>
+  </component>
+</project>

+ 12 - 0
ImmerlichtAPP/.idea/runConfigurations.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

BIN
ImmerlichtAPP/app-debug.apk


+ 1 - 0
ImmerlichtAPP/app/.gitignore

@@ -0,0 +1 @@
+/build

+ 30 - 0
ImmerlichtAPP/app/build.gradle

@@ -0,0 +1,30 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 24
+    buildToolsVersion "24.0.0"
+    useLibrary  'org.apache.http.legacy'
+
+    defaultConfig {
+        applicationId "de.labs.ocknigma.immerlichtapp"
+        minSdkVersion 22
+        targetSdkVersion 24
+        versionCode 1
+        versionName "1.0"
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+    dexOptions {
+        incremental false
+    }
+}
+
+dependencies {
+    compile fileTree(include: ['*.jar'], dir: 'libs')
+    testCompile 'junit:junit:4.12'
+    compile 'com.android.support:appcompat-v7:24.0.0'
+}

+ 17 - 0
ImmerlichtAPP/app/proguard-rules.pro

@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /root/Android/Sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}

+ 13 - 0
ImmerlichtAPP/app/src/androidTest/java/de/labs/ocknigma/immerlichtapp/ApplicationTest.java

@@ -0,0 +1,13 @@
+package de.labs.ocknigma.immerlichtapp;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
+ */
+public class ApplicationTest extends ApplicationTestCase<Application> {
+    public ApplicationTest() {
+        super(Application.class);
+    }
+}

+ 21 - 0
ImmerlichtAPP/app/src/main/AndroidManifest.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="de.labs.ocknigma.immerlichtapp">
+    <uses-permission android:name="android.permission.INTERNET"/>
+    <application
+        android:allowBackup="true"
+        android:icon="@mipmap/il_icon"
+        android:label="@string/app_name"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme">
+        <activity android:name=".MainActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

BIN
ImmerlichtAPP/app/src/main/IL_Icon-web.png


+ 46 - 0
ImmerlichtAPP/app/src/main/java/de/labs/ocknigma/immerlichtapp/GetMethodDemo.java

@@ -0,0 +1,46 @@
+package de.labs.ocknigma.immerlichtapp;
+
+import android.os.AsyncTask;
+import android.util.Log;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public class GetMethodDemo extends AsyncTask<String , Void ,String> {
+    String server_response;
+
+    @Override
+    protected String doInBackground(String... strings) {
+
+        URL url;
+        HttpURLConnection urlConnection = null;
+
+        try {
+            url = new URL(strings[0]);
+            urlConnection = (HttpURLConnection) url.openConnection();
+
+            int responseCode = urlConnection.getResponseCode();
+
+            if(responseCode == HttpURLConnection.HTTP_OK){
+            }
+
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+    @Override
+    protected void onPostExecute(String s) {
+        super.onPostExecute(s);
+
+        Log.e("Response", "" + server_response);
+
+
+    }
+}

+ 97 - 0
ImmerlichtAPP/app/src/main/java/de/labs/ocknigma/immerlichtapp/MainActivity.java

@@ -0,0 +1,97 @@
+package de.labs.ocknigma.immerlichtapp;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import java.text.MessageFormat;
+
+
+public class MainActivity extends AppCompatActivity {
+    private String ipAdd = "192.168.2.242";
+    TextView saveButton;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+    saveButton = (TextView) findViewById(R.id.save);
+    saveButton.setOnClickListener(new View.OnClickListener() {
+
+        @Override
+        public void onClick(View v) {
+            save();              }
+
+    });
+    }
+
+    public void save(){
+
+        EditText ipAddress = (EditText)findViewById(R.id.ip_address);
+        InputFilter[] filters = new InputFilter[1];
+        filters[0] = new InputFilter() {
+            @Override
+            public CharSequence filter(CharSequence source, int start, int end,android.text.Spanned dest, int dstart, int dend) {
+                if (end > start) {
+                    String destTxt = dest.toString();
+                    String resultingTxt = destTxt.substring(0, dstart) + source.subSequence(start, end) + destTxt.substring(dend);
+                    if (!resultingTxt.matches ("^\\d{1,3}(\\.(\\d{1,3}(\\.(\\d{1,3}(\\.(\\d{1,3})?)?)?)?)?)?")) {
+                        return "";
+                    } else {
+                        String[] splits = resultingTxt.split("\\.");
+                        for (int i=0; i<splits.length; i++) {
+                            if (Integer.valueOf(splits[i]) > 255) {
+                                return "";
+                            }
+                        }
+                    }
+                }
+                return null;
+            }
+        };
+        ipAddress.setFilters(filters);
+        ipAdd = ipAddress.getText().toString();
+    }
+    public void callRed(View view){
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/red", ipAdd));
+    }
+    public void callBlue(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/blue", ipAdd));
+    }
+    public void callGreen(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/green", ipAdd));
+    }
+    public void callYellow(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/yellow", ipAdd));
+    }
+    public void callCyan(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/emerald", ipAdd));
+    }
+    public void callPink(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/pink", ipAdd));
+    }
+    public void callWhite(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/white", ipAdd));
+    }
+    public void callLoop(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/looper", ipAdd));
+    }
+    public void callChaser(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/chaser", ipAdd));
+    }
+    public void callRainbow(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/rainbow", ipAdd));
+    }
+    public void callFader(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/fader", ipAdd));
+    }
+    public void callOff(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/off", ipAdd));
+    }
+    public void callShtdwn(View view) {
+        new GetMethodDemo().execute(MessageFormat.format("http://{0}/black", ipAdd));
+    }
+}

+ 236 - 0
ImmerlichtAPP/app/src/main/res/layout/activity_main.xml

@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context="de.labs.ocknigma.immerlichtapp.MainActivity"
+    android:background="#272727">
+
+<TextView
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:textAppearance="?android:attr/textAppearanceLarge"
+    android:text="OcknigmaLabs Immerlicht"
+    android:id="@+id/textView"
+    android:layout_alignParentTop="true"
+    android:layout_centerHorizontal="true"
+    android:textColor="#ffffff" />
+
+<TableLayout
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:gravity="center_horizontal"
+    android:layout_below="@+id/textView"
+    android:layout_marginTop="30dp"
+    android:id="@+id/tableLayout"
+    android:layout_alignEnd="@+id/ip_address"
+    android:layout_marginLeft="0dp"
+    android:layout_marginRight="0dp"
+    android:layout_alignParentStart="true">
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <ImageButton android:id="@+id/imageButton"
+            android:layout_column="0"
+            android:layout_width="110dp"
+            android:layout_height="50dp"
+            android:backgroundTint="#ff0000"
+            android:onClick="callRed" />
+
+        <ImageButton
+            android:layout_width="110dp"
+            android:layout_height="50dp"
+            android:id="@+id/imageButton4"
+            android:layout_column="2"
+            android:backgroundTint="#ffff00"
+            android:onClick="callYellow" />
+
+        <Space
+            android:layout_width="30px"
+            android:layout_height="20px"
+            android:layout_column="4" />
+
+        <Button
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:text="ColorLoop"
+            android:id="@+id/button"
+            android:layout_column="5"
+            android:typeface="monospace"
+            android:textSize="11dp"
+            android:backgroundTint="#bfbfbf"
+            android:onClick="callLoop" />
+
+    </TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"></TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <ImageButton android:id="@+id/imageButton2"
+            android:layout_column="0"
+            android:layout_width="100dp"
+            android:layout_height="50dp"
+            android:backgroundTint="#00ff00"
+            android:onClick="callGreen" />
+
+        <ImageButton
+            android:layout_width="100dp"
+            android:layout_height="50dp"
+            android:id="@+id/imageButton5"
+            android:layout_column="2"
+            android:backgroundTint="#00ffff"
+            android:onClick="callCyan" />
+
+        <Button
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:text="ColorChaser"
+            android:id="@+id/button2"
+            android:layout_column="5"
+            android:textSize="11dp"
+            android:typeface="monospace"
+            android:backgroundTint="#bfbfbf"
+            android:onClick="callChaser" />
+    </TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"></TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <ImageButton android:id="@+id/imageButton3"
+            android:layout_column="0"
+            android:layout_height="50dp"
+            android:layout_width="100dp"
+            android:backgroundTint="#0000ff"
+            android:onClick="callBlue" />
+
+        <ImageButton
+            android:layout_width="100dp"
+            android:layout_height="50dp"
+            android:id="@+id/imageButton6"
+            android:layout_column="2"
+            android:backgroundTint="#ff00ff"
+            android:onClick="callPink" />
+
+        <Button
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:text="Rainbow"
+            android:id="@+id/button3"
+            android:layout_column="5"
+            android:typeface="monospace"
+            android:textSize="12dp"
+            android:backgroundTint="#bfbfbf"
+            android:onClick="callRainbow" />
+    </TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"></TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+    </TableRow>
+
+    <TableRow
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <Button
+            android:text="White"
+            android:id="@+id/button4"
+            android:layout_column="0"
+            android:textSize="12dp"
+            android:typeface="monospace"
+            android:backgroundTint="#f8f8f8"
+            android:textColor="#323232"
+            android:onClick="callWhite" />
+
+        <Button
+            android:layout_width="100dp"
+            android:layout_height="wrap_content"
+            android:text="OFF"
+            android:id="@+id/button5"
+            android:layout_column="2"
+            android:typeface="monospace"
+            android:textSize="12dp"
+            android:textStyle="bold"
+            android:onClick="callOff" />
+
+        <Button
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="Fader On/off"
+            android:id="@+id/button6"
+            android:layout_column="5"
+            android:textSize="10dp"
+            android:typeface="monospace"
+            android:onClick="callFader" />
+    </TableRow>
+</TableLayout>
+
+<Button
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:text="Shutdown"
+    android:id="@+id/button7"
+    android:layout_below="@+id/tableLayout"
+    android:layout_alignLeft="@+id/tableLayout"
+    android:layout_alignStart="@+id/tableLayout"
+    android:layout_marginTop="9dp"
+    android:layout_alignRight="@+id/tableLayout"
+    android:layout_alignEnd="@+id/tableLayout"
+    android:onClick="callShtdwn" />
+
+    <EditText
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:id="@+id/ip_address"
+        android:layout_marginTop="39dp"
+        android:layout_below="@+id/button7"
+        android:layout_centerHorizontal="true"
+        android:backgroundTint="#aaaaaa"
+        android:text="192.168.2.242"
+        android:textColor="#e6e6e6"
+        android:typeface="monospace" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:text="IP Address"
+        android:id="@+id/textView2"
+        android:textColor="#ffffff"
+        android:layout_below="@+id/ip_address"
+        android:layout_alignParentStart="true" />
+
+    <Button
+        style="?android:attr/buttonStyleSmall"
+        android:layout_width="wrap_content"
+        android:layout_height="40dp"
+        android:text="SAVE"
+        android:id="@+id/save"
+        android:layout_alignTop="@+id/textView2"
+        android:layout_alignParentEnd="true"
+        android:textSize="10dp"
+        android:typeface="monospace"
+        android:onClick="save" />
+
+</RelativeLayout>

BIN
ImmerlichtAPP/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-hdpi/il_icon.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-mdpi/il_icon.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-xhdpi/il_icon.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-xxhdpi/il_icon.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
ImmerlichtAPP/app/src/main/res/mipmap-xxxhdpi/il_icon.png


+ 6 - 0
ImmerlichtAPP/app/src/main/res/values-w820dp/dimens.xml

@@ -0,0 +1,6 @@
+<resources>
+    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+         (such as screen margins) for screens with more than 820dp of available width. This
+         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+    <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>

+ 6 - 0
ImmerlichtAPP/app/src/main/res/values/colors.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#3F51B5</color>
+    <color name="colorPrimaryDark">#303F9F</color>
+    <color name="colorAccent">#FF4081</color>
+</resources>

+ 5 - 0
ImmerlichtAPP/app/src/main/res/values/dimens.xml

@@ -0,0 +1,5 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>

+ 3 - 0
ImmerlichtAPP/app/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">ImmerlichtAPP</string>
+</resources>

+ 11 - 0
ImmerlichtAPP/app/src/main/res/values/styles.xml

@@ -0,0 +1,11 @@
+<resources>
+
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+</resources>

+ 15 - 0
ImmerlichtAPP/app/src/test/java/de/labs/ocknigma/immerlichtapp/ExampleUnitTest.java

@@ -0,0 +1,15 @@
+package de.labs.ocknigma.immerlichtapp;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() throws Exception {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 23 - 0
ImmerlichtAPP/build.gradle

@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    repositories {
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:2.1.2'
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        jcenter()
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

+ 18 - 0
ImmerlichtAPP/gradle.properties

@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true

BIN
ImmerlichtAPP/gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
ImmerlichtAPP/gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Mon Dec 28 10:00:20 PST 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

+ 160 - 0
ImmerlichtAPP/gradlew

@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+    JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

+ 90 - 0
ImmerlichtAPP/gradlew.bat

@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 1 - 0
ImmerlichtAPP/settings.gradle

@@ -0,0 +1 @@
+include ':app'

+ 13 - 0
README.md

@@ -0,0 +1,13 @@
+# ESP8266 WittyCloud Board with WS2812B
+
+Just a small Test to controll a WS2812B over WiFi with an ESP8266 WittyCloud Board
+Got some off them lying around and a friend needs a new AmbiLight with wifi feature ;)
+
+This is just an early PoC.
+Feel free to use it in your own projects, but respect the other sources Licenses
+
+
+based on the code of PANCE CAVKOVSKI
+http://pance.mk/index.php/wifi-light-with-esp8266-and-arduino-code/
+
+adapted to ESP WittyCloud Board: https://de.aliexpress.com/item/ESP8266-serial-WIFI-Witty-cloud-Development-Board-ESP-12F-module-MINI-nodemcu/32566502491.html

+ 308 - 0
esp8266-iot-ws2812b-2/esp8266-iot-ws2812b-2.ino/esp8266-iot-ws2812b-2.ino.ino

@@ -0,0 +1,308 @@
+#include <ESP8266WiFi.h>
+#include <WiFiClient.h>
+#include <ESP8266WebServer.h>
+#include <ESP8266mDNS.h>
+#include <NeoPixelBus.h>
+#include <Adafruit_NeoPixel.h>
+#define pixelCount 15
+#define pixelPin 5
+//NeoPixelBus<NeoGrbFeature, NeoEsp8266BitBang400KbpsMethod> strip(pixelCount, pixelPin);
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, pixelPin, NEO_GRB + NEO_KHZ800);
+//NeoPixelBus strip = NeoPixelBus(pixelCount, 4, NEO_GRB);
+
+bool rainbow = false;
+bool loops = false;
+bool theater = false;
+bool faders = false;
+
+// wenn auskommentiert: delay()
+// wenn aktiv: deep sleep nutzen (Hardwaremodifikation notwendig)
+//#define DEEP
+
+
+const char *ssid = "ESP-net"; //wlan ssid
+const char *password = "35p-r0cks-iot"; //wlan password
+
+// Update these with values suitable for your network.
+IPAddress ip(192,168,2,244);  //Node static IP
+IPAddress gateway(192,168,2,112);
+IPAddress subnet(255,255,255,0);
+
+MDNSResponder mdns;
+ESP8266WebServer server ( 80 );
+const int led = 13;
+void handleRoot() {
+    digitalWrite ( led, 1 );
+  String out = "<html><head><title>OcknigmaLabs Immerlicht</title></head>";
+  out += "<body style='background-color:#323232'>";
+  out += "<span style='display:block; width:100%; font-size:1.5em; font-family:Verdana; color:white; text-align:center'>-# OcknigmaLabs Wifi light  --#--  IP:192.168.2.244 - Node:2 #-</span><br/>";
+  out += "<div id='colors' style='padding: 0% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='blue'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:blue; width:21%; height:4em;'>BLUE</span></a>";
+  out += "<a href='red'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:red; width:21%; height:4em;'>RED</span></a>";
+  out += "<a href='green'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:green; width:21%; height:4em;'>GREEN</span></a><br/>";
+  out += "</div>";
+  out += "<div id='colors' style='padding: 1% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='emerald'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#00ffff; width:21%; height:4em;'>EMERALD</span></a>";
+  out += "<a href='pink'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#ff00ff; width:21%; height:4em;'>PINK</span></a>";   
+  out += "<a href='yellow'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:yellow; width:21%; height:4em;'>YELLOW</span></a><br/>";
+  out += "</div>";  
+  out += "<div id='effect' style='padding: 0% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='looper'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#f1f1f1; width:21%; height:4em;'>ColorLoop</span></a>";
+  out += "<a href='chaser'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#d9d9d9; width:21%; height:4em;'>ColorChaser</span></a>";
+  out += "<a href='rainbow'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#f1f1f1; width:21%; height:4em;'>RAINBOW</span></a>";
+  out += "</div>";  
+  out += "<div id='off' style='padding: 1% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='fader'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:black; background-color:#d9d9d9; width:87%; height:3em;'>FADER</span></a><br/>";
+  out += "<a href='white'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:black; background-color:white; width:38%; height:3em;'>WHITE</span></a>";
+  out += "<a href='off'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:white; background-color:black; width:38%; height:3em;'>OFF / FADER OFF</span></a>";
+  out += "</div>";
+  out += "<span style='display:block; padding: 1% 6%; margin:auto; color: white; text-align:center;'>OcknigmaLabs-2016 # Sourcecode: <a href='#'>https://github.com/darthm0e/esp8266-witty</a></span>";
+  out += "</body>";
+  out += "</html>";
+    server.send ( 200, "text/html", out );
+    digitalWrite ( led, 0 );
+}
+void handleNotFound() {
+    digitalWrite ( led, 1 );
+    String message = "File Not Found\n\n";
+    message += "URI: ";
+    message += server.uri();
+    message += "\nMethod: ";
+    message += ( server.method() == HTTP_GET ) ? "GET" : "POST";
+    message += "\nArguments: ";
+    message += server.args();
+    message += "\n";
+    for ( uint8_t i = 0; i < server.args(); i++ ) {
+        message += " " + server.argName ( i ) + ": " + server.arg ( i ) + "\n";
+    }
+    server.send ( 404, "text/plain", message );
+    digitalWrite ( led, 0 );
+}
+void setup ( void ) {
+    pinMode ( led, OUTPUT );
+    digitalWrite ( led, 0 );
+  strip.begin();
+  strip.show();
+
+    Serial.begin ( 115200 );
+    WiFi.begin ( ssid, password );
+    WiFi.config(ip, gateway, subnet);
+    Serial.println ( "" );
+    // Wait for connection
+    while ( WiFi.status() != WL_CONNECTED ) {
+        delay ( 500 );
+        Serial.print ( "." );
+    }
+    Serial.println ( "" );
+    Serial.print ( "Connected to " );
+    Serial.println ( ssid );
+    Serial.print ( "IP address: " );
+    Serial.println ( WiFi.localIP() );
+    if ( mdns.begin ( "esp8266", WiFi.localIP() ) ) {
+        Serial.println ( "MDNS responder started" );
+    }
+    server.on ( "/", []() {handleRoot();} );
+  server.on ( "/white", []() {colorWipe(strip.Color(127, 127, 127), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/red", []() {colorWipe(strip.Color(255, 0, 0), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/green", []() {colorWipe(strip.Color(0, 255, 0), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/blue", []() {colorWipe(strip.Color(0, 0, 255), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/pink", []() {colorWipe(strip.Color(200, 0, 200), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/emerald", []() {colorWipe(strip.Color(0, 200, 200), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/yellow", []() {colorWipe(strip.Color(200, 200, 0), 20); theater = false; loops = false; rainbow = false; strip.show(); handleRoot();} );
+  server.on ( "/off", []() {lightoff(20); rainbow = false; theater = false; faders = false; loops = false; strip.show(); handleRoot();} );
+  server.on ( "/rainbow", []() {rainbow = true; theater = false; loops = false; handleRoot(); rainbowCycle(200); handleRoot();} );
+  server.on ( "/chaser", []() {loops = false; theater = true; rainbow = false; faders = false; handleRoot(); theaterChaseRainbow(1000); handleRoot();} );
+  server.on ( "/looper", []() {theater = false; loops = true; rainbow = false; faders = false; handleRoot(); looper(6000); handleRoot();} );
+  server.on ( "/fader", []() {rainbow = false; theater = false; loops = false; handleRoot(); fader(50);} );
+    server.onNotFound ( handleNotFound );
+    server.begin();
+    Serial.println ( "HTTP server started" );
+
+    Serial.print ( "Auto Rainbow Mode" );
+    rainbow = true;
+    rainbowCycle(200); 
+    handleRoot(); 
+}
+void loop ( void ) {
+    mdns.update();
+    server.handleClient();
+}
+// Fill the dots one after the other with a color
+void colorWipe(uint32_t c, uint8_t wait) {
+  for(uint16_t i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, c);
+      strip.show();
+      delay(wait);
+  }
+}
+//LightsOff
+void lightoff(uint8_t wait) {
+  colorWipe(strip.Color(0, 0, 0), 10);
+  strip.setBrightness(250); 
+  delay(50);
+  for(uint16_t i=0; i<4; i++) {
+    delay(200);
+    server.handleClient();
+  }
+  strip.show();    
+  Serial.println ( "Lights off" );
+  #ifdef DEEP
+    Serial.println ( "Sleep" );
+    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
+    delay(100);
+  #else
+    //@todo disconnect WiFi to save power?
+    delay(100 * wait);
+  #endif
+}
+//Fader Test
+void fader(uint8_t wait) {
+  if (faders == true) {
+    faders=false;
+    Serial.println ( "fader off" );
+    strip.setBrightness(250);
+    strip.show();
+  }
+  else {
+    faders=true;
+    Serial.println ( "fader started" );
+  }
+  while ( faders == true ) {    
+  strip.Color(0, 0, 250);
+  strip.setBrightness(10);
+  strip.show();  
+  for(uint16_t i=10; i<255; i=i+15) {     
+      delay(wait);      
+      strip.setBrightness(i);
+      strip.show();      
+  }
+  delay(200);
+  for(uint16_t i=255; i>0; i=i-15) {             
+      delay(wait);      
+      strip.setBrightness(i);
+      strip.show();      
+  }
+  server.handleClient();
+  delay(200);
+  }  
+}
+
+
+void looper(uint8_t wait) {
+      strip.setBrightness(250);
+       while ( loops == true ) {
+        theater = false;
+        rainbow = false;
+        Serial.println ( "looper started" );
+          colorWipe(strip.Color(127, 0, 0), 20);
+          delay(300);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 127, 0), 20);
+          delay(300);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 0, 127), 20);
+          delay(300);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(127, 127, 0), 20);
+          delay(300);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(127, 0, 127), 20);
+          delay(300);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 127, 127), 20);
+          delay(300);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+      }
+      Serial.println ( "looper end" );
+  }
+
+// Slightly different, this makes the rainbow equally distributed throughout
+void rainbowCycle(uint8_t wait) {
+  uint16_t i, j;
+  theater = false;
+  loops = false;
+  Serial.println ( "rainbow started" );
+  strip.setBrightness(255);
+  do
+  {
+    for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
+      for(i=0; i< strip.numPixels(); i++) {
+        strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
+      }      
+      strip.show();
+      server.handleClient();
+      delay(wait);
+      if (rainbow == false) {
+        break;
+      }
+    }    
+    delay(250);
+    mdns.update();
+    server.handleClient();
+    delay(500);
+  } while ( rainbow == true );
+   Serial.println ( "rainbow end" );
+}
+//Theatre-style crawling lights with rainbow effect
+void theaterChaseRainbow(uint8_t wait) {
+  Serial.println ( "chaser started" );
+  strip.setBrightness(255);
+  while (theater == true)  {   
+  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel
+    for (int q=0; q < 3; q++) {
+      for (int i=0; i < strip.numPixels(); i=i+3) {
+        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on            
+      }
+      strip.show();      
+      delay(wait);
+      for (int i=0; i < strip.numPixels(); i=i+3) {
+        strip.setPixelColor(i+q, 0);        //turn every third pixel off
+      }
+      server.handleClient();      
+    } 
+    if (theater == false){
+      break;   
+    }
+  }
+  }
+  Serial.println ( "chaser end" );
+}
+
+// Input a value 0 to 255 to get a color value.
+// The colours are a transition r - g - b - back to r.
+uint32_t Wheel(byte WheelPos) {
+  WheelPos = 255 - WheelPos;
+  if(WheelPos < 85) {
+    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
+  }
+  if(WheelPos < 170) {
+    WheelPos -= 85;
+    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
+  }
+  WheelPos -= 170;
+  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
+}

+ 3 - 0
esp8266-iot-ws2812b/.gitlab-ci.yml

@@ -0,0 +1,3 @@
+compile:  
+  script:
+    - ino build

+ 1 - 0
esp8266-iot-ws2812b/README.md

@@ -0,0 +1 @@
+## ino file ##

+ 303 - 0
esp8266-iot-ws2812b/esp8266-iot-ws2812b.ino

@@ -0,0 +1,303 @@
+#include <ESP8266WiFi.h>
+#include <WiFiClient.h>
+#include <ESP8266WebServer.h>
+#include <ESP8266mDNS.h>
+#include <NeoPixelBus.h>
+#include <Adafruit_NeoPixel.h>
+#define pixelCount 15
+#define pixelPin 3
+//NeoPixelBus<NeoGrbFeature, NeoEsp8266BitBang400KbpsMethod> strip(pixelCount, pixelPin);
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, pixelPin, NEO_GRB + NEO_KHZ800);
+//NeoPixelBus strip = NeoPixelBus(pixelCount, 4, NEO_GRB);
+
+bool rainbow = false;
+bool loops = false;
+bool theater = false;
+bool faders = false;
+
+// wenn auskommentiert: delay()
+// wenn aktiv: deep sleep nutzen (Hardwaremodifikation notwendig)
+#define DEEP
+
+
+const char *ssid = "ESP-net"; //wlan ssid
+const char *password = "35p-r0cks-iot"; //wlan password
+
+// Update these with values suitable for your network.
+IPAddress ip(192,168,2,248);  //Node static IP
+IPAddress gateway(192,168,2,112);
+IPAddress subnet(255,255,255,0);
+
+MDNSResponder mdns;
+ESP8266WebServer server ( 80 );
+const int led = 13;
+void handleRoot() {
+    digitalWrite ( led, 1 );
+  String out = "<html><head><title>OcknigmaLabs Wifi light</title></head>";
+  out += "<body style='background-color:#323232'>";
+  out += "<span style='display:block; width:100%; font-size:1.5em; font-family:Verdana; color:white; text-align:center'>-# OcknigmaLabs Wifi light  --#--  IP:192.168.2.242 - Node:1 #-</span><br/>";
+  out += "<div id='colors' style='padding: 0% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='blue'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:blue; width:21%; height:4em;'>BLUE</span></a>";
+  out += "<a href='red'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:red; width:21%; height:4em;'>RED</span></a>";
+  out += "<a href='green'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:green; width:21%; height:4em;'>GREEN</span></a><br/>";
+  out += "</div>";
+  out += "<div id='colors' style='padding: 1% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='emerald'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#00ffff; width:21%; height:4em;'>EMERALD</span></a>";
+  out += "<a href='pink'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#ff00ff; width:21%; height:4em;'>PINK</span></a>";   
+  out += "<a href='yellow'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:yellow; width:21%; height:4em;'>YELLOW</span></a><br/>";
+  out += "</div>";  
+  out += "<div id='effect' style='padding: 0% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='looper'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#f1f1f1; width:21%; height:4em;'>ColorLoop</span></a>";
+  out += "<a href='chaser'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#d9d9d9; width:21%; height:4em;'>ColorChaser</span></a>";
+  out += "<a href='rainbow'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#f1f1f1; width:21%; height:4em;'>RAINBOW</span></a>";
+  out += "</div>";  
+  out += "<div id='off' style='padding: 1% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='fader'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:black; background-color:#d9d9d9; width:87%; height:3em;'>FADER</span></a><br/>";
+  out += "<a href='white'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:black; background-color:white; width:38%; height:3em;'>WHITE</span></a>";
+  out += "<a href='black'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:white; background-color:black; width:38%; height:3em;'>OFF / FADER OFF</span></a>";
+  out += "</div>";
+  out += "<span style='display:block; padding: 1% 6%; margin:auto; color: white; text-align:center;'>OcknigmaLabs-2016 # Sourcecode: <a href='#'>https://github.com/darthm0e/esp8266-witty</a></span>";
+  out += "</body>";
+  out += "</html>";
+    server.send ( 200, "text/html", out );
+    digitalWrite ( led, 0 );
+}
+void handleNotFound() {
+    digitalWrite ( led, 1 );
+    String message = "File Not Found\n\n";
+    message += "URI: ";
+    message += server.uri();
+    message += "\nMethod: ";
+    message += ( server.method() == HTTP_GET ) ? "GET" : "POST";
+    message += "\nArguments: ";
+    message += server.args();
+    message += "\n";
+    for ( uint8_t i = 0; i < server.args(); i++ ) {
+        message += " " + server.argName ( i ) + ": " + server.arg ( i ) + "\n";
+    }
+    server.send ( 404, "text/plain", message );
+    digitalWrite ( led, 0 );
+}
+void setup ( void ) {
+    pinMode ( led, OUTPUT );
+    digitalWrite ( led, 0 );
+  strip.begin();
+  strip.show();
+
+    Serial.begin ( 115200 );
+    WiFi.begin ( ssid, password );
+    WiFi.config(ip, gateway, subnet);
+    Serial.println ( "" );
+    // Wait for connection
+    while ( WiFi.status() != WL_CONNECTED ) {
+        delay ( 500 );
+        Serial.print ( "." );
+    }
+    Serial.println ( "" );
+    Serial.print ( "Connected to " );
+    Serial.println ( ssid );
+    Serial.print ( "IP address: " );
+    Serial.println ( WiFi.localIP() );
+    if ( mdns.begin ( "esp8266", WiFi.localIP() ) ) {
+        Serial.println ( "MDNS responder started" );
+    }
+    server.on ( "/", []() {handleRoot();} );
+  server.on ( "/white", []() {colorWipe(strip.Color(127, 127, 127), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/red", []() {colorWipe(strip.Color(255, 0, 0), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/green", []() {colorWipe(strip.Color(0, 255, 0), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/blue", []() {colorWipe(strip.Color(0, 0, 255), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/pink", []() {colorWipe(strip.Color(200, 0, 200), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/emerald", []() {colorWipe(strip.Color(0, 200, 200), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/yellow", []() {colorWipe(strip.Color(200, 200, 0), 20); theater = false; loops = false; rainbow = false; strip.show(); handleRoot();} );
+  server.on ( "/off", []() {lightoff(50); rainbow = false; theater = false; faders = false; loops = false; strip.show(); handleRoot();} );
+  server.on ( "/rainbow", []() {rainbow = true; theater = false; loops = false; handleRoot(); rainbowCycle(200); handleRoot();} );
+  server.on ( "/chaser", []() {loops = false; theater = true; rainbow = false; faders = false; handleRoot(); theaterChaseRainbow(1000); handleRoot();} );
+  server.on ( "/looper", []() {theater = false; loops = true; rainbow = false; faders = false; handleRoot(); looper(6000); handleRoot();} );
+  server.on ( "/fader", []() {rainbow = false; theater = false; loops = false; handleRoot(); fader(50);} );
+    server.onNotFound ( handleNotFound );
+    server.begin();
+    Serial.println ( "HTTP server started" );
+}
+void loop ( void ) {
+    mdns.update();
+    server.handleClient();
+}
+// Fill the dots one after the other with a color
+void colorWipe(uint32_t c, uint8_t wait) {
+  for(uint16_t i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, c);
+      strip.show();
+      delay(wait);
+  }
+}
+//LightsOff
+void lightoff(uint8_t wait) {
+  colorWipe(strip.Color(0, 0, 0), 10);
+  strip.setBrightness(255); 
+  delay(100);
+  for(uint16_t i=0; i<4; i++) {
+    delay(200);
+    server.handleClient();
+  }
+  strip.show();    
+  Serial.println ( "Lights off" );
+  #ifdef DEEP
+    Serial.println ( "Sleep" );
+    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
+    delay(100);
+  #else
+    //@todo disconnect WiFi to save power?
+    delay(1000 * wait);
+  #endif
+}
+//Fader Test
+void fader(uint8_t wait) {
+  if (faders == true) {
+    faders=false;
+    Serial.println ( "fader off" );
+    strip.setBrightness(250);
+    strip.show();
+  }
+  else {
+    faders=true;
+    Serial.println ( "fader started" );
+  }
+  while ( faders == true ) {    
+  strip.Color(0, 0, 255);
+  strip.setBrightness(10);
+  strip.show();  
+  for(uint16_t i=10; i<255; i=i+15) {     
+      delay(wait);      
+      strip.setBrightness(i);
+      strip.show();      
+  }
+  delay(200);
+  for(uint16_t i=255; i>0; i=i-15) {             
+      delay(wait);      
+      strip.setBrightness(i);
+      strip.show();      
+  }
+  server.handleClient();
+  delay(200);
+  }  
+}
+
+
+void looper(uint8_t wait) {
+      strip.setBrightness(255);
+       while ( loops == true ) {
+        theater = false;
+        rainbow = false;
+        Serial.println ( "looper started" );
+          colorWipe(strip.Color(127, 0, 0), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 127, 0), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 0, 127), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(127, 127, 0), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(127, 0, 127), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 127, 127), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+      }
+      Serial.println ( "looper end" );
+  }
+
+// Slightly different, this makes the rainbow equally distributed throughout
+void rainbowCycle(uint8_t wait) {
+  uint16_t i, j;
+  theater = false;
+  loops = false;
+  Serial.println ( "rainbow started" );
+  strip.setBrightness(255);
+  do
+  {
+    for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
+      for(i=0; i< strip.numPixels(); i++) {
+        strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
+      }      
+      strip.show();
+      server.handleClient();
+      delay(wait);
+      if (rainbow == false) {
+        break;
+      }
+    }    
+    delay(250);
+    mdns.update();
+    server.handleClient();
+    delay(500);
+  } while ( rainbow == true );
+   Serial.println ( "rainbow end" );
+}
+//Theatre-style crawling lights with rainbow effect
+void theaterChaseRainbow(uint8_t wait) {
+  Serial.println ( "chaser started" );
+  strip.setBrightness(255);
+  while (theater == true)  {   
+  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel
+    for (int q=0; q < 3; q++) {
+      for (int i=0; i < strip.numPixels(); i=i+3) {
+        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on            
+      }
+      strip.show();      
+      delay(wait);
+      for (int i=0; i < strip.numPixels(); i=i+3) {
+        strip.setPixelColor(i+q, 0);        //turn every third pixel off
+      }
+      server.handleClient();      
+    } 
+    if (theater == false){
+      break;   
+    }
+  }
+  }
+  Serial.println ( "chaser end" );
+}
+
+// Input a value 0 to 255 to get a color value.
+// The colours are a transition r - g - b - back to r.
+uint32_t Wheel(byte WheelPos) {
+  WheelPos = 255 - WheelPos;
+  if(WheelPos < 85) {
+    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
+  }
+  if(WheelPos < 170) {
+    WheelPos -= 85;
+    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
+  }
+  WheelPos -= 170;
+  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
+}

+ 303 - 0
src/esp8266-iot-ws2812b.ino

@@ -0,0 +1,303 @@
+#include <ESP8266WiFi.h>
+#include <WiFiClient.h>
+#include <ESP8266WebServer.h>
+#include <ESP8266mDNS.h>
+#include <NeoPixelBus.h>
+#include <Adafruit_NeoPixel.h>
+#define pixelCount 15
+#define pixelPin 3
+//NeoPixelBus<NeoGrbFeature, NeoEsp8266BitBang400KbpsMethod> strip(pixelCount, pixelPin);
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, pixelPin, NEO_GRB + NEO_KHZ800);
+//NeoPixelBus strip = NeoPixelBus(pixelCount, 4, NEO_GRB);
+
+bool rainbow = false;
+bool loops = false;
+bool theater = false;
+bool faders = false;
+
+// wenn auskommentiert: delay()
+// wenn aktiv: deep sleep nutzen (Hardwaremodifikation notwendig)
+#define DEEP
+
+
+const char *ssid = "ESP-net"; //wlan ssid
+const char *password = "35p-r0cks-iot"; //wlan password
+
+// Update these with values suitable for your network.
+IPAddress ip(192,168,2,248);  //Node static IP
+IPAddress gateway(192,168,2,112);
+IPAddress subnet(255,255,255,0);
+
+MDNSResponder mdns;
+ESP8266WebServer server ( 80 );
+const int led = 13;
+void handleRoot() {
+    digitalWrite ( led, 1 );
+  String out = "<html><head><title>OcknigmaLabs Wifi light</title></head>";
+  out += "<body style='background-color:#323232'>";
+  out += "<span style='display:block; width:100%; font-size:1.5em; font-family:Verdana; color:white; text-align:center'>-# OcknigmaLabs Wifi light  --#--  IP:192.168.2.242 - Node:1 #-</span><br/>";
+  out += "<div id='colors' style='padding: 0% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='blue'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:blue; width:21%; height:4em;'>BLUE</span></a>";
+  out += "<a href='red'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:red; width:21%; height:4em;'>RED</span></a>";
+  out += "<a href='green'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:green; width:21%; height:4em;'>GREEN</span></a><br/>";
+  out += "</div>";
+  out += "<div id='colors' style='padding: 1% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='emerald'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#00ffff; width:21%; height:4em;'>EMERALD</span></a>";
+  out += "<a href='pink'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#ff00ff; width:21%; height:4em;'>PINK</span></a>";   
+  out += "<a href='yellow'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:yellow; width:21%; height:4em;'>YELLOW</span></a><br/>";
+  out += "</div>";  
+  out += "<div id='effect' style='padding: 0% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='looper'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#f1f1f1; width:21%; height:4em;'>ColorLoop</span></a>";
+  out += "<a href='chaser'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#d9d9d9; width:21%; height:4em;'>ColorChaser</span></a>";
+  out += "<a href='rainbow'><span style='display:inline-table; padding: 1% 6%; margin:auto; text-align:center; background-color:#f1f1f1; width:21%; height:4em;'>RAINBOW</span></a>";
+  out += "</div>";  
+  out += "<div id='off' style='padding: 1% 0%; display:block; margin:auto; position:relative;'>";
+  out += "<a href='fader'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:black; background-color:#d9d9d9; width:87%; height:3em;'>FADER</span></a><br/>";
+  out += "<a href='white'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:black; background-color:white; width:38%; height:3em;'>WHITE</span></a>";
+  out += "<a href='black'><span style='display:inline-table; padding: 2% 6%; text-align:center; color:white; background-color:black; width:38%; height:3em;'>OFF / FADER OFF</span></a>";
+  out += "</div>";
+  out += "<span style='display:block; padding: 1% 6%; margin:auto; color: white; text-align:center;'>OcknigmaLabs-2016 # Sourcecode: <a href='#'>https://github.com/darthm0e/esp8266-witty</a></span>";
+  out += "</body>";
+  out += "</html>";
+    server.send ( 200, "text/html", out );
+    digitalWrite ( led, 0 );
+}
+void handleNotFound() {
+    digitalWrite ( led, 1 );
+    String message = "File Not Found\n\n";
+    message += "URI: ";
+    message += server.uri();
+    message += "\nMethod: ";
+    message += ( server.method() == HTTP_GET ) ? "GET" : "POST";
+    message += "\nArguments: ";
+    message += server.args();
+    message += "\n";
+    for ( uint8_t i = 0; i < server.args(); i++ ) {
+        message += " " + server.argName ( i ) + ": " + server.arg ( i ) + "\n";
+    }
+    server.send ( 404, "text/plain", message );
+    digitalWrite ( led, 0 );
+}
+void setup ( void ) {
+    pinMode ( led, OUTPUT );
+    digitalWrite ( led, 0 );
+  strip.begin();
+  strip.show();
+
+    Serial.begin ( 115200 );
+    WiFi.begin ( ssid, password );
+    WiFi.config(ip, gateway, subnet);
+    Serial.println ( "" );
+    // Wait for connection
+    while ( WiFi.status() != WL_CONNECTED ) {
+        delay ( 500 );
+        Serial.print ( "." );
+    }
+    Serial.println ( "" );
+    Serial.print ( "Connected to " );
+    Serial.println ( ssid );
+    Serial.print ( "IP address: " );
+    Serial.println ( WiFi.localIP() );
+    if ( mdns.begin ( "esp8266", WiFi.localIP() ) ) {
+        Serial.println ( "MDNS responder started" );
+    }
+    server.on ( "/", []() {handleRoot();} );
+  server.on ( "/white", []() {colorWipe(strip.Color(127, 127, 127), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/red", []() {colorWipe(strip.Color(255, 0, 0), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/green", []() {colorWipe(strip.Color(0, 255, 0), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/blue", []() {colorWipe(strip.Color(0, 0, 255), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/pink", []() {colorWipe(strip.Color(200, 0, 200), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/emerald", []() {colorWipe(strip.Color(0, 200, 200), 20); strip.show(); rainbow = false; theater = false; loops = false; handleRoot();} );
+  server.on ( "/yellow", []() {colorWipe(strip.Color(200, 200, 0), 20); theater = false; loops = false; rainbow = false; strip.show(); handleRoot();} );
+  server.on ( "/off", []() {lightoff(50); rainbow = false; theater = false; faders = false; loops = false; strip.show(); handleRoot();} );
+  server.on ( "/rainbow", []() {rainbow = true; theater = false; loops = false; handleRoot(); rainbowCycle(200); handleRoot();} );
+  server.on ( "/chaser", []() {loops = false; theater = true; rainbow = false; faders = false; handleRoot(); theaterChaseRainbow(1000); handleRoot();} );
+  server.on ( "/looper", []() {theater = false; loops = true; rainbow = false; faders = false; handleRoot(); looper(6000); handleRoot();} );
+  server.on ( "/fader", []() {rainbow = false; theater = false; loops = false; handleRoot(); fader(50);} );
+    server.onNotFound ( handleNotFound );
+    server.begin();
+    Serial.println ( "HTTP server started" );
+}
+void loop ( void ) {
+    mdns.update();
+    server.handleClient();
+}
+// Fill the dots one after the other with a color
+void colorWipe(uint32_t c, uint8_t wait) {
+  for(uint16_t i=0; i<strip.numPixels(); i++) {
+      strip.setPixelColor(i, c);
+      strip.show();
+      delay(wait);
+  }
+}
+//LightsOff
+void lightoff(uint8_t wait) {
+  colorWipe(strip.Color(0, 0, 0), 10);
+  strip.setBrightness(255); 
+  delay(100);
+  for(uint16_t i=0; i<4; i++) {
+    delay(200);
+    server.handleClient();
+  }
+  strip.show();    
+  Serial.println ( "Lights off" );
+  #ifdef DEEP
+    Serial.println ( "Sleep" );
+    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
+    delay(100);
+  #else
+    //@todo disconnect WiFi to save power?
+    delay(1000 * wait);
+  #endif
+}
+//Fader Test
+void fader(uint8_t wait) {
+  if (faders == true) {
+    faders=false;
+    Serial.println ( "fader off" );
+    strip.setBrightness(250);
+    strip.show();
+  }
+  else {
+    faders=true;
+    Serial.println ( "fader started" );
+  }
+  while ( faders == true ) {    
+  strip.Color(0, 0, 255);
+  strip.setBrightness(10);
+  strip.show();  
+  for(uint16_t i=10; i<255; i=i+15) {     
+      delay(wait);      
+      strip.setBrightness(i);
+      strip.show();      
+  }
+  delay(200);
+  for(uint16_t i=255; i>0; i=i-15) {             
+      delay(wait);      
+      strip.setBrightness(i);
+      strip.show();      
+  }
+  server.handleClient();
+  delay(200);
+  }  
+}
+
+
+void looper(uint8_t wait) {
+      strip.setBrightness(255);
+       while ( loops == true ) {
+        theater = false;
+        rainbow = false;
+        Serial.println ( "looper started" );
+          colorWipe(strip.Color(127, 0, 0), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 127, 0), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 0, 127), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(127, 127, 0), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(127, 0, 127), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+          colorWipe(strip.Color(0, 127, 127), 20);
+          delay(100);
+          colorWipe(strip.Color(0, 0, 0), 15);
+          server.handleClient();
+          if (loops == false) {
+            break;
+          }
+      }
+      Serial.println ( "looper end" );
+  }
+
+// Slightly different, this makes the rainbow equally distributed throughout
+void rainbowCycle(uint8_t wait) {
+  uint16_t i, j;
+  theater = false;
+  loops = false;
+  Serial.println ( "rainbow started" );
+  strip.setBrightness(255);
+  do
+  {
+    for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
+      for(i=0; i< strip.numPixels(); i++) {
+        strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
+      }      
+      strip.show();
+      server.handleClient();
+      delay(wait);
+      if (rainbow == false) {
+        break;
+      }
+    }    
+    delay(250);
+    mdns.update();
+    server.handleClient();
+    delay(500);
+  } while ( rainbow == true );
+   Serial.println ( "rainbow end" );
+}
+//Theatre-style crawling lights with rainbow effect
+void theaterChaseRainbow(uint8_t wait) {
+  Serial.println ( "chaser started" );
+  strip.setBrightness(255);
+  while (theater == true)  {   
+  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel
+    for (int q=0; q < 3; q++) {
+      for (int i=0; i < strip.numPixels(); i=i+3) {
+        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on            
+      }
+      strip.show();      
+      delay(wait);
+      for (int i=0; i < strip.numPixels(); i=i+3) {
+        strip.setPixelColor(i+q, 0);        //turn every third pixel off
+      }
+      server.handleClient();      
+    } 
+    if (theater == false){
+      break;   
+    }
+  }
+  }
+  Serial.println ( "chaser end" );
+}
+
+// Input a value 0 to 255 to get a color value.
+// The colours are a transition r - g - b - back to r.
+uint32_t Wheel(byte WheelPos) {
+  WheelPos = 255 - WheelPos;
+  if(WheelPos < 85) {
+    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
+  }
+  if(WheelPos < 170) {
+    WheelPos -= 85;
+    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
+  }
+  WheelPos -= 170;
+  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
+}