airmeter-io / AirMeter.IO.Firmware

AirMeter.io is an OpenSource platform for building Internet of Things (IoT) connected CO2 monitors.
https://airmeter.io
GNU General Public License v3.0
7 stars 1 forks source link

[ESP32-S2] Fails compiling "This header should only be included when building for ESP32" #3

Open Shohreh opened 1 year ago

Shohreh commented 1 year ago

Hello,

Since I have a T8 device (ESP32-S2 module) that won't run the TFT_eSPI module with another, Arduino-based firmware… I tried compiling AirMeterIO, but it fails after a while with:

…
In file included from ../common/Common.h:43,
                 from ../components/MQTTCon/include/Mqtt.h:3,
                 from ../components/MQTTCon/src/Mqtt.cpp:1:
../../components/esp_rom/include/esp32/rom/ets_sys.h:15:2: error: #error "This header should only be included when building for ESP32"
   15 | #error "This header should only be included when building for ESP32"
      |  ^~~~~
[741/944] Linking C static library esp-idf/console/libconsole.a
[742/944] Building C object esp-idf/esp_hid/CMakeFiles/__idf_esp_hid.dir/src/esp_hidd.c.obj
ninja: build stopped: subcommand failed.

Cheers,

FurballTheGreat commented 1 year ago

Ok this is simply that I haven't done the work to do a ESP32-S2 build. Is that the nice new ESP32-S2 T-Display board? I was thinking of targeting that :)

Note Lilygo do two versions of the ESP32-S2 T8 - One with a small lcd and one without. Are you referring to the one with a display?

Shohreh commented 1 year ago

It's this one.

The only difference with the T-Display is an on/off switch to handle the battery, so an external switch isn't required.

I looked at the AirMeter project because of the nice e-ink display: The display on the T-Display/T8 use quite a lof of energy.

FurballTheGreat commented 1 year ago

The advantage of the EPD displays is that they can permanently display an image without drawing power. The actual redraw is quite power hungry. Therefore I suspect that with some power management in certain use cases an LCD would actually be more power efficient.

EPD will win if:-

  1. It is important to see current reading at all times without pressing a button to wake device.
  2. Display updates are infrequent and user interaction with device buttons is relatively minimal so redraws are minimal.

LCD will win if:-

  1. The display can turn off after a set number seconds since last button press.
  2. Button presses are frequent and cause display updates very frequently.
  3. Other reasons are present for very frequent display updates.

It will take some time to implement LCD support that power saves at appropriate times so that the advantages of this design direction could be attained. Keep your T8 board I'd say this is a good first target for an LCD mode.

Shohreh commented 1 year ago

Thank you