Browse Source

Merge branch 'dev' of https://github.com/xoseperez/espurna into CCT_Support

rfm69
Niklas Wagner 6 years ago
parent
commit
e9c2f7bc89
13 changed files with 2906 additions and 2858 deletions
  1. +7
    -2
      code/espurna/config/general.h
  2. +3
    -4
      code/espurna/config/hardware.h
  3. +36
    -0
      code/espurna/config/types.h
  4. BIN
      code/espurna/data/index.html.gz
  5. +12
    -3
      code/espurna/debug.ino
  6. +1
    -1
      code/espurna/rfbridge.ino
  7. +0
    -9
      code/espurna/sensors/DallasSensor.h
  8. +0
    -4
      code/espurna/sensors/EmonADS1X15Sensor.h
  9. +2825
    -2825
      code/espurna/static/index.html.gz.h
  10. +18
    -7
      code/espurna/system.ino
  11. +3
    -0
      code/espurna/utils.ino
  12. +1
    -0
      code/html/custom.css
  13. +0
    -3
      code/html/custom.js

+ 7
- 2
code/espurna/config/general.h View File

@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
// // //------------------------------------------------------------------------------
// Do not change this file unless you know what you are doing
// Configuration settings are in the settings.h file
//------------------------------------------------------------------------------
@ -75,9 +75,14 @@
#endif
#ifndef DEBUG_UDP_PORT
#define DEBUG_UDP_PORT 8113
#define DEBUG_UDP_PORT 514
#endif
// If DEBUG_UDP_PORT is set to 514 syslog format is assumed
// (https://tools.ietf.org/html/rfc3164)
// DEBUG_UDP_FAC_PRI is the facility+priority
#define DEBUG_UDP_FAC_PRI (SYSLOG_LOCAL0 | SYSLOG_DEBUG)
//------------------------------------------------------------------------------
#ifndef DEBUG_TELNET_SUPPORT


+ 3
- 4
code/espurna/config/hardware.h View File

@ -1271,15 +1271,13 @@
#define DUMMY_RELAY_COUNT 1
// Light
#define LIGHT_CHANNELS 4
#define LIGHT_CHANNELS 3
#define LIGHT_CH1_PIN 5 // RED
#define LIGHT_CH2_PIN 12 // GREEN
#define LIGHT_CH3_PIN 13 // BLUE
#define LIGHT_CH4_PIN 14 // WHITE1
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
#elif defined(ARILUX_AL_LC02)
@ -1556,7 +1554,8 @@
// Remove UART noise on serial line
#define TERMINAL_SUPPORT 0
#define DEBUG_SERIAL_SUPPORT 0
#define SERIAL_BAUDRATE 115200
// -----------------------------------------------------------------------------
// Tonbux Powerstrip02
// -----------------------------------------------------------------------------


+ 36
- 0
code/espurna/config/types.h View File

@ -61,6 +61,42 @@
#define RELAY_PROVIDER_RFBRIDGE 3
#define RELAY_PROVIDER_STM 4
//------------------------------------------------------------------------------
// UDP SYSLOG
//------------------------------------------------------------------------------
// Priority codes:
#define SYSLOG_EMERG 0 /* system is unusable */
#define SYSLOG_ALERT 1 /* action must be taken immediately */
#define SYSLOG_CRIT 2 /* critical conditions */
#define SYSLOG_ERR 3 /* error conditions */
#define SYSLOG_WARNING 4 /* warning conditions */
#define SYSLOG_NOTICE 5 /* normal but significant condition */
#define SYSLOG_INFO 6 /* informational */
#define SYSLOG_DEBUG 7 /* debug-level messages */
// Facility codes:
#define SYSLOG_KERN (0<<3) /* kernel messages */
#define SYSLOG_USER (1<<3) /* random user-level messages */
#define SYSLOG_MAIL (2<<3) /* mail system */
#define SYSLOG_DAEMON (3<<3) /* system daemons */
#define SYSLOG_AUTH (4<<3) /* security/authorization messages */
#define SYSLOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
#define SYSLOG_LPR (6<<3) /* line printer subsystem */
#define SYSLOG_NEWS (7<<3) /* network news subsystem */
#define SYSLOG_UUCP (8<<3) /* UUCP subsystem */
#define SYSLOG_CRON (9<<3) /* clock daemon */
#define SYSLOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
#define SYSLOG_FTP (11<<3) /* ftp daemon */
#define SYSLOG_LOCAL0 (16<<3) /* reserved for local use */
#define SYSLOG_LOCAL1 (17<<3) /* reserved for local use */
#define SYSLOG_LOCAL2 (18<<3) /* reserved for local use */
#define SYSLOG_LOCAL3 (19<<3) /* reserved for local use */
#define SYSLOG_LOCAL4 (20<<3) /* reserved for local use */
#define SYSLOG_LOCAL5 (21<<3) /* reserved for local use */
#define SYSLOG_LOCAL6 (22<<3) /* reserved for local use */
#define SYSLOG_LOCAL7 (23<<3) /* reserved for local use */
//------------------------------------------------------------------------------
// MQTT
//------------------------------------------------------------------------------


BIN
code/espurna/data/index.html.gz View File


+ 12
- 3
code/espurna/debug.ino View File

