Files
OpenMQTT-Gateway/main/config_HELTEC.h
T
Northern Man 8bc65d62dc Update of rtl_433_ESP to version 0.1.3 - Support for SX127X transceiver module (#1291)
The main features of the upgrade to 0.1.3 of rtl_433_ESP are

1 - Change Transceiver Library to RadioLib

2 - Add support for SX127X transceiver module ( I used the 433 Mhz version of this Heltec module for development ).

3 - Added automatic calibration of the RSSI Signal detection Threshold

4 - Removed dependency on loop for start and end of signal detection, and moved to a ESP32 Task

5 - Moved received signal decoding to a ESP32 Task

6 - Identified Blueline PowerCost Monitor decoder as source of significant memory overhead and disabled.

7 - Multi Receiver support has been validated with RF, RF2 and PiLight
2022-10-20 11:14:45 -05:00

117 lines
3.4 KiB
C++

/*
OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation
Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker
Send and receiving command by MQTT
HELTEC ESP32 LORA - SSD1306 / Onboard 0.96-inch 128*64 dot matrix OLED display
Copyright: (c)Florian ROBERT
Contributors:
- 1technophile
- NorthernMan54
This file is part of OpenMQTTGateway.
OpenMQTTGateway is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenMQTTGateway is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef config_HELTEC_h
#define config_HELTEC_h
#include <Arduino.h>
#include <Wire.h>
#include "SSD1306Wire.h"
#ifdef ZboardHELTEC
# define OLED_WIDTH 128
# define OLED_HEIGHT 64
# define OLED_TEXT_BUFFER 1000
# define OLED_TEXT_ROWS 5
#endif
extern void setupHELTEC();
extern void loopHELTEC();
size_t OledPrint(String msg);
/*-------------------DEFINE LOG LEVEL----------------------*/
#ifndef LOG_LEVEL_LCD
# define LOG_LEVEL_LCD LOG_LEVEL_WARNING // Default to only display Notice level messages
#endif
#ifndef LOG_TO_LCD
# define LOG_TO_LCD false // Default to not display log messages on display
#endif
/*-------------------DEFINE MQTT TOPIC FOR CONFIG----------------------*/
#define subjectMQTTtoHELTECset "/commands/MQTTtoHELTEC/config"
// Simple construct for displaying message in lcd and oled displays
#define displayPrint(...) \
if (lowpowermode < 2) heltecPrint(__VA_ARGS__) // only print if not in low power mode
#define lpDisplayPrint(...) heltecPrint(__VA_ARGS__) // print in low power mode
void heltecPrint(char*, char*, char*);
void heltecPrint(char*, char*);
void heltecPrint(char*);
// This pattern was borrowed from HardwareSerial and modified to support the ssd1306 display
class OledSerial : public Stream {
private:
void displayIntro(int scale, int displayWidth, int displayHeight);
public:
OledSerial(int);
void begin();
void drawLogo(int logoSize, int circle1X, int circle1Y, bool circle1, bool circle2, bool circle3, bool line1, bool line2, bool name);
SSD1306Wire* display;
int available(void); // Dummy functions
int peek(void); // Dummy functions
int read(void); // Dummy functions
void flush(void); // Dummy functions
void fillScreen(OLEDDISPLAY_COLOR); // fillScreen display and set color
size_t write(uint8_t);
size_t write(const uint8_t* buffer, size_t size);
inline size_t write(const char* buffer, size_t size) {
return write((uint8_t*)buffer, size);
}
inline size_t write(const char* s) {
return write((uint8_t*)s, strlen(s));
}
inline size_t write(unsigned long n) {
return write((uint8_t)n);
}
inline size_t write(long n) {
return write((uint8_t)n);
}
inline size_t write(unsigned int n) {
return write((uint8_t)n);
}
inline size_t write(int n) {
return write((uint8_t)n);
}
protected:
};
extern OledSerial Oled;
#endif