mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
move ESPHelper to src
This commit is contained in:
13
README.md
13
README.md
@@ -187,7 +187,7 @@ The Boiler (ID 0x08) will send out these broadcast telegrams regularly:
|
|||||||
And a thermostat (ID 0x17 for a RC20) would broadcast these messages regularly:
|
And a thermostat (ID 0x17 for a RC20) would broadcast these messages regularly:
|
||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
| ---- | ----------- | undefined |undefined |undefined |undefined |undefined |
|
| ---- | ----------- | undefined |undefined |undefined |undefined |undefined |undefined |undefined |undefined |
|
||||||
| 0x06 | time on thermostat Y,M,H,D,M,S,wd |
|
| 0x06 | time on thermostat Y,M,H,D,M,S,wd |
|
||||||
|
|
||||||
Refer to the code in `ems.cpp` for further explanation on how to parse these message types and also reference the EMS Wiki.
|
Refer to the code in `ems.cpp` for further explanation on how to parse these message types and also reference the EMS Wiki.
|
||||||
@@ -212,13 +212,13 @@ Every telegram sent is echo'd back to Rx.
|
|||||||
* PubSubClient http://pubsubclient.knolleary.net
|
* PubSubClient http://pubsubclient.knolleary.net
|
||||||
* ArduinoJson https://github.com/bblanchon/ArduinoJson
|
* ArduinoJson https://github.com/bblanchon/ArduinoJson
|
||||||
|
|
||||||
`src\emsuart.cpp` handles the low level UART read and write logic. You shouldn't need to touch this. All receive commands from the EMS bus are handled asynchronously using a circular buffer via an interrupt. A separate function processes the buffer and extracts the telegrams. Since we don't send too many write commands this is done sequentially. I couldn't use the standard Arduino Serial implementation because of the 11-bit break signal causes a frame-error which gets ignored.
|
`emsuart.cpp` handles the low level UART read and write logic. You shouldn't need to touch this. All receive commands from the EMS bus are handled asynchronously using a circular buffer via an interrupt. A separate function processes the buffer and extracts the telegrams. Since we don't send too many write commands this is done sequentially. I couldn't use the standard Arduino Serial implementation because of the 11-bit break signal causes a frame-error which gets ignored.
|
||||||
|
|
||||||
`src\ems.cpp` is the logic to read the EMS packets (telegrams), validates them and process them based on the type.
|
`ems.cpp` is the logic to read the EMS packets (telegrams), validates them and process them based on the type.
|
||||||
|
|
||||||
`src\boiler.ino` is the Arduino code for the ESP8266 that kicks it all off. This is where we have specific logic such as the code to monitor and alert on the Shower timer and light up the LEDs.
|
`boiler.ino` is the Arduino code for the ESP8266 that kicks it all off. This is where we have specific logic such as the code to monitor and alert on the Shower timer and light up the LEDs.
|
||||||
|
|
||||||
`lib\ESPHelper` is my customized version of [ESPHelper](https://github.com/ItKindaWorks/ESPHelper) with added Telnet support and some other minor tweaking.
|
`ESPHelper.cpp` is my customized version of [ESPHelper](https://github.com/ItKindaWorks/ESPHelper) with added Telnet support and some other minor tweaking.
|
||||||
|
|
||||||
### Supported EMS Types
|
### Supported EMS Types
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ Porting to the Arduino is tricky and messy (which is one of the reasons I don't
|
|||||||
* Add the ESP8266 boards (from Preferences add Additional Board URL http://arduino.esp8266.com/stable/package_esp8266com_index.json)
|
* Add the ESP8266 boards (from Preferences add Additional Board URL http://arduino.esp8266.com/stable/package_esp8266com_index.json)
|
||||||
* Go to Boards Manager and install ESP8266 2.4.x platform
|
* Go to Boards Manager and install ESP8266 2.4.x platform
|
||||||
* Select your ESP8266 from Tools->Boards and the correct port with Tools->Port
|
* Select your ESP8266 from Tools->Boards and the correct port with Tools->Port
|
||||||
* From the Library Manager install ArduinoJson 5.13.x, PubSubClient 2.6.0
|
* From the Library Manager install ArduinoJson 5.13.x, PubSubClient 2.6.x
|
||||||
* The Arduino IDE doesn't have a common way to set build flags (ugh!) so you'll need to uncomment these lines in `boiler.ino`:
|
* The Arduino IDE doesn't have a common way to set build flags (ugh!) so you'll need to uncomment these lines in `boiler.ino`:
|
||||||
```
|
```
|
||||||
#define WIFI_SSID "<my_ssid>"
|
#define WIFI_SSID "<my_ssid>"
|
||||||
@@ -448,7 +448,6 @@ Porting to the Arduino is tricky and messy (which is one of the reasons I don't
|
|||||||
#define MQTT_PASS "<broker_password>"
|
#define MQTT_PASS "<broker_password>"
|
||||||
```
|
```
|
||||||
* Put all the files in a single sketch folder (`ESPHelper.*, boiler.ino, ems.*, emsuart.*`)
|
* Put all the files in a single sketch folder (`ESPHelper.*, boiler.ino, ems.*, emsuart.*`)
|
||||||
* Possibly change some the #includes to use the local files, replacing `<lib>` with `"lib"`
|
|
||||||
* cross your fingers and CTRL-R to compile...
|
* cross your fingers and CTRL-R to compile...
|
||||||
|
|
||||||
# Your comments and feedback
|
# Your comments and feedback
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
[platformio]
|
[platformio]
|
||||||
env_default = nodemcuv2
|
env_default = nodemcuv2
|
||||||
#env_default = d1_mini
|
; env_default = d1_mini
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
build_flags = -g -DMQTT_MAX_PACKET_SIZE=300
|
build_flags = -DMQTT_MAX_PACKET_SIZE=300
|
||||||
build_flags_custom = '-DWIFI_SSID="my_ssid"' '-DWIFI_PASSWORD="my_password"' '-DMQTT_IP="my_broker_ip"' '-DMQTT_USER="my_broker_username"' '-DMQTT_PASS="my_broker_password"'
|
build_flags_custom = '-DWIFI_SSID="my_ssid"' '-DWIFI_PASSWORD="my_password"' '-DMQTT_IP="my_broker_ip"' '-DMQTT_USER="my_broker_username"' '-DMQTT_PASS="my_broker_password"'
|
||||||
lib_deps =
|
lib_deps =
|
||||||
Time
|
Time
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
along with ESPHelper. If not, see <http://www.gnu.org/licenses/>.
|
along with ESPHelper. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ESP_HELPER_H
|
#ifndef __ESPHelper_H
|
||||||
#define __ESP_HELPER_H
|
#define __ESPHelper_H
|
||||||
|
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
|
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
|
||||||
@@ -6,12 +6,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// local libraries
|
// local libraries
|
||||||
|
#include "ESPHelper.h"
|
||||||
#include "ems.h"
|
#include "ems.h"
|
||||||
#include "emsuart.h"
|
#include "emsuart.h"
|
||||||
|
|
||||||
// private libraries
|
|
||||||
#include <ESPHelper.h>
|
|
||||||
|
|
||||||
// public libraries
|
// public libraries
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <Ticker.h> // https://github.com/esp8266/Arduino/tree/master/libraries/Ticker
|
#include <Ticker.h> // https://github.com/esp8266/Arduino/tree/master/libraries/Ticker
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ems.h"
|
#include "ems.h"
|
||||||
|
#include "ESPHelper.h"
|
||||||
#include "emsuart.h"
|
#include "emsuart.h"
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <ESPHelper.h>
|
|
||||||
#include <TimeLib.h>
|
#include <TimeLib.h>
|
||||||
|
|
||||||
_EMS_Sys_Status EMS_Sys_Status; // EMS Status
|
_EMS_Sys_Status EMS_Sys_Status; // EMS Status
|
||||||
|
|||||||
Reference in New Issue
Block a user