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

Update Master #29

Merged
merged 33 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1308b93
Update README.md
ascillato Apr 4, 2018
1b52030
Update README.md
ascillato Apr 4, 2018
e540daf
Update README.md
ascillato Apr 4, 2018
e8812af
Update en-GB.h
ascillato Apr 5, 2018
f586a63
Update es-AR.h
ascillato Apr 5, 2018
3091591
Update cs-CZ.h
ascillato Apr 5, 2018
2386f90
Update de-DE.h
ascillato Apr 5, 2018
5f3efd7
Update fr-FR.h
ascillato Apr 5, 2018
51c3115
Update hu-HU.h
ascillato Apr 5, 2018
38d318f
Update it-IT.h
ascillato Apr 5, 2018
df4e989
Update nl-NL.h
ascillato Apr 5, 2018
113cd2e
Update pl-PL.h
ascillato Apr 5, 2018
64f2130
Update pt-PT.h
ascillato Apr 5, 2018
26cab1f
Update ru-RU.h
ascillato Apr 5, 2018
ed5be17
Update zh-CN.h
ascillato Apr 5, 2018
f503028
Update zh-TW.h
ascillato Apr 5, 2018
f48e79e
Update README.md
ascillato Apr 5, 2018
48512fd
Add files via upload
ascillato Apr 5, 2018
4f4b792
Update README.md
ascillato Apr 5, 2018
a4296b0
Update README.md
ascillato Apr 5, 2018
93a4e25
Update README.md
ascillato Apr 5, 2018
beda4fa
Update en-GB.h
ascillato Apr 5, 2018
cc74d54
Add files via upload
ascillato Apr 5, 2018
33111bf
Update README.md
ascillato Apr 5, 2018
e860d7f
Add files via upload
ascillato Apr 5, 2018
ad331d3
Update README.md
ascillato Apr 5, 2018
f729eb6
Add files via upload
ascillato Apr 5, 2018
c9b6a0f
Update README.md
ascillato Apr 5, 2018
524979a
v5.12.0j - Add Sunrise/set timer option
arendst Apr 5, 2018
182521a
Update settings.h
ascillato Apr 5, 2018
3db8123
Update settings.h
ascillato Apr 5, 2018
1f39a40
Merge pull request #28 from arendst/development
ascillato Apr 5, 2018
af8e5d8
Update settings.h
ascillato Apr 5, 2018
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
Binary file added .github/Config_Menu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/KNX_menu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 43 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,48 @@
# Sonoff-Tasmota (KNX_MOD)
# Sonoff-Tasmota ( KNX MOD )

