klausahrenberg / WThermostatBeca

Replaces original Tuya firmware on Beca thermostat with ESP8266 wifi module
395 stars 96 forks source link

build instructions won't work, needs update #270

Open ikke-t opened 2 years ago

ikke-t commented 2 years ago

Hi,

I tried to build this on platformio, and run into minor problems.

  1. There is include path missing in repo, ./include is missing wich fails the build Fix: mkdir include
  2. time.h is missing. Dependencies list won't define which time library to use. Which should it be?
*  Executing task in folder WThermostatBeca: platformio run 

Processing esp01_1m (platform: espressif8266; board: esp01_1m; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp01_1m.html
PLATFORM: Espressif 8266 (2.7.4+9) > Espressif Generic ESP8266 ESP-01 1M
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 @ 2.7.4+9 
 - tool-esptoolpy @ 1.30301.220515 (3.3.1) 
 - toolchain-xtensa @ 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP8266WiFi @ 1.0
|-- ESP Async WebServer @ 1.2.3+sha.f71e3d4
|   |-- ESPAsyncTCP @ 1.2.2
|   |   |-- ESP8266WiFi @ 1.0
|   |-- Hash @ 1.0
|   |-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|   |-- ESP8266WiFi @ 1.0
|-- PubSubClient @ 2.8.0
|-- DNSServer @ 1.1.1
|   |-- ESP8266WiFi @ 1.0
|-- EEPROM @ 1.0
|-- NTPClient @ 3.2.1
|-- Time @ 1.6.1
|-- Hash @ 1.0
|-- ESP8266HTTPClient @ 1.2
|   |-- ESP8266WiFi @ 1.0
Building in release mode
Compiling .pio/build/esp01_1m/src/WThermostat.cpp.o
Compiling .pio/build/esp01_1m/lib7e7/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
Compiling .pio/build/esp01_1m/lib7e7/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
In file included from src/WThermostat.cpp:3:0:
src/WClock.h:15:18: fatal error: Time.h: No such file or directory

**************************************************************
* Looking for Time.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Time.h"
* Web  > https://registry.platformio.org/search?q=header:Time.h
*
**************************************************************

 #include <Time.h>
                  ^
compilation terminated.
Compiling .pio/build/esp01_1m/lib7e7/ESP8266WiFi/WiFiUdp.cpp.o
Compiling .pio/build/esp01_1m/lib9c6/ESPAsyncTCP/AsyncPrinter.cpp.o
Compiling .pio/build/esp01_1m/lib9c6/ESPAsyncTCP/ESPAsyncTCP.cpp.o
Compiling .pio/build/esp01_1m/lib9c6/ESPAsyncTCP/ESPAsyncTCPbuffer.cpp.o
*** [.pio/build/esp01_1m/src/WThermostat.cpp.o] Error 1
Compiling .pio/build/esp01_1m/lib9c6/ESPAsyncTCP/SyncClient.cpp.o
=============================================== [FAILED] Took 1.98 seconds ===============================================

Alternatives from pio:

╭─ikke@gr8 ~/src/WThermostatBeca ‹master› 
╰─$ pio pkg search "header:Time.h"                                                                                                  130 ↵
Found 5 packages (page 1 of 1)

mbed-hlipka/TimeZone
Library • 0.0.0+sha.0c7207d674d3 • Published on Fri Feb 18 13:15:35 2011
This library takes the current time (which must be set to UTC, e.g. via an NTP call), and applies a timezone definition (loaded at startup) to calculate the local time. This includes the handling of daylight saving.See http://mbed.org/users/hlipka/notebook/time-zone-handling/ for more information (esp. how to get a time zone definition file).

dfrobot/DFRobot_OLED12864
Library • 1.0.0 • Published on Sun May  8 05:13:35 2022
OLED12864 multifunctional module(SKU: DFR0507). .

tassilobalbo/openCanSat
Library • 0.0.2 • Published on Wed Nov 21 22:04:49 2018
Arduino library for openCanSat kit. Reading temperature, pressure etc. & communication on 434 MHz band

mbed-isad/rosserial_mbed_lib
Library • 0.0.0+sha.e5254bf7e322 • Published on Thu May  8 06:34:37 2014
rosserial for Hydro

xiloxl/Powerbaas
Library • 1.3.3 • Published on Fri Jun 24 13:37:33 2022
Arduino library for Powerbaas Smart Meter P1 Shield. Read power usage and meter readings from your smart meter
ikke-t commented 2 years ago

commenting out the Time.h fixes it. Probably TimeLib.h already is enough.

diff --git a/src/WClock.h b/src/WClock.h
index f2cd069..5c5f94f 100644
--- a/src/WClock.h
+++ b/src/WClock.h
@@ -12,7 +12,7 @@
 #endif
 #include <NTPClient.h>
 #include <WiFiUdp.h>
-#include <Time.h>
+//#include <Time.h>
 #include <TimeLib.h>
 #include "WDevice.h"
 #include "WNetwork.h"
ikke-t commented 2 years ago
  1. The platformio.ini file link is wrong: https://github.com/klausahrenberg/WThermostatBeca/blob/master/WThermostat/platformio.ini

this would work:

https://github.com/klausahrenberg/WThermostatBeca/blob/master/platformio.ini