Pupsmuckel 3 years ago
parent
commit
708bb2cda4
8 changed files with 1446 additions and 264 deletions
  1. 1
    1
      compress/favicon.png.gz.h
  2. 40
    44
      compress/index.html.gz.h
  3. 1
    1
      compress/input.js.gz.h
  4. 1144
    0
      compress/light.png.gz.h
  5. 114
    96
      compress/style.css.gz.h
  6. 9
    1
      doku.md
  7. 48
    0
      include/ota.h
  8. 89
    121
      src/main.cpp

+ 1
- 1
compress/favicon.png.gz.h View File

@@ -1,7 +1,7 @@
// filename: favicon.png.gz.h
#define favicon_png_gz_len 554
const char favicon_png_gz[] = {
0x1F, 0x8B, 0x08, 0x00, 0xB2, 0x41, 0xD3, 0x60, 0x02, 0xFF,
0x1F, 0x8B, 0x08, 0x00, 0x68, 0x4A, 0xD3, 0x60, 0x02, 0xFF,
0x01, 0x13, 0x02, 0xEC, 0xFD, 0x89, 0x50, 0x4E, 0x47, 0x0D,
0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44,
0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08,

+ 40
- 44
compress/index.html.gz.h View File

@@ -1,46 +1,42 @@
// filename: index.html.gz.h
#define index_html_gz_len 428
#define index_html_gz_len 388
const char index_html_gz[] = {
0x1F, 0x8B, 0x08, 0x00, 0xB2, 0x41, 0xD3, 0x60, 0x02, 0xFF,
0xB5, 0x54, 0xC1, 0x4E, 0xE3, 0x30, 0x10, 0xBD, 0x23, 0xED,
0x3F, 0x0C, 0xBE, 0xB7, 0xA1, 0x2B, 0x6D, 0xC5, 0x21, 0xED,
0x05, 0x38, 0x83, 0xB4, 0x5C, 0xF6, 0x54, 0x39, 0xCE, 0x34,
0x31, 0x38, 0xB6, 0x65, 0x4F, 0x4B, 0xBB, 0x5F, 0x8F, 0x33,
0x71, 0x69, 0x60, 0xB3, 0x88, 0x0B, 0x97, 0x78, 0xEC, 0xF7,
0xFC, 0xDE, 0x1B, 0x27, 0x4E, 0x79, 0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, 0x03, 0xE1, 0xD3, 0xE2, 0x52, 0x1B, 0xFE, 0xCD, 0x77,
0xB3, 0xBD, 0x0A, 0x24, 0xB5, 0x03, 0x00, 0x00};

+ 1
- 1
compress/input.js.gz.h View File

@@ -1,7 +1,7 @@
// filename: input.js.gz.h
#define input_js_gz_len 205
const char input_js_gz[] = {
0x1F, 0x8B, 0x08, 0x00, 0xB2, 0x41, 0xD3, 0x60, 0x02, 0xFF,
0x1F, 0x8B, 0x08, 0x00, 0x68, 0x4A, 0xD3, 0x60, 0x02, 0xFF,
0x7D, 0xCF, 0x31, 0x0B, 0xC2, 0x30, 0x10, 0x05, 0xE0, 0x3D,
0x90, 0xFF, 0x70, 0x38, 0xB5, 0x4B, 0x8B, 0xB3, 0xB8, 0x88,
0x82, 0x82, 0x6E, 0x3A, 0xCB, 0xD1, 0x9C, 0x6D, 0x20, 0xBD,

+ 1144
- 0
compress/light.png.gz.h
File diff suppressed because it is too large
View File


+ 114
- 96
compress/style.css.gz.h View File

@@ -1,98 +1,116 @@
// filename: style.css.gz.h
#define style_css_gz_len 948
#define style_css_gz_len 1121
const char style_css_gz[] = {
0x1F, 0x8B, 0x08, 0x00, 0xB2, 0x41, 0xD3, 0x60, 0x02, 0xFF,
0xBD, 0x55, 0x4B, 0x6F, 0xDB, 0x38, 0x10, 0xBE, 0x1B, 0xF0,
0x7F, 0x18, 0xB4, 0x58, 0x20, 0xEE, 0x5A, 0xAE, 0xF2, 0xD8,
0x2C, 0xA0, 0x9C, 0x82, 0xB4, 0xDD, 0x1C, 0xB6, 0x28, 0xB0,
0xC9, 0x61, 0xAF, 0x14, 0x35, 0xB2, 0x88, 0x50, 0xA2, 0x40,
0x52, 0xB1, 0xDD, 0x22, 0xFF, 0x7D, 0x87, 0xA4, 0x24, 0xEB,
0xE1, 0x4D, 0x17, 0x0B, 0xB4, 0xF0, 0x45, 0x24, 0xE7, 0xF5,
0x7D, 0xF3, 0xCD, 0xB8, 0xB0, 0xA5, 0x84, 0x6F,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 0xB5, 0x05, 0x99, 0xF3, 0xB5, 0x2D, 0xDD, 0xE1,
0x64, 0x92, 0xBC, 0x0C, 0xB5, 0x95, 0x93, 0x32, 0x65, 0x08,
0x27, 0xDA, 0xAB, 0x25, 0x07, 0x27, 0x37, 0xB9, 0xE0, 0x05,
0x4E, 0xE1, 0x47, 0x85, 0x82, 0x4C, 0xE1, 0x8E, 0x64, 0x44,
0xD0, 0x29, 0x7C, 0x49, 0x57, 0x38, 0x01, 0x1D, 0xA1, 0xC7,
0x8B, 0x3F, 0x69, 0xBF, 0xAF, 0x54, 0x68, 0x45, 0x6F, 0x26,
0xA0, 0x38, 0xF0, 0xA1, 0xD4, 0x18, 0xE7, 0x0F, 0x93, 0x7D,
0xE8, 0xA3, 0xEF, 0x03, 0x6F, 0x69, 0x79, 0x4C, 0xCA, 0x26,
0xFF, 0x3F, 0x10, 0xB1, 0xDD, 0xA4, 0xCD, 0xA5, 0x13, 0x90,
0x4E, 0xA9, 0xC9, 0xA0, 0x01, 0x63, 0xEA, 0xDE, 0x45, 0xF6,
0x5C, 0x5F, 0x53, 0x78, 0x33, 0x31, 0x76, 0x6D, 0xC0, 0x17,
0x86, 0x85, 0x5E, 0xF6, 0x63, 0xD2, 0xF6, 0x9B, 0xCF, 0x4B,
0x1B, 0xCB, 0x7D, 0x6D, 0xFB, 0xB7, 0x2B, 0x68, 0x5E, 0xAF,
0x8C, 0xEB, 0x8D, 0xB5, 0xF5, 0x25, 0xF5, 0xB2, 0xD7, 0x5F,
0x73, 0x37, 0xD6, 0xD2, 0xED, 0xED, 0xFF, 0xD3, 0x8D, 0xFF,
0x8C, 0xE2, 0xDF, 0xDC, 0xC7, 0xFB, 0xE9, 0x3E, 0x0D, 0x00,
0x00};

+ 9
- 1
doku.md View File

@@ -52,4 +52,12 @@ if(p.endsWith(".gzip")) {
}
else
server.streamFile(f, mime::getContentType(SRH::_path), requestMethod);
```
```


Webserver on v0.3.0 now working with LittleFS
TODO:
- check dir for files automatic
- move handleNotFound to httpserver.h
- maybe compress files ?


+ 48
- 0
include/ota.h View File

@@ -0,0 +1,48 @@
#ifndef __OTA_H
#define __OTA_H

void ota_setup() {
ArduinoOTA.setPort(8266);
ArduinoOTA.setHostname("ESP_Treppenlicht");
ArduinoOTA.setPassword("admin");
// Password can be set with it's md5 value as well
// MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
// ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");

ArduinoOTA.onStart([]() {
String type;
if (ArduinoOTA.getCommand() == U_FLASH) {
type = "sketch";
} else { // U_FS
type = "filesystem";
}

// NOTE: if updating FS this would be the place to unmount FS using FS.end()
Serial.println("Start updating " + type);
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) {
Serial.println("Auth Failed");
} else if (error == OTA_BEGIN_ERROR) {
Serial.println("Begin Failed");
} else if (error == OTA_CONNECT_ERROR) {
Serial.println("Connect Failed");
} else if (error == OTA_RECEIVE_ERROR) {
Serial.println("Receive Failed");
} else if (error == OTA_END_ERROR) {
Serial.println("End Failed");
}
});
ArduinoOTA.begin();

}


#endif // __OTA_H

+ 89
- 121
src/main.cpp View File

@@ -1,40 +1,65 @@
#include <Arduino.h>

// debugging support via GDBStub over UART
#ifdef WITH_DEBUGGING_ON
#include <GDBStub.h>
#include <GDBStub.h> // debugging support via GDBStub over UART
#endif

#include "PCA9685.h"
extern "C" {
#include "user_interface.h"
extern "C" {
#include "user_interface.h"
}

#define ESP12_LED 2
#define NODEMCU_LED 16

// OTA & WEB
#include "wifi_credentials.h"
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include "ota.h"

#include "wifi_credentials.h"
#include "httpserver.h"

const char* ssid = STASSID;
const char* password = STAPSK;
// BOARD
#define ESP12_LED 2
#define NODEMCU_LED 16

// PWM
os_timer_t timer1;
int timer_arg;
uint8_t timer_flag = 0;
PCA9685 pwmController;

void setup_ota();
void setup_pwm_pca9685();
void handleNotFound();

const int led = 13;
// WIFI
const char* ssid = STASSID;
const char* password = STAPSK;

// PWM
uint32_t dimmtimer = 0;
uint16_t time_per_stair = 500; // global parameter: dimmtime per stair [ms]
uint8_t direction = 1;
uint8_t onoff = 1;


void ledsequence(uint8_t direction, uint8_t onoff);
uint8_t softstart_led(uint8_t led, uint16_t startval, uint16_t stopval);

void timerCallback(void *pArg)
{
*((int *) pArg) += 1;
ledsequence(direction, onoff);
// Serial.print("[");
// Serial.print(micros()-m);
// Serial.print("] timerCallback\n");
// m = micros();
}

// HTTP
void handleNotFound();
HTTPServer httpServer(80, "/");

// ===============================================


void handleNotFound() {
String message = "File Not Found\n\n";
message += "URI: ";
@@ -52,53 +77,6 @@ void handleNotFound() {
httpServer.send(404, "text/plain", message);
}

PCA9685 pwmController;




void setup_ota() {
ArduinoOTA.setPort(8266);
ArduinoOTA.setHostname("ESP_Treppenlicht");
ArduinoOTA.setPassword("admin");
// Password can be set with it's md5 value as well
// MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
// ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");

ArduinoOTA.onStart([]() {
String type;
if (ArduinoOTA.getCommand() == U_FLASH) {
type = "sketch";
} else { // U_FS
type = "filesystem";
}

// NOTE: if updating FS this would be the place to unmount FS using FS.end()
Serial.println("Start updating " + type);
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) {
Serial.println("Auth Failed");
} else if (error == OTA_BEGIN_ERROR) {
Serial.println("Begin Failed");
} else if (error == OTA_CONNECT_ERROR) {
Serial.println("Connect Failed");
} else if (error == OTA_RECEIVE_ERROR) {
Serial.println("Receive Failed");
} else if (error == OTA_END_ERROR) {
Serial.println("End Failed");
}
});
ArduinoOTA.begin();
}

void setup_pwm_pca9685() {
pwmController.resetDevices(); // Software resets all PCA9685 devices on Wire line

@@ -109,22 +87,6 @@ void setup_pwm_pca9685() {
}


uint32_t dimmtimer = 0;
uint8_t direction = 1;
uint8_t onoff = 1;

void ledsequence(uint8_t direction, uint8_t onoff, uint8_t factor);
uint8_t softstart_led(uint8_t led, uint16_t startval, uint16_t stopval, uint8_t factor);

uint8_t flag = 0;
void timer_callback(void *pArg)
{
*((int *) pArg) += 1;
flag = 1;
}


void setup() {
#ifdef WITH_DEBUGGING_ON
Serial.begin(460800);
@@ -135,12 +97,11 @@ void setup() {

Serial.println(F("Booting ...."));


pinMode(NODEMCU_LED, OUTPUT);
pinMode(ESP12_LED, OUTPUT);

Wire.begin(); // Wire must be started first
Wire.setClock(400000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz
Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
@@ -151,22 +112,20 @@ void setup() {
ESP.restart();
}

pinMode(led, OUTPUT);
digitalWrite(led, 0);
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

os_timer_setfn(&timer1, timer_callback, &timer_arg);
os_timer_arm(&timer1, 1, true);
os_timer_setfn(&timer1, timerCallback, &timer_flag);
os_timer_arm(&timer1, 20, true);

Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

setup_ota();
ota_setup();

httpServer.start();
httpServer.onNotFound(handleNotFound);
@@ -176,54 +135,70 @@ void setup() {
Serial.println("PCA9685 connected !");
}

uint8_t softstart_led(uint8_t led, uint16_t startval, uint16_t stopval, uint8_t factor){
uint32_t t;
#define SP_US(_str,_a) Serial.print(_str); Serial.print(" took: "); Serial.print(_a); Serial.println("µs")
#define TIMEIF_US(_str,_f, _l) t=micros(); _f; t=micros()-t; if(t > _l) { SP_US(_str, t); }

uint8_t softstart_led(uint8_t led, uint16_t startval, uint16_t stopval){

/*
softstart task

- get's called at regular intervals (1ms at the moment)
- dimms single led (0 - 15, PCA9685 outputs) with linear intervals vom startval to stopval
- calculates pwm steps depending on startval, stopval and timeinterval
- -> results in constanst speed
- returns 1 if led dimming is running
- returns 0 if led dimming is finished

*/

static uint8_t lastled = 255;
static uint8_t current_pwm = 0;
static float current_pwm = 0;
static float stepsize = 1.0;
if(led != lastled){
pwmController.setChannelPWM(led, startval);
pwmController.setChannelPWM(led, (uint16_t)startval);
lastled = led;
current_pwm = startval;
stepsize = 20*abs(stopval - startval)/(float)time_per_stair; // only valid at 1ms function call interval
return 1;
}
if(current_pwm == stopval){
return 0;
}

else if(startval > stopval){
current_pwm -= 1;
if(current_pwm > stopval - stepsize && current_pwm < stopval + stepsize) return 0;
// todo: duty cycle zero!
if(startval > stopval){
current_pwm -= stepsize;
}
else {
current_pwm += 1;
current_pwm += stepsize;
}
pwmController.setChannelPWM(led, current_pwm*factor);
Serial.println((uint16_t)current_pwm);
pwmController.setChannelPWM(led, (uint16_t)current_pwm);
return 1;
}

#define LEDCOUNT 16

void ledsequence(uint8_t direction, uint8_t onoff, uint8_t factor){
void ledsequence(uint8_t direction, uint8_t onoff){
static int8_t led = 0;
static uint8_t brightness = 0;
static uint8_t lastbrightness = 0;
static uint16_t brightness = 0;
static uint16_t lastbrightness = 0;
static uint8_t finish = 1;
static uint32_t status = 0;
uint32_t status_build = 0;
status_build |= direction << 16;
status_build |= onoff << 8;
status_build |= factor;
static uint16_t status = 0;
uint16_t status_build = 0;
status_build |= direction << 8;
status_build |= onoff;
if(status_build != status){ // check if any parameter changed
finish = 0; // set state unfinished -> start action
if(direction) led = 0; // reset led counter depending of direction
else led = LEDCOUNT-1;
if(onoff){
brightness = 127; // set brightness value depending of on/off
lastbrightness = 0;
brightness = 2048; // set brightness value depending of on/off
lastbrightness = 200;
}
else{
brightness = 0;
lastbrightness = 127;
brightness = 200;
lastbrightness = 2048;
}
status = status_build; // set parameter memory
Serial.print("----Status Changed! onoff: ");
@@ -233,8 +208,8 @@ void ledsequence(uint8_t direction, uint8_t onoff, uint8_t factor){

}
if(!finish){ // finish == 0 -> action pending
if(!softstart_led(led,lastbrightness, brightness, factor)){
Serial.print("one LED finished, new set led: ");
if(!softstart_led(led,lastbrightness, brightness)){
Serial.print("one LED finished: ");
Serial.print(led);
Serial.print(" last: ");
Serial.print(lastbrightness);
@@ -263,21 +238,14 @@ uint32_t _t=0;
#define TIMEIF_US(_f, _l, _str) _t=micros(); _f; _t=micros()-_t; if(_t > _l) { SP_US(_str, _t); }

void loop() {
if(millis() - dimmtimer > 2){
//ledsequence(direction, onoff, 4);
dimmtimer = millis();
}

if(millis() > 25000 && onoff == 1 && direction == 1) onoff = 0;
if(millis() > 35000 && direction == 1){
if(millis() > 45000 && direction == 1){
onoff = 1;
direction = 0;
}
TIMEIF_US(ArduinoOTA.handle(), 1000, "OTA");
TIMEIF_US(httpServer.handleClient(), 1000, "HTTP");

if(flag) {
flag = 0;
ledsequence(direction, onoff, 4);
//Serial.printf("[%lu] interrupt\n\r", millis());
}
}

Loading…
Cancel
Save