Compare commits
7 Commits
7a6268a074
...
master
Author | SHA1 | Date | |
---|---|---|---|
4a4b8ee788
|
|||
83d6b40b20
|
|||
![]() |
8a0585887c | ||
749b1653a8
|
|||
2441590cb8
|
|||
c9073c1b7d
|
|||
4eb14ef3b5
|
@@ -15,3 +15,6 @@ configItems = [
|
|||||||
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RgbLed1/Debug"},
|
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RgbLed1/Debug"},
|
||||||
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0}
|
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
magic = 0xC0DE0006
|
||||||
|
appName = "ESP8266 based RgbLedLight"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from Cheetah.Template import Template
|
from Cheetah.Template import Template
|
||||||
from ConfigDataStructure import configItems
|
from ConfigDataStructure import configItems, magic, appName
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -23,8 +23,6 @@ from ConfigDataStructure import configItems
|
|||||||
#]
|
#]
|
||||||
|
|
||||||
|
|
||||||
magic = 0xC0DE0005
|
|
||||||
appName = "ESP8266 based TwoLedSignal"
|
|
||||||
confWifiSsid = "espconfig"
|
confWifiSsid = "espconfig"
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
export PROJECTDIR=$PWD/../..
|
export PROJECTDIR=$PWD/../../..
|
||||||
|
|
||||||
export PYTHONPATH=$PYTHONPATH:$PROJECTDIR
|
export PYTHONPATH=$PYTHONPATH:$PROJECTDIR/sketch
|
||||||
|
|
||||||
python -B configGen.py
|
python -B configGen.py
|
||||||
|
|
||||||
mv configuration.cpp configuration.h $PROJECTDIR
|
mv configuration.cpp configuration.h $PROJECTDIR/libraries/includes
|
||||||
|
|
||||||
|
|
||||||
|
12
application.cpp-example
Normal file
12
application.cpp-example
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include "defines.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
|
|
||||||
|
void setupApplication() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void loopApplication() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
12
application.h-example
Normal file
12
application.h-example
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef APPLICATION_H_
|
||||||
|
#define APPLICATION_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void setupApplication();
|
||||||
|
void loopApplication();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* APPLICATION_H_ */
|
@@ -5,7 +5,7 @@
|
|||||||
* Author: wn
|
* Author: wn
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../defines.h"
|
#include <defines.h>
|
||||||
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <ESP8266WebServer.h>
|
#include <ESP8266WebServer.h>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "configurationMode.h"
|
#include "configurationMode.h"
|
||||||
#include "../configuration.h"
|
#include <configuration.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -10,7 +10,9 @@
|
|||||||
|
|
||||||
#define DEBUG
|
#define DEBUG
|
||||||
|
|
||||||
|
// for Nodemcu use D2
|
||||||
#define CONFIG_SWITCH 0
|
#define CONFIG_SWITCH 0
|
||||||
|
|
||||||
#define EEPROM_ADDR 0
|
#define EEPROM_ADDR 0
|
||||||
|
|
||||||
|
|
||||||
|
4
main.cpp
4
main.cpp
@@ -1,12 +1,12 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "../defines.h"
|
#include <defines.h>
|
||||||
|
|
||||||
// #define ESP8266
|
// #define ESP8266
|
||||||
|
|
||||||
|
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
|
|
||||||
#include "../configuration.h"
|
#include <configuration.h>
|
||||||
#include "productionMode.h"
|
#include "productionMode.h"
|
||||||
#include "configurationMode.h"
|
#include "configurationMode.h"
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "../defines.h"
|
#include <defines.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <ESP8266WebServer.h>
|
#include <ESP8266WebServer.h>
|
||||||
|
|
||||||
#include "../configuration.h"
|
#include <configuration.h>
|
||||||
|
|
||||||
void setup_wifi() {
|
void setup_wifi() {
|
||||||
delay(10);
|
delay(10);
|
||||||
@@ -61,6 +61,9 @@ void setupProduction() {
|
|||||||
|
|
||||||
|
|
||||||
void loopProduction() {
|
void loopProduction() {
|
||||||
|
if (WiFi.status() != WL_CONNECTED) {
|
||||||
|
ESP.reset();
|
||||||
|
}
|
||||||
loopApplication();
|
loopApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user