This is a [MOD](https://github.com/ascillato/Sonoff-Tasmota_KNX) for Sonoff-Tasmota to integrate KNX Protocol to its features.
This is a MOD for [Sonoff-Tasmota](https://github.com/arendst/Sonoff-Tasmota) to integrate [KNX Protocol](https://www.knx.org/knx-en/index.php) to its features.
Sonoff-Tasmota_KNX can be found [here](https://github.com/ascillato/Sonoff-Tasmota_KNX)

This MOD requires the KNX Library [ascillato/ESP-KNX-IP_Lite](https://github.com/ascillato/ESP-KNX-IP_Lite)
Basic KNX IP Functionality is Available. **( Work in progress )**

Basic Functionality is Available. **Work in progress**.
_Sonoff-Tasmota_KNX development branch is kept in sync with the Original Sonoff-Tasmota_

-----------------------------------------------------------------------------------------------------------------------------------
## Road Map ##
## KNX Explanation ##

The [KNX](https://www.knx.org/knx-en/knx/association/what-is-knx/index.php) IP Protocol is intended for smart home and smart bulding automation. It is a decentraliced system. Each device can talk directly to each other without the need of a central controller or server. Any panel or server is just for telesupervision and for sending requests.

Each device has a physical address ( like a MAC ) as 1.1.0 and that address is used for configuration purposes.

Each device can be configured with group addresses as 2/2/1 and that address can be used for sending/receiving commands.
So, for example, if 2 devices that are configured with the 2/2/1 for turning on/off their outputs, and other device send _Turn ON_ command to 2/2/1, both devices will turn on their outputs.

## Requirements ##

This MOD requires only the KNX Library [ascillato/ESP-KNX-IP_Lite](https://github.com/ascillato/ESP-KNX-IP_Lite).

## Next Version Menu ##

<img src="https://github.com/ascillato/Sonoff-Tasmota_KNX/blob/development/.github/Config_Menu.jpg" />

<img src="https://github.com/ascillato/Sonoff-Tasmota_KNX/blob/development/.github/KNX_menu.jpg" />

Further development will change the library to the KNX Library [envy/esp-knx-ip](https://github.com/envy/esp-knx-ip). Please, use the [async-udp](https://github.com/envy/esp-knx-ip/tree/async-udp) branch. Also, it is needed to change on the _esp-knx-ip.h_ file the following:
```
#define MAX_CALLBACK_ASSIGNMENTS 20
#define MAX_CALLBACKS 20
#define ALLOW_MULTIPLE_CALLBACKS_PER_ADDRESS 1
//#define ESP_KNX_DEBUG <-- comment this line
```
The ESP KNX IP library (async-udp branch) also requires the [ESPAsyncUDP](https://github.com/me-no-dev/ESPAsyncUDP) library. Please, use ESPAsyncUDP library patched with the [PR #21](https://github.com/me-no-dev/ESPAsyncUDP/pull/21)

Copy of both libraries with the modifications needed are available at:
* https://github.com/ascillato/Sonoff-Tasmota_KNX/tree/development/lib/esp-knx-ip
* https://github.com/ascillato/Sonoff-Tasmota_KNX/tree/development/lib/ESPAsyncUDP

## Development Road Map ##

**For Sonoff-Tasmota_KNX:**
- [x] Add Web Menu (uses the one provided by the ESP KNX library)
- [x] Add Web Menu (need improvement)
- [x] Add Feature to Receive telegrams and modify Relay Status
- [x] Add Feature to Receive telegrams from multiple Group Addresses to modify just one relay status (useful for scenes)
- [x] Add Feature to Send telegrams of relay status change
Expand All @@ -19,24 +51,13 @@ Basic Functionality is Available. **Work in progress**.
- [x] Add Feature to receive telegrams to toggle relay status
- [ ] Add Feature to read Temperature, Humidity from Tasmota
- [x] Add Feature to send Temperature, Humidity by a set interval (tasmota teleperiod)
- [x] Add Feature to receive command to read temperature
- [x] Add Feature to receive command to read temperature, Humidity
- [ ] Add Feature to recognize Tasmota config to show the same amount of relays, buttons, etc
- [ ] Add Feature to Save Config
- [ ] Add Feature to Load Config
- [ ] Change Web Menu to a Tasmota one to save FLASH and RAM
- [ ] Complete all the language files with keys
- [x] Complete all the language files with keys
- [ ] Optimize code to reduce Flash and RAM

**For ESP_KNX_IP_LITE:**
- [x] Add Functions to control library from code and not only by Web Menu
- [ ] Complete needed functions for Tasmota
- [ ] Add WebUI Functions
- [ ] Change all *_id_t to config_id_t so as to have control over webpage order
- [ ] Mod GA_Register function to be similar to CB_Register (needed for Send telegrams of one relay status to multiple Group Addresses)
- [ ] Optimize code to reduce Flash and RAM

-----------------------------------------------------------------------------------------------------------------------------------

## Modifications to [Original Tasmota](https://github.com/arendst/Sonoff-Tasmota) ##

* Adding the file _/sonoff/xdrv_10_KNX.ino_
Expand All @@ -48,14 +69,10 @@ Basic Functionality is Available. **Work in progress**.
* Add entries to sensor files
* Add entries to language files

Up to now, enabling KNX uses +14.7k of code
Up to now, enabling KNX uses +18k of code and +3k3 of memory.

There is **NO CONFLICT** with MQTT, Home Assistant, Web, etc. Tests show fast response of all features running at same time.

_Sonoff-Tasmota_KNX development branch is kept in sync with the Original Sonoff-Tasmota_

-----------------------------------------------------------------------------------------------------------------------------------

## Contributors to this MOD ##

* Adrian Scillato [ascillato](https://github.com/ascillato)
Expand All @@ -79,7 +96,7 @@ If you like **Sonoff Tasmota**, give it a star, or fork it and contribute!
### Development:
[![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota)

Current version is **5.12.0i** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
Current version is **5.12.0j** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.

### Quick install

Expand Down
12 changes: 12 additions & 0 deletions lib/ESPAsyncUDP-master/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ESPAsyncUDP
_Library patched with the [PR #21](https://github.com/me-no-dev/ESPAsyncUDP/pull/21)_

Async UDP Library for ESP8266 Arduino [![Build Status](https://travis-ci.org/me-no-dev/ESPAsyncUDP.svg?branch=master)](https://travis-ci.org/me-no-dev/ESPAsyncUDP)

[![Join the chat at https://gitter.im/me-no-dev/ESPAsyncWebServer](https://badges.gitter.im/me-no-dev/ESPAsyncWebServer.svg)](https://gitter.im/me-no-dev/ESPAsyncWebServer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This is a fully asynchronous UDP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP8266 MCUs.

The library is easy to use and includes support for Unicast, Broadcast and Multicast environments

Latest GIT version of ESP8266 Arduino might be required for this library to work
51 changes: 51 additions & 0 deletions lib/ESPAsyncUDP-master/examples/AsyncUDPClient/AsyncUDPClient.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <ESP8266WiFi.h>
#include "ESPAsyncUDP.h"

const char * ssid = "***********";
const char * password = "***********";

AsyncUDP udp;

void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("WiFi Failed");
while(1) {
delay(1000);
}
}
if(udp.connect(IPAddress(192,168,1,100), 1234)) {
Serial.println("UDP connected");
udp.onPacket([](AsyncUDPPacket packet) {
Serial.print("UDP Packet Type: ");
Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast");
Serial.print(", From: ");
Serial.print(packet.remoteIP());
Serial.print(":");
Serial.print(packet.remotePort());
Serial.print(", To: ");
Serial.print(packet.localIP());
Serial.print(":");
Serial.print(packet.localPort());
Serial.print(", Length: ");
Serial.print(packet.length());
Serial.print(", Data: ");
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
});
//Send unicast
udp.print("Hello Server!");
}
}

void loop()
{
delay(1000);
//Send broadcast on port 1234
udp.broadcastTo("Anyone here?", 1234);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <ESP8266WiFi.h>
#include "ESPAsyncUDP.h"

const char * ssid = "***********";
const char * password = "***********";

AsyncUDP udp;

void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("WiFi Failed");
while(1) {
delay(1000);
}
}
if(udp.listenMulticast(IPAddress(239,1,2,3), 1234)) {
Serial.print("UDP Listening on IP: ");
Serial.println(WiFi.localIP());
udp.onPacket([](AsyncUDPPacket packet) {
Serial.print("UDP Packet Type: ");
Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast");
Serial.print(", From: ");
Serial.print(packet.remoteIP());
Serial.print(":");
Serial.print(packet.remotePort());
Serial.print(", To: ");
Serial.print(packet.localIP());
Serial.print(":");
Serial.print(packet.localPort());
Serial.print(", Length: ");
Serial.print(packet.length());
Serial.print(", Data: ");
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
});
//Send multicast
udp.print("Hello!");
}
}

void loop()
{
delay(1000);
//Send multicast
udp.print("Anyone here?");
}
50 changes: 50 additions & 0 deletions lib/ESPAsyncUDP-master/examples/AsyncUDPServer/AsyncUDPServer.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <ESP8266WiFi.h>
#include "ESPAsyncUDP.h"

const char * ssid = "***********";
const char * password = "***********";

AsyncUDP udp;

void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("WiFi Failed");
while(1) {
delay(1000);
}
}
if(udp.listen(1234)) {
Serial.print("UDP Listening on IP: ");
Serial.println(WiFi.localIP());
udp.onPacket([](AsyncUDPPacket packet) {
Serial.print("UDP Packet Type: ");
Serial.print(packet.isBroadcast()?"Broadcast":packet.isMulticast()?"Multicast":"Unicast");
Serial.print(", From: ");
Serial.print(packet.remoteIP());
Serial.print(":");
Serial.print(packet.remotePort());
Serial.print(", To: ");
Serial.print(packet.localIP());
Serial.print(":");
Serial.print(packet.localPort());
Serial.print(", Length: ");
Serial.print(packet.length());
Serial.print(", Data: ");
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
});
}
}

void loop()
{
delay(1000);
//Send broadcast
udp.broadcast("Anyone here?");
}
33 changes: 33 additions & 0 deletions lib/ESPAsyncUDP-master/keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#######################################
# Syntax Coloring Map For Ultrasound
#######################################

#######################################
# Datatypes (KEYWORD1)
#######################################

AsyncUDP KEYWORD1
AsyncUDPPacket KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

connect KEYWORD2
connected KEYWORD2
listen KEYWORD2
listenMulticast KEYWORD2
close KEYWORD2
write KEYWORD2
broadcast KEYWORD2
onPacket KEYWORD2
data KEYWORD2
length KEYWORD2
localIP KEYWORD2
localPort KEYWORD2
remoteIP KEYWORD2
remotePort KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################
17 changes: 17 additions & 0 deletions lib/ESPAsyncUDP-master/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name":"ESPAsyncUDP",
"description":"Asynchronous UDP Library for ESP8266",
"keywords":"async,udp,server,client,multicast,broadcast",
"authors":
{
"name": "Hristo Gochkov",
"maintainer": true
},
"repository":
{
"type": "git",
"url": "https://github.com/me-no-dev/ESPAsyncUDP.git"
},
"frameworks": "arduino",
"platforms":"espressif"
}
9 changes: 9 additions & 0 deletions lib/ESPAsyncUDP-master/library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=ESP Async UDP
version=1.0.0
author=Me-No-Dev
maintainer=Me-No-Dev
sentence=Async UDP Library for ESP8266
paragraph=Async UDP Library for ESP8266
category=Other
url=https://github.com/me-no-dev/ESPAsyncUDP
architectures=*
Loading