Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/13 code clean #14

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BasedOnStyle: LLVM
UseTab: Never
IndentWidth: 2
BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: Always
AlignConsecutiveMacros: true
IndentPPDirectives: BeforeHash
IndentCaseLabels: true
ColumnLimit: 120
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/extensions.json
.vscode/ipch
platformio.ini
secrets.h
102 changes: 96 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ If all build flags are enabled, to include as much libraries as possible, the fo
<img src="docs/RFLink_libs.png">

V3.2

- added Email on (re-)start (at the moment this only works for ESP32). Although by a call to Restart_Email (as shown in the main program) also a (re-)start email for the ESP8266 can be send
- added warning MQTT message on (re-)start
- added username/password to MQTTconnection (may be left empty)

V3.1 of RFLink-ESP has the following new or improved features

- complete rebuild on the base of Sensors/Receivers-concept (more features with less effort)
- program can be completely build and controlled by WebSettings
- simultanuous support of serial and telnet debug and control
Expand All @@ -22,21 +24,108 @@ V3.1 of RFLink-ESP has the following new or improved features
- received and transmitted messages are stored in a file
- build flags extended, so the program can be used with a minimal set of libraries
- flag Home_Automation removed
- command added: 19;PRINT; //lists the known devices
- command added: 19;PRINT; //lists the known devices
- Learning_Mode=9 is made asynchronuous, so you can do other things including stopping LM-9
- command added: 13; and 14; // shows/sets 2 commands for Learning_Mode 8/9
- command added: 13; and 14; // shows/sets 2 commands for Learning_Mode 8/9
- programs added to upload files to the ESP by FTP

# Schmurtz
## Secrets

To change settings and store private keys, create a `secrets.h` file under `src/`. Below is a sample of basic required secrets.

```cpp
// ***********************************************************************
// PRIVATE GLOBALS
// ***********************************************************************
#define __SECRET_Wifi_Name "Home Network SSID"
#define __SECRET_Wifi_PWD "Password"
#define __SECRET_Broker_IP "192.168.22.23"

#define __SECRET_SMTP_Server "smtp.gmail.com"
#ifdef ESP32
#define __SECRET_SMTP_Port 587
#else
#define __SECRET_SMTP_Port 465
#endif
#define __SECRET_SMTP_User "[email protected]"
#define __SECRET_SMTP_PWD "someones password"
#define __SECRET_SMTP_MailTo "[email protected]"
```

## Inclusion

By commenting/uncommenting build parameters you can reduce RAM size requirement.
To include for example the FTP server, uncomment in your main ino file:

```cpp
#define INCLUDE_FTPSERVER
```

### Common

These build parameters are often used in most programs.

| Name | Included by default |
| ------------------- | ---------------------- |
| SENSOR_ADS1115 | :x: no |
| SENSOR_ADS1115_DIFF | :x: no |
| SENSOR_BME280 | :x: no |
| SENSOR_DHT22 | :x: no |
| SENSOR_DS18B20 | :x: no |
| SENSOR_MHZ14 | :x: no |
| SENSOR_MPU9250 | :x: no |
| SENSOR_PIR | :x: no |
| SENSOR_SDS011 | :x: no |
| RECEIVER_MQTT | :heavy_check_mark: yes |
| RECEIVER_EMAIL | :heavy_check_mark: yes |
| RECEIVER_SCRATCHPAD | :x: no |
| RECEIVER_SDFAT | :x: no |
| RECEIVER_SSD1306 | :x: no |
| RECEIVER_TM1638 | :x: no |

### Special Case

These build parameters only used in special programs.

| Name | Included by default |
| ----------------------- | ---------------------- |
| FTPSERVER | :x: no |
| BLAUWE_ENGEL | :x: no |
| FIJNSTOF_CONDITIONERING | :x: no |
| SENSOR_RFLINK | :heavy_check_mark: yes |
| SENSOR_BMP280 | :x: no |
| SENSOR_MLX90614 | :x: no |
| SENSOR_MLX90640 | :x: no |
| SENSOR_MQTTBroker | :x: no |
| SENSOR_NTP | :x: no |
| SENSOR_OKE4 | :x: no |
| SENSOR_RTC | :x: no |
| RECEIVER_OTA | :heavy_check_mark: yes |
| RECEIVER_TELNET | :heavy_check_mark: yes |
| RECEIVER_WEBSERVER | :heavy_check_mark: yes |
| RECEIVER_LUFTDATEN | :x: no |

## Building

Useful flags while building are

```
-Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-variable
```

## Schmurtz

forked V2.1 and made it more compatible with other Bridge-libraries. https://github.com/schmurtzm/RFLink-ESP

# RFLink-ESP V2.1
## RFLink-ESP V2.1

Home Assistant / Domoticz tested with a RFLink, modified for ESP8266 and ESP32

This is a fork of RFLink, and because we couldn't get it working reliable, we ended up in a complete rewrite of RFLink.
Problem is that the latest version of RFLink is R48. We couldn't only find sources of version R29 and R35. Both sources didn't work correctly, R29 was the best. We tried to contact "the stuntteam" which owns the orginal sources but no response.

This version of RFLink-ESP has the following features

- just a few protocols are translated and tested
- Protocols are more generic, so you need less protocols
- Protocols are written as classes and all derived from a common class
Expand All @@ -45,13 +134,14 @@ This version of RFLink-ESP has the following features
- Removed a lot of redundancies
- Device must be registered before they will be recognized ( (almost) no more false postives)
- Dynamically determine long/short puls, by measuring Min,Max,Mean
- Runs on ESP32 and even on a ESP8266
- Runs on ESP32 and even on a ESP8266
- Fully open source
- Codesize is strongly reduced
- Can communicate over USB/RS232 or MQTT

Some ideas for the future

- Implementing rolling code SomFy / Own
- Cleanup global constants and variables
- Using SI4432 as Receiver / Transmitter (Transmitter can be used for all frequencies, Receiver might be able to fetch a complete sequence, so listening at more frequencies at the same time might even be possible)
- Logging of false positives, including time (Neighbours ??) NTP: https://www.instructables.com/id/Arduino-Internet-Time-Client/
- Logging of false positives, including time (Neighbours ??) NTP: https://www.instructables.com/id/Arduino-Internet-Time-Client/
Loading