@ -19,6 +19,9 @@ extern "C" {
#if DEBUG_UDP_SUPPORT
#include <WiFiUdp.h>
WiFiUDP _udp_debug;
#if DEBUG_UDP_PORT == 514
char _udp_syslog_header[40] = {0};
#endif
#endif
void _debugSend(char * message) {
@ -42,12 +45,11 @@ void _debugSend(char * message) {
if (systemCheck()) {
#endif
_udp_debug.beginPacket(DEBUG_UDP_IP, DEBUG_UDP_PORT);
#if DEBUG_ADD_TIMESTAMP
_udp_debug.write(timestamp);
#if DEBUG_UDP_PORT == 514
_udp_debug.write(_udp_syslog_header);
#endif
_udp_debug.write(message);
_udp_debug.endPacket();
delay(1); // https://github.com/xoseperez/espurna/issues/438
#if SYSTEM_CHECK_ENABLED
}
#endif
@ -132,6 +134,13 @@ void debugSetup() {
}
});
#if DEBUG_UDP_SUPPORT
#if DEBUG_UDP_PORT == 514
snprintf_P(_udp_syslog_header, sizeof(_udp_syslog_header), PSTR("<%u>%s ESPurna[0]: "), DEBUG_UDP_FAC_PRI, getSetting("hostname").c_str());
#endif
#endif
}
#endif // DEBUG_WEB_SUPPORT


+ 1
- 1
code/espurna/rfbridge.ino View File

@ -522,7 +522,7 @@ void rfbSetup() {
wsOnActionRegister(_rfbWebSocketOnAction);
#endif
// Register oop
// Register loop
espurnaRegisterLoop(rfbLoop);
}


+ 0
- 9
code/espurna/sensors/DallasSensor.h View File

@ -133,15 +133,6 @@ class DallasSensor : public BaseSensor {
data[i] = _wire->read();
}
#if false
Serial.printf("[DS18B20] Data = ");
for (unsigned char i = 0; i < DS_DATA_SIZE; i++) {
Serial.printf("%02X ", data[i]);
}
Serial.printf(" CRC = %02X\n", OneWire::crc8(data, DS_DATA_SIZE-1));
#endif
if (_wire->reset() != 1) {
// Force a CRC check error
_devices[index].data[0] = _devices[index].data[0] + 1;


+ 0
- 4
code/espurna/sensors/EmonADS1X15Sensor.h View File

@ -301,10 +301,6 @@ class EmonADS1X15Sensor : public EmonSensor {
}
config |= ((channel + 4) << 12); // Set single-ended input channel (0x4000 - 0x7000)
#if SENSOR_DEBUG
//Serial.printf("[EMON] ADS1X115 Config Registry: %04X\n", config);
#endif
// Write config register to the ADC
i2c_write_uint16(_address, ADS1X15_REG_POINTER_CONFIG, config);


+ 2825
- 2825
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 18
- 7
code/espurna/system.ino View File

@ -130,6 +130,22 @@ void systemLoop() {
}
void _systemSetupSpecificHardware() {
//The ESPLive has an ADC MUX which needs to be configured.
#if defined(MANCAVEMADE_ESPLIVE)
pinMode(16, OUTPUT);
digitalWrite(16, HIGH); //Defualt CT input (pin B, solder jumper B)
#endif
// These devices use the hardware UART
// to communicate to secondary microcontrollers
#if defined(ITEAD_SONOFF_RFBRIDGE) || defined(ITEAD_SONOFF_DUAL) || defined(STM_RELAY)
Serial.begin(SERIAL_BAUDRATE);
#endif
}
void systemSetup() {
EEPROM.begin(EEPROM_SIZE);
@ -139,8 +155,6 @@ void systemSetup() {
#if DEBUG_ESP_WIFI
DEBUG_PORT.setDebugOutput(true);
#endif
#elif defined(SERIAL_BAUDRATE)
Serial.begin(SERIAL_BAUDRATE);
#endif
#if SPIFFS_SUPPORT
@ -152,11 +166,8 @@ void systemSetup() {
systemCheck(false);
#endif
#if defined(ESPLIVE)
//The ESPLive has an ADC MUX which needs to be configured.
pinMode(16, OUTPUT);
digitalWrite(16, HIGH); //Defualt CT input (pin B, solder jumper B)
#endif
// Init device-specific hardware
_systemSetupSpecificHardware();
// Cache loop delay value to speed things (recommended max 250ms)
_loop_delay = atol(getSetting("loopDelay", LOOP_DELAY_TIME).c_str());


+ 3
- 0
code/espurna/utils.ino View File

@ -278,6 +278,9 @@ void info() {
#if DEBUG_UDP_SUPPORT
DEBUG_MSG_P(PSTR(" DEBUG_UDP"));
#endif
#if DEBUG_WEB_SUPPORT
DEBUG_MSG_P(PSTR(" DEBUG_WEB"));
#endif
#if DOMOTICZ_SUPPORT
DEBUG_MSG_P(PSTR(" DOMOTICZ"));
#endif


+ 1
- 0
code/html/custom.css View File

@ -6,6 +6,7 @@
font-size: 100%;
padding: .5em .5em;
white-space: normal;
text-transform: initial;
}
.pure-g {


+ 0
- 3
code/html/custom.js View File

@ -1220,9 +1220,6 @@ function processData(data) {
}
// Pre-process
if ("network" === key) {
value = value.toUpperCase();
}
if ("mqttStatus" === key) {
value = value ? "CONNECTED" : "NOT CONNECTED";
}


Loading…
Cancel
